fix(dashboard): stop ChatPage from clearing all pages' header action buttons
When embedded chat is enabled, ChatPage renders persistently outside <Routes> but is initially hidden during the plugin-loading window (~2-4s). Once plugins finish loading, ChatPage mounts for the first time. Its header-slot effect had early-return branches for !isActive and !narrow that actively called setEnd(null). Because the user was on /cron, /models, /sessions, or any non-chat page, this wiped the action buttons that the current page had already placed in the header. Affected pages include: - Cron page — CREATE button disappears - Models page — 7D/30D/90D filter buttons disappear - Sessions page — search box disappears The fix collapses the two early-return branches into one and removes the setEnd(null) calls. Now ChatPage only sets end when it actually owns the slot (isActive && narrow), and lets the normal cleanup handle unmounting. PageHeaderProvider already clears all slots on pathname change via useLayoutEffect, so ChatPage's active clearing was redundant and harmful. Fixes #31862 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
0054c7edcb
commit
8c3c52b008
|
|
@ -410,14 +410,7 @@ export default function ChatPage({ isActive = true }: { isActive?: boolean }) {
|
|||
useEffect(() => {
|
||||
// When hidden (non-chat tab) we must not register the header button —
|
||||
// another page owns the header's end slot at that point.
|
||||
if (!isActive) {
|
||||
setEnd(null);
|
||||
return;
|
||||
}
|
||||
if (!narrow) {
|
||||
setEnd(null);
|
||||
return;
|
||||
}
|
||||
if (!isActive || !narrow) return;
|
||||
setEnd(
|
||||
<Button
|
||||
ghost
|
||||
|
|
|
|||
Loading…
Reference in New Issue