feat(feedback): embed the FleetCrown feedback widget site-wide - #114
Merged
Conversation
Loads on every public page from the root layout via next/script (afterInteractive). The project token is a string literal rather than an env read: Next tree-shakes an empty `process.env` value at build time, so a runtime-only variable would ship a Script that never has a token. No CSP is set on this app, so no script-src/connect-src change is needed, and there is no existing bottom-right floating button to stack above.
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.
Adds the FleetCrown feedback widget to the root layout so it loads on every public page.
Diff: one file,
src/app/layout.tsx(+9 lines). Nothing else.Why a string literal token
Read from
process.env, the token tree-shakes to an empty string atnext buildand the<Script>never ships. It is baked in — confirmed present in.next/server/app/*.html.Not needed here
Content-Security-Policy, so noscript-src/connect-srcchange.data-fc-bottom— no existing bottom-right floating button to stack above.Verification
npm run buildgreen. Production server (next start) driven headlessly with Puppeteer over/,/features,/security:srcanddata-fc-projecthttps://fleetcrown.orangecat.ch/widget.js→ 200 (then 304 cached)…/api/widget-boot?token=fcw_…→ 200 on every pageThe only console errors are pre-existing NextAuth
/api/auth/session500s caused by the local.envlacking auth secrets — unrelated to this change.npm run verify: typecheck pass, design:check pass, tests 76 pass / 10 skipped, lint pass.🤖 Generated with Claude Code