Skip to content

Add dialog to report failed articles as GitHub issues - #73

Merged
jonocodes merged 9 commits into
mainfrom
implement/71
Sep 29, 2026
Merged

jonocodes merged 9 commits into
mainfrom
implement/71

Conversation

@jonocodes

@jonocodes jonocodes commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

When an article fails to load, Savr now offers a dialog to file a public GitHub issue with diagnostic details. The user reviews (and can edit) a JSON payload before the browser opens GitHub's prefilled new-issue form under their own account. Savr itself makes no network request for this feature.

Changes

  • New dialog component (FailureReportDialog.tsx) shows the diagnostic payload in an editable text field with a collapsible "What gets shared" section
  • Failure report utilities (failureReport.ts) build the GitHub issue title, body, and URL; handle URL length trimming to stay within limits (error detail and user agent are shortened first, then dropped if needed)
  • PWA detection utility (pwa.ts) determines whether the app is running as an installed PWA (covers Chromium display-mode and iOS navigator.standalone)
  • Hook (useFailureReport.ts) manages the dialog state and is called from ArticleListScreen and ArticleScreen when URL ingestion fails
  • E2E tests verify the dialog appears, can be dismissed, carries edits, and opens a correctly formatted GitHub link
  • Documentation updates explain the feature, its build-time configuration, privacy model, and URL trimming strategy

Configuration & Privacy

  • Build-time gated: Only enabled when VITE_FAILURE_REPORT_REPO (e.g., jonocodes/savr-failure-reports) is set during build
  • Self-hosted builds: Leave VITE_FAILURE_REPORT_REPO unset — no dialog or affordance appears
  • User-initiated only: Dismissed by default; only filed if the user clicks "File on GitHub"
  • No app network request: The browser opens GitHub's form; Savr never sends the payload to any server
  • Payload contents: URL, error message, app version/build timestamp/mode (PWA vs browser), user agent, and report timestamp — never article content, reading data, or credentials

Testing

  • Playwright config sets VITE_FAILURE_REPORT_REPO to enable the feature in test builds
  • E2E tests stub GitHub links and verify dialog behavior, payload editing, and mobile screen reachability
  • Unit tests cover payload building, issue URL encoding, URL trimming, and payload parsing

Screenshots

After a failed save (the error snackbar appears first):

Failure report dialog

Expanded, showing the editable diagnostic payload that travels into the issue:

Failure report dialog with the diagnostic payload expanded

Closes #71

… issue

When a URL ingest fails at error level, offer to report it: the dialog
shows an editable, pretty-printed payload and "File on GitHub" opens a
prefilled public issue under the user's own GitHub account. Savr makes
no network request for this — there is no backend.

Gated by build-time VITE_FAILURE_REPORT_REPO, so self-hosted builds see
no dialog or affordance. Payloads are minified for the issue URL and
trimmed when oversized (error detail and user agent shortened first,
then dropped).

Refs #71
They remain embedded in PR #73 via the pinned commit that added them,
so the repo carries no screenshots but the PR does.
@jonocodes jonocodes closed this Sep 29, 2026
@jonocodes jonocodes reopened this Sep 29, 2026
@netlify

netlify Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for savrlist ready!

Name Link
🔨 Latest commit 811c628
🔍 Latest deploy log https://app.netlify.com/projects/savrlist/deploys/6abb573ebdf610000890a8a5
😎 Deploy Preview https://deploy-preview-73--savrlist.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

People type "example.com/article"; fetch then resolved it relative to
the app origin, and the failure-report payload's url failed validation,
leaving "File on GitHub" disabled with a misleading JSON error. Prepend
https:// for schemeless input (host:port included) in the add-article
and refetch paths, and spell out the http(s) requirement in the report
dialog's error copy.
GitHub applies it when the reporter has permission to label the target
repo; everyone else's report is still identified by the [report] title
prefix. The label exists in jonocodes/savr.
…url]

Reports now include app.origin so it is clear which deployment
(savr.link, a Netlify preview, or a self-hosted build) produced the
failure; app.buildTimestamp already carries the deploy date. Also
switch the issue title prefix from [report] to [failed-url], matching
the label the report requests.
The JSON was minified to save URL length, so GitHub rendered it as one
long line. Pretty-print it in the issue body instead; the URL builder
still trims the payload to stay within its budget.
@jonocodes
jonocodes merged commit 878d720 into main Sep 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add 'Report this failed article' dialog that files a prefilled GitHub issue

1 participant