fix(web): closed plan sidebar stays closed when returning to a thread - #5484
Conversation
The dismissed-for-turn marker lived in a ChatView ref that was reset on every thread change, so leaving and re-entering a thread forgot the dismissal and the auto-open effect reopened the plan sidebar. Track dismissals in a module-level per-thread map instead, still keyed by turn so new plan steps continue to auto-open. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved 9589e10 Simple bug fix that moves plan sidebar dismissal state from a component ref to a module-level Map, allowing the dismissed state to persist when navigating between threads. Self-contained UI state change with no security or schema implications. You can customize Macroscope's approvability policy. Learn more. |
Merges upstream directly rather than rebuilding the provenance stack and importing a tree delta. upstream/main is append-only, so a merge is sound, and because the previous sync recorded upstream ancestry the merge base is a2ca89a -- this replays three commits, not the whole divergence: a483337 fix: respect time format for sidebar snooze (pingdotgg#4438) 1ffba70 fix(web): closed plan sidebar stays closed when returning (pingdotgg#5484) 3da315e perf(server): stop shipping full MCP tool results (pingdotgg#5482) Two resolutions. SidebarV2.tsx conflicted three ways. The import block is a union: the fork needs EnvironmentId, upstream adds TimestampFormat. The other two are useCallback dependency arrays where upstream adds updateThreadMetadata and timestampFormat; both identifiers exist in the merged file, so omitting them would leave the callbacks capturing stale values. BoardView.tsx did not conflict and still broke. pingdotgg#4438 added a timestampFormat parameter to resolveSnoozePresets and snoozeWakeDescription and updated its own call sites, but the board is fork code, so its two calls kept the old arity. Caught by typecheck, not by git. BoardView already imported useClientSettings, so the fix is the same one-line hook SidebarV2 uses. Verified: full recursive typecheck clean; apps/web 2087 tests pass. Two failures predate this merge and reproduce on fork/dev unmerged -- a Codex structured output test, and runtimeAbi.test.ts failing to transform a vendored .wasm asset. Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
## What's Changed * perf(server): stop shipping full MCP tool results in thread payloads by @t3dotgg in pingdotgg/t3code#5482 * fix(web): closed plan sidebar stays closed when returning to a thread by @t3dotgg in pingdotgg/t3code#5484 * fix: respect time format for sidebar snooze by @huxcrux in pingdotgg/t3code#4438 **Full Changelog**: pingdotgg/t3code@v0.0.32-nightly.20260806.1012...v0.0.32-nightly.20260806.1014 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.32-nightly.20260806.1014
Closing the plan sidebar, leaving the thread, and coming back reopened the plan sidebar. It shouldn't.
The "user dismissed the plan for this turn" marker lived in a ChatView ref that gets wiped on every thread change, so re-entering a thread forgot the dismissal and the auto-open effect kicked in again. The dismissal now lives in a small module-level per-thread map (
planSidebarDismissal.ts) that survives navigation. It stays keyed by turn, so a new turn producing fresh plan steps still auto-opens the sidebar, and explicitly reopening or starting a plan implementation still clears the dismissal.Change authored by Claude Fable 5 via Claude Code.
🤖 Generated with Claude Code
Note
Low Risk
Localized right-panel UX state with no auth, data, or API changes; behavior is limited to when the plan sidebar auto-opens.
Overview
Fixes the plan sidebar reopening after you leave and return to a thread even though you had closed it.
Dismissal state moves out of a
ChatViewref (which was cleared on every thread change) intoplanSidebarDismissal.ts, a small module-level map keyed by thread and turn.ChatViewnow callsdismissPlanSidebarForTurn,clearPlanSidebarDismissal, andisPlanSidebarDismissedForTurnwithactiveThreadKey/scopedThreadKeyeverywhere dismissal mattered—toggle/close, activating the plan surface, thread reset with “open on next thread”, auto-open when plan steps arrive, and optimistic open when implementing a plan.Turn-scoped behavior is unchanged: a new turn can still auto-open the sidebar, and explicitly reopening the plan or starting implementation still clears the dismissal for that thread.
Reviewed by Cursor Bugbot for commit 9589e10. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix plan sidebar to stay closed when returning to a thread
useRefwith a new moduleplanSidebarDismissal.tsthat tracks dismissed turn keys per thread in aMap, persisting across component lifecycles and thread navigation.ChatView.tsxnow checks this shared store before opening, so a dismissed sidebar stays closed when re-entering the same thread on the same turn.Macroscope summarized 9589e10.