Add dialog to report failed articles as GitHub issues - #73
Merged
Merged
Conversation
… 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.
✅ Deploy Preview for savrlist ready!
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.
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.
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
FailureReportDialog.tsx) shows the diagnostic payload in an editable text field with a collapsible "What gets shared" sectionfailureReport.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.ts) determines whether the app is running as an installed PWA (covers Chromium display-mode and iOS navigator.standalone)useFailureReport.ts) manages the dialog state and is called fromArticleListScreenandArticleScreenwhen URL ingestion failsConfiguration & Privacy
VITE_FAILURE_REPORT_REPO(e.g.,jonocodes/savr-failure-reports) is set during buildVITE_FAILURE_REPORT_REPOunset — no dialog or affordance appearsTesting
VITE_FAILURE_REPORT_REPOto enable the feature in test buildsScreenshots
After a failed save (the error snackbar appears first):
Expanded, showing the editable diagnostic payload that travels into the issue:
Closes #71