Skip to content

fix(web): closed plan sidebar stays closed when returning to a thread - #5484

Merged
t3dotgg merged 1 commit into
mainfrom
t3code/persist-closed-plan-state
Aug 6, 2026
Merged

fix(web): closed plan sidebar stays closed when returning to a thread#5484
t3dotgg merged 1 commit into
mainfrom
t3code/persist-closed-plan-state

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Aug 6, 2026

Copy link
Copy Markdown
Member

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 ChatView ref (which was cleared on every thread change) into planSidebarDismissal.ts, a small module-level map keyed by thread and turn. ChatView now calls dismissPlanSidebarForTurn, clearPlanSidebarDismissal, and isPlanSidebarDismissedForTurn with activeThreadKey / scopedThreadKey everywhere 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

  • Replaces a component-level useRef with a new module planSidebarDismissal.ts that tracks dismissed turn keys per thread in a Map, persisting across component lifecycles and thread navigation.
  • The auto-open effect in ChatView.tsx now checks this shared store before opening, so a dismissed sidebar stays closed when re-entering the same thread on the same turn.
  • Dismissal is cleared when the plan surface is explicitly activated, when the user manually opens the sidebar, or when a new implementation begins, ensuring auto-open works correctly for future turns.

Macroscope summarized 9589e10.

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>
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 03e6613b-fe43-43b3-a8b9-2294d941ad22

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Aug 6, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

@t3dotgg
t3dotgg merged commit 1ffba70 into main Aug 6, 2026
17 checks passed
@t3dotgg
t3dotgg deleted the t3code/persist-closed-plan-state branch August 6, 2026 09:37
omegent-app Bot added a commit to patroza/t3code that referenced this pull request Aug 6, 2026
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>
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 6, 2026
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant