Skip to content

Add web form to report bugs and request features - #19

Open
patrickrb wants to merge 3 commits into
mainfrom
optio/task-3668f6c4-18e2-4532-b47c-71b029b5f2b9
Open

patrickrb wants to merge 3 commits into
mainfrom
optio/task-3668f6c4-18e2-4532-b47c-71b029b5f2b9

Conversation

@patrickrb

Copy link
Copy Markdown
Owner

Summary

Adds a bug-report / feature-request web form at /report, as an alternative to opening a GitHub issue (per the feature request). The form collects the required details, allows image attachments, and emails one submission per item to k1af@ft8af.app.

What's included

  • src/pages/report.mjs — a localized form page built through the existing SSG:
    • Segmented Bug report / Feature request toggle that swaps the relevant field groups.
    • Bug fields: summary, what happened, steps to reproduce, expected/actual, and a Your setup group (FT8AF version, install source, Android version, device, radio, cable).
    • Feature fields: summary, the idea, and the problem it solves.
    • Optional callsign, contact email, and screenshot uploads (≤5 images).
    • Off-screen honeypot for spam, plus GitHub/email fallbacks (and a <noscript> notice).
  • api/report.js — a Vercel web-handler (POST /api/report) that parses the multipart body with the native request.formData() (no new deps), validates it, and sends exactly one email via Resend. api/_report-lib.js holds the pure validation / email-building logic.
  • public/assets/report.css + a progressive-enhancement handler in ft8af.js (type toggle, attachment preview + client-side size/count limits, fetch submit with success/error/not_configured/network states).
  • Discoverability: a footer link ("Report a bug / request a feature") and a callout on the wiki bug-report guide.
  • test/report.test.mjs — 17 node --test cases covering validation, spam/honeypot handling, subject/body building, attachments, and the handler end-to-end (503 when unconfigured, 200 with a stubbed transport, 422/502 error paths). Run with npm test.

Configuration

Email delivery is gated on Vercel environment variables (documented in the README):

Var Required Default
RESEND_API_KEY ✅ to send — (otherwise a clear "not configured" response + on-page fallbacks)
REPORT_TO optional k1af@ft8af.app
REPORT_FROM optional FT8AF Feedback <feedback@ft8af.app>

Verification

  • node build.mjs — builds all 160 pages (10 routes × 16 locales).
  • check-i18n — passes (new keys are English-only and fall back per the project's design; no structural errors).
  • check_links.py — all internal refs resolve.
  • node --check public/assets/ft8af.js — passes.
  • npm test — 17/17 passing.
  • Generated HTML validated to produce the same rule categories as existing pages (no new HTML issues).

Notes / assumptions

  • Follows the repo convention of committing source only — generated public/*.html is rebuilt by CI/Vercel and not included.
  • New copy is added to src/i18n/en.json only; other locales fall back to English until translated (the documented workflow).
  • Chose Resend (HTTP API, no SDK) to stay dependency-free and match the existing Vercel-function style; swappable via the isolated _report-lib.js if a different transport is preferred.
  • The CI workflow was intentionally not modified (token lacks workflow scope); tests run via npm test.

🤖 Generated with Claude Code

Adds a /report page with a form that collects the required bug/feature
details, allows image attachments, and emails a single submission per
item to k1af@ft8af.app — an alternative to opening a GitHub issue.

- src/pages/report.mjs: localized form page (bug vs feature field groups,
  environment fields, screenshot upload, honeypot, GitHub/email fallbacks).
- api/report.js + api/_report-lib.js: Vercel web-handler that validates the
  multipart submission and sends one email via Resend (RESEND_API_KEY,
  REPORT_TO, REPORT_FROM env vars); pure logic split out for testing.
- public/assets/report.css + form enhancement in ft8af.js (type toggle,
  attachment preview/limits, fetch submit with success/error states).
- Footer link + wiki bug-report callout pointing to the form; en.json copy.
- test/report.test.mjs (node --test) covering validation, email building
  and the handler end-to-end; wired into CI and `npm test`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ft8af-site Ready Ready Preview, Comment Jul 22, 2026 3:01pm

Request Review

- Restrict attachments to image/* MIME types server-side (drop anything
  else) so the endpoint only forwards screenshots, not arbitrary files.
- Lower the attachment caps to ~4 MB total / 4 MB per file to stay under
  Vercel's 4.5 MB request-body limit, and match the form copy + client
  check to it.
- Add a test asserting non-image uploads are dropped.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- ft8af.js: move keyboard/screen-reader focus to the error note on a failed
  submit (the `.focus &&` guard was gating setAttribute, so focus never moved),
  matching the success-note behavior.
- ft8af.js: correct the client attachment-size fallback from 9 MB to 4 MB so it
  matches the server cap if data-max-mb is ever absent.
- report.mjs: drop an unused destructured `ph` param; route the honeypot label
  through i18n so no visible copy is hard-coded.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant