Skip to content

feat(feedback): embed the FleetCrown feedback widget site-wide - #114

Merged
catomean merged 1 commit into
mainfrom
feat/fleetcrown-feedback-widget
Aug 25, 2026
Merged

feat(feedback): embed the FleetCrown feedback widget site-wide#114
catomean merged 1 commit into
mainfrom
feat/fleetcrown-feedback-widget

Conversation

@catomean

Copy link
Copy Markdown
Collaborator

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 at next build and the <Script> never ships. It is baked in — confirmed present in .next/server/app/*.html.

Not needed here

  • CSP — this app sets no Content-Security-Policy, so no script-src / connect-src change.
  • data-fc-bottom — no existing bottom-right floating button to stack above.

Verification

npm run build green. Production server (next start) driven headlessly with Puppeteer over /, /features, /security:

  • script tag present on all three with the correct src and data-fc-project
  • https://fleetcrown.orangecat.ch/widget.js → 200 (then 304 cached)
  • …/api/widget-boot?token=fcw_… → 200 on every page
  • zero page errors, zero console errors from the embed

The only console errors are pre-existing NextAuth /api/auth/session 500s caused by the local .env lacking 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

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.
@catomean
catomean merged commit 5478220 into main Aug 25, 2026
2 checks passed
@catomean
catomean deleted the feat/fleetcrown-feedback-widget branch August 25, 2026 18:25
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