Implement v4.8.0: Reporting & Sharing#7
Open
ccleberg wants to merge 4 commits into
Open
Conversation
- DomainExportFormat gains .markdown and .pdf (CaseIterable, Identifiable, titled), alongside the existing text/csv/json. - Markdown reuses the existing text-export content verbatim via a line-based transform (section "Title\n----" underlines become "## Title", the leading title becomes an H1, other lines become bullets), so the two formats can never drift apart. - PDF renders that Markdown as a simple monospaced multi-page document via UIGraphicsPDFRenderer (mirrors AuditExporter's existing PDF approach; degrades to raw Markdown bytes on non-UIKit platforms). - Replaced the single/batch/tracked-domains/workflow share call sites' hand- written per-format switches with format-agnostic functions (exportSingleReportData, exportBatchReportData, exportTrackedDomainsData, exportWorkflowData) that delegate straight to DomainReportExporter, removing the now-orphaned per-format helper functions those switches used to call.
Adds "Export Markdown"/"Export PDF" (and batch/workflow equivalents) to the single-result, batch, watchlist, and workflow export menus, gated behind .advancedExports like the existing CSV/JSON options. Matches the existing menu structure and Pro-gate wording per file rather than introducing a new shared component, consistent with how CSV/JSON were already duplicated across these five menus before this change.
- ScheduledReportService (@mainactor, headless/storage-backed like DomainMonitoringService): builds the latest report for every tracked domain from persisted history, exports it via DomainReportExporter in the configured format (markdown/PDF/JSON), writes it to a local Documents subdirectory, logs the run, and fires a "Scheduled Report Ready" local notification. - ScheduledReportScheduler mirrors DomainMonitoringScheduler's BGTaskScheduler approach with its own task identifier (net.cleberg.DomainDig.report.schedule, added to Info.plist) and a daily/weekly cadence. - ScheduledReportsView (Settings → Scheduled Reports): enable toggle, cadence and format pickers, "Generate Now", and a log of past reports each shareable via the existing ExportPresenter share sheet. - Gated behind the existing .automatedMonitoring capability (Pro), consistent with monitoring being the other background-automation feature. - Settings/logs persist via UserDefaults (DomainExportFormat is now Codable), not DomainDataPortabilityService backup/restore — this is local automation configuration, not user-authored content, same reasoning as v4.7.0's watchlist saved views.
Bump AppVersion/marketing version to 4.8.0 and build number to 40 across the app, widget, and share extension targets. Mark v4.8.0 (markdown/PDF export, scheduled reports, stronger share affordances, verified local API consistency) shipped in RELEASE_ROADMAP.md.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Delivers the v4.8.0 "Reporting & Sharing" roadmap phase.
What
DomainExportFormatgains.markdownand.pdf. Markdown reuses the exact same content as the existing text export via a line-based transform (section "Title\n----" underlines become "## Title", the leading title becomes H1, other lines become bullets) so the two formats can never drift apart. PDF renders that Markdown as a simple monospaced multi-page document viaUIGraphicsPDFRenderer, mirroring the approachAuditExporteralready uses for audit sessions.ScheduledReportService/ScheduledReportScheduler(Settings → Scheduled Reports). A BGTaskScheduler-driven daily/weekly job builds a markdown/PDF/JSON report bundle for every tracked domain, writes it to a local Documents subdirectory, logs the run, and fires a "Scheduled Report Ready" notification. MirrorsDomainMonitoringService's headless, storage-backed design (no live view model needed) and its own BGTaskScheduler identifier. Gated behind the existing Pro.automatedMonitoringcapability, same bucket as monitoring.ExportPresenter.DomainReportdirectly with no field allowlist, soreputation,domainPricing, and everything else added since v4.7.0 already flow through automatically. No code change was needed there — documented the finding instead of making an unasked-for change.Version
Bumped to 4.8.0 (build 40) across app, widget, and share extension targets.
Verification
xcodebuild build(schemeDomainDig, iOS 26 sim) → BUILD SUCCEEDED after each commit.Honest gaps
DomainReportExporter/DomainReportBuilder/DomainDataPortabilityServicecalls thatDomainMonitoringServicealready exercises successfully in production. No UI automation was available to actually tap through Settings → Scheduled Reports → Generate Now and confirm a file lands on disk. This is the top thing to check in UAT.DomainDataPortabilityServicebackup/restore — same scope decision as v4.7.0's watchlist saved views (local automation config, not user-authored content). Flagging again in case that's the wrong call across both features.DomainExportFormat.allCasesthe wayAuditExporter's menu already does. I madeDomainExportFormatCaseIterable/Identifiablespecifically because of this, but chose not to refactor the other four (pre-existing, working) menus to match — that would touch code unrelated to this task. Worth a follow-up if you want the menus deduplicated.