From 30485957dd7c75b277cc50dd2c08160d46b7719d Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Sun, 16 Aug 2026 05:06:20 +0000 Subject: [PATCH] fix(ui): hide the feedback FAB on chat routes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- src/app/client-layout.jsx | 9 +++++++++ src/app/layout.jsx | 3 +-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/client-layout.jsx b/src/app/client-layout.jsx index bdf6e8d1..0a2955be 100644 --- a/src/app/client-layout.jsx +++ b/src/app/client-layout.jsx @@ -2,6 +2,7 @@ import { useEffect, useState } from 'react'; import { usePathname } from 'next/navigation'; +import { FeedbackWidget } from '@profullstack/stack/feedback'; import { useThemeStore, themeUtils } from '@/lib/stores/theme.js'; import { useI18n } from '@/lib/hooks/useI18n.js'; import { i18nUtils, languages } from '@/lib/stores/i18n.js'; @@ -62,6 +63,14 @@ export default function ClientLayout({ children }) { )} + {/* pathname is passed explicitly so hideOnRoutes tracks client-side + navigation — the widget's own detection only reads window.location + on first render, which never re-runs from a root layout. */} +