Make a bug report one click, and fill in the half the reporter cannot #1065
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1065
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/one-click-bug-report"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Reporting a bug meant finding the repository, choosing between six issue templates, and then working out for yourself which build, Node version and browser you were running. The parts a reporter can reasonably supply — what happened, how to make it happen — are the short part. The rest is the part they leave out, and a report with no build in it is a conversation rather than a bug.
What this adds
A Report a bug button in the top bar, one click from anywhere in the app. It opens the new-issue form pre-filled with what the running app already knows:
GET /api/version— package version, optionalPF_COMMITlocation.hrefThe body carries an empty What happened and a numbered Steps to reproduce skeleton, plus a comment noting that the environment block was filled in by the app so the reporter knows what to correct.
/api/versionis deliberately tiny and dependency-free: it readspackage.jsonat request time and reportsdevices: catalog.length.When things go wrong
If
/api/versioncannot be reached, the version field says so —unknown (GET /api/version failed: …)— and the form still opens. A server that will not answer is frequently the bug being reported.Tests
test/bug-report.test.js(26 assertions) loads the realweb/app.jsin a stub DOM and tests the builder directly: the URL points at the Forgejo tracker and not the GitHub mirror, every environment field reaches the body, the title/body round-trip throughencodeURIComponent, and — the important one — an empty environment yieldsunknown, never the literal"undefined"or"null". It also asserts the button exists inindex.htmlinside.topbar-actions, with anaria-label, atitle, and a click handler inapp.js.scripts/smoke-http.jsnow checks/api/versionanswers, and that the catalogue size it reports equals what/api/catalogserves.Verified locally
node scripts/syntax-check.js162 files OK ·npm test103 suites, 4951 assertions, 0 failures ·node scripts/smoke-http.jsall checks clean (/api/version→0.1.0,node v24.11.0, 1549 models on both endpoints).Reporting a bug meant finding the repository, choosing between six issue templates, and then working out for yourself which build, Node version and browser you were running. Everything the person reporting it can reasonably be asked for - what happened, and how to make it happen - is the short part. The rest is the part they get wrong or leave out, and a report with no build in it is a conversation rather than a bug. There is now a Report a bug button in the top bar. It opens the new-issue form pre-filled with what the running app already knows: - PacketForge version, from a new GET /api/version (package version, optional PF_COMMIT, Node, platform, catalogue size) - the browser's own user-agent string and the page URL - the catalogue size, which is what makes 'this device is missing' answerable without a second round trip The body has an empty What happened and a numbered Steps to reproduce skeleton, and a comment saying the rest was filled in by the app so the reporter knows what to correct. When /api/version cannot be reached the field says so, and the form still opens: the server not answering is itself the bug being reported. test/bug-report.test.js loads the real app.js in a stub DOM and asserts the builder directly, including that an empty environment yields 'unknown' and never the string 'undefined'. scripts/smoke-http.js now checks /api/version answers and counts the same catalogue as /api/catalog.