Skip to content

fix(ui): hide the feedback FAB on chat routes - #258

Merged
ralyodio merged 1 commit into
masterfrom
worktree-hide-feedback-on-chat
Aug 16, 2026
Merged

fix(ui): hide the feedback FAB on chat routes#258
ralyodio merged 1 commit into
masterfrom
worktree-hide-feedback-on-chat

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

The feedback button was covering the message submit button in the chat window.

Why it wasn't already hidden

hideOnRoutes={['/chat', '/chats', '/u', '/anon']} was already set, but the widget was mounted from the server root layout (src/app/layout.jsx). Without an explicit pathname prop, FeedbackWidget falls back to reading window.location.pathname during render — and a root layout never re-renders on client-side navigation. So the route check only ran once, on initial load: navigate from / into a conversation and the FAB stayed up.

Fix

Move the widget into ClientLayout, which already calls usePathname(), and pass it through explicitly. The widget's own docs call this out as the supported way to make hideOnRoutes track SPA navigation. Same property, same route list — only where it's mounted changes.

Verification

  • pnpm build compiles and type-checks both changed files.
  • The build then fails at page-data collection with supabaseUrl is required for /api/auth/key-backup — verified pre-existing by stashing the change and rebuilding: identical failure. It's a missing-env artifact of building without secrets, unrelated to this diff.

🤖 Generated with Claude Code

The widget was mounted from the server root layout, where its built-in
pathname detection reads window.location once and never re-runs — the
root layout does not re-render on client-side navigation. So hideOnRoutes
only took effect on a hard load, and the FAB stayed up after navigating
into a conversation, covering the message submit button.

Move it into ClientLayout and pass usePathname() explicitly so the hide
tracks SPA navigation.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

91 finding(s)

HIGH/CRITICAL: 5 | MEDIUM: 10 | LOW: 76

Severity Rule Location
HIGH secret-generic-credential scripts/supabase-email.sh:21
HIGH secret-generic-credential scripts/supabase-twilio.sh:32
HIGH secret-generic-credential scripts/supabase-twilio.sh:47
HIGH js-host-header-trust src/lib/websocket/middleware/auth.js:31
HIGH js-cors-origin-reflected src/lib/websocket/server.js:121
MEDIUM manifest-install-lifecycle-script package.json:33
MEDIUM js-shell-exec-interpolation scripts/convert-routes.mjs:9
MEDIUM redos-nested-quantifier src/app/api/profile/update/route.js:73
MEDIUM js-unescaped-html-sink src/app/blog/[slug]/page.jsx:38
MEDIUM js-unescaped-html-sink src/app/blog/[slug]/page.jsx:66
MEDIUM js-unescaped-html-sink src/app/faq/page.jsx:57
MEDIUM js-unescaped-html-sink src/app/layout.jsx:137
MEDIUM js-unescaped-html-sink src/app/layout.jsx:141
MEDIUM js-unescaped-html-sink src/app/page.jsx:47
MEDIUM js-unescaped-html-sink src/lib/components/chat/MessageItem.jsx:60
LOW secret-generic-credential src/app/api/auth/invite-anon/route.test.js:24
LOW secret-generic-credential src/app/api/auth/register-anon/route.test.js:32
LOW secret-jwt src/app/api/auth/upload-avatar/route.test.js:27
LOW secret-generic-credential src/app/api/auth/upload-avatar/route.test.js:27
LOW secret-generic-credential src/app/api/profile/update/route.test.js:63
LOW secret-generic-credential src/lib/websocket/middleware/auth.test.js:47
LOW secret-generic-credential src/lib/websocket/middleware/auth.test.js:64
LOW secret-generic-credential tests/auth-key-generation.test.js:109
LOW secret-generic-credential tests/auth-key-generation.test.js:110
LOW secret-generic-credential tests/auth-key-generation.test.js:157
LOW secret-generic-credential tests/auth-key-generation.test.js:158
LOW secret-generic-credential tests/auth-key-generation.test.js:207
LOW secret-generic-credential tests/auth-key-generation.test.js:208
LOW secret-generic-credential tests/auth-key-generation.test.js:250
LOW secret-generic-credential tests/auth-key-generation.test.js:251
LOW secret-generic-credential tests/auth-key-generation.test.js:293
LOW secret-generic-credential tests/auth-key-generation.test.js:294
LOW secret-generic-credential tests/auth-key-generation.test.js:340
LOW secret-generic-credential tests/auth-key-generation.test.js:341
LOW secret-generic-credential tests/auth-key-generation.test.js:381
LOW secret-generic-credential tests/auth-key-generation.test.js:382
LOW secret-generic-credential tests/chat-archive.test.js:22
LOW secret-jwt tests/debug-sms.js:10
LOW secret-generic-credential tests/gpg-private-key-export.test.js:63
LOW secret-generic-credential tests/gpg-private-key-export.test.js:64
LOW secret-generic-credential tests/nuclear-delete.test.js:19
LOW secret-generic-credential tests/nuclear-delete.test.js:89
LOW secret-generic-credential tests/nuclear-delete.test.js:97
LOW secret-generic-credential tests/password-security-fix-verification.test.js:51
LOW secret-generic-credential tests/password-security-fix-verification.test.js:75
LOW secret-generic-credential tests/password-security-fix-verification.test.js:76
LOW secret-generic-credential tests/password-security-fix-verification.test.js:102
LOW secret-generic-credential tests/password-security-fix-verification.test.js:156
LOW secret-generic-credential tests/password-security-fix-verification.test.js:174
LOW secret-generic-credential tests/phone-auth-fix.test.js:49

…and 41 more. Full results in the Security tab.

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit 19ee19f into master Aug 16, 2026
10 checks passed
@ralyodio
ralyodio deleted the worktree-hide-feedback-on-chat branch August 16, 2026 05:14
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