Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- 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>
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
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 tok1af@ft8af.app.What's included
src/pages/report.mjs— a localized form page built through the existing SSG:<noscript>notice).api/report.js— a Vercel web-handler (POST /api/report) that parses the multipart body with the nativerequest.formData()(no new deps), validates it, and sends exactly one email via Resend.api/_report-lib.jsholds the pure validation / email-building logic.public/assets/report.css+ a progressive-enhancement handler inft8af.js(type toggle, attachment preview + client-side size/count limits,fetchsubmit with success/error/not_configured/network states).test/report.test.mjs— 17node --testcases 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 withnpm test.Configuration
Email delivery is gated on Vercel environment variables (documented in the README):
RESEND_API_KEYREPORT_TOk1af@ft8af.appREPORT_FROMFT8AF 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.Notes / assumptions
public/*.htmlis rebuilt by CI/Vercel and not included.src/i18n/en.jsononly; other locales fall back to English until translated (the documented workflow)._report-lib.jsif a different transport is preferred.workflowscope); tests run vianpm test.🤖 Generated with Claude Code