overview digest #51

Merged
eleith merged 40 commits from gemini/feat/overview-digest into main 2025-08-23 16:02:50 +00:00
Owner
  • make one call to retrieve ALL unread entries (as opposed to a fetch PER category)
  • email all digests in one email (as opposed to one email per digest)
- make one call to retrieve ALL unread entries (as opposed to a fetch PER category) - email all digests in one email (as opposed to one email per digest)
eleith added 34 commits 2025-08-22 04:35:24 +00:00
Refactors data fetching, grouping, and initial processing for the new overview digest.
Updates configuration, main application loop, and preview script.
Adjusts related tests for compatibility.
This commit refactors the code to break a circular dependency between the `digest` and `llm` packages.

The `digest` package was responsible for both creating the LLM prompt and parsing the response, while also depending on the `llm` package to make the actual API call. This created a tight coupling between the two packages.

This commit introduces a new `DigestLLMService` in the `digest` package, which is responsible for all LLM-related logic within the digest context. The `llm` package now provides a more generic `LLMService` that is only responsible for making the API call.

This change improves the separation of concerns and makes the code more modular and easier to maintain.
This commit updates the MockDigestService in internal/testutil/mocks.go to reflect the change in the BuildDigestData signature, which now includes the sortBy parameter. This ensures consistency between the mock and the actual interface, and allows for proper testing of the sorting functionality.
This commit refactors the getHTML function in internal/archive/archive.go to accept an html/template.Template as an argument. This makes the function reusable for different HTML templates, such as the overview digest and grouped entries.
This commit implements the HTML generation for the overview digest and grouped entries.

- Renamed internal/templates/entries.gohtml to internal/templates/grouped-entries.gohtml.
- Created internal/templates/overview.gohtml.
- Made getHTML function in internal/archive/archive.go reusable.
- Modified internal/archive/archive.go to create daily archive directories and render HTML files for both the overview and grouped entries.
This commit implements the email functionality for the overview digest and grouped entries.

- Modified internal/email/email.go to send one email with the Overview Digest as the body and attach all Group Digest HTML files.
- Updated internal/app/interfaces.go and internal/testutil/mocks.go to reflect the changes in the Send function signature.
- Updated cmd/miniflux-digest/main.go and internal/processor/processor.go to reflect the changes in the Send function signature and to pass the data to the Send function.
This commit updates the scripts/preview/main.go to use the ArchiveService to generate the overview and grouped entry HTML files.

- Removed the generateHTML and writeHTMLToFile functions.
- Called application.ArchiveService.MakeArchiveHTML to generate the HTML files.
- Updated the email sending logic to use the files returned by MakeArchiveHTML.
Renamed the generic HTMLTemplateData struct to OverviewTemplateData
to better reflect its purpose as the data model for the digest overview.
This improves clarity and consistency with GroupedEntriesTemplateData.

Updated all references across the codebase, including:
- internal/app/services/*
- internal/archive/archive.go
- internal/digest/digest.go
- internal/email/email.go
- internal/email/email_test.go
- internal/models/models.go
- internal/processor/processor.go
- internal/templates/templates.go
- internal/templates/templates_test.go
- internal/testutil/mocks.go
- scripts/preview/main.go
modifies email service to account for attaching multiple digests in one
email.

updates preview-email for testing
This commit refactors the archive cleanup functionality to be more robust and general.

The previous implementation relied on directory names to identify old archives. This new implementation crawls the directory tree and removes files based on their modification time. It then does a second pass to remove any empty directories.

This approach is more resilient to changes in the directory structure and accurately reflects the user's intent to clean up old files based on their age.
fix up preview to handle miniflux and mock data separately
mark entries in digest as read
eleith added 6 commits 2025-08-23 15:55:56 +00:00
eleith merged commit 4ce33975ee into main 2025-08-23 16:02:50 +00:00
eleith deleted branch gemini/feat/overview-digest 2025-08-23 16:02:50 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: eleith/miniflux-digest#51