Skip to content

fix: preserve right panel open/close state when switching chats#258

Open
excpt0 wants to merge 1 commit intoop7418:mainfrom
excpt0:fix-tab-open
Open

fix: preserve right panel open/close state when switching chats#258
excpt0 wants to merge 1 commit intoop7418:mainfrom
excpt0:fix-tab-open

Conversation

@excpt0
Copy link

@excpt0 excpt0 commented Mar 12, 2026

Summary

  • Fix right panel (Tasks/Files) ignoring user's open/close preference when switching between chats
  • Panel previously force-reopened on every chat switch due to two redundant setPanelOpen(true) calls and a route-change effect that always set panelOpen = isChatDetailRoute
  • Extract panel state decision logic into a pure function (computePanelOpenOnRouteChange) with full unit test coverage

Root Cause

Two locations unconditionally forced the panel open:

  1. AppShell.tsx route-change effect: setPanelOpenRaw(isChatDetailRoute) — always true for /chat/[id]
  2. chat/[id]/page.tsx and SplitColumn.tsx: setPanelOpen(true) on every session load

@vercel
Copy link

vercel bot commented Mar 12, 2026

Someone is attempting to deploy a commit to the op7418's projects Team on Vercel.

A member of the Team first needs to authorize it.

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