Skip to content

[codex] Close right panel when its last tab closes - #3221

Merged
juliusmarminge merged 1 commit into
mainfrom
t3code/close-empty-right-panel
Jun 20, 2026
Merged

[codex] Close right panel when its last tab closes#3221
juliusmarminge merged 1 commit into
mainfrom
t3code/close-empty-right-panel

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • close the right panel when its final surface is removed
  • apply the same behavior when closing the final terminal pane or using Close All
  • preserve neighboring-tab activation while other surfaces remain

Root cause

Surface-removal actions cleared activeSurfaceId but left isOpen set to true, which rendered an empty right panel after the last tab closed.

User impact

Closing the last tab now dismisses the right panel instead of leaving an empty panel visible.

Validation

  • vp test apps/web/src/rightPanelStore.test.ts (26 tests)
  • vp check
  • vp run typecheck

Note

Close the right panel when its last tab or surface is removed

Previously, the right panel stayed open even after all surfaces or terminal panes were closed. Three handlers in rightPanelStore.ts are updated to set isOpen to false when no surfaces remain: closeTerminal, closeSurface, and closeAllSurfaces. Behavioral Change: the right panel now auto-closes when emptied, whereas before it remained open with no content.

Macroscope summarized 7295f63.


Note

Low Risk
Localized UI state in the right-panel Zustand store with updated unit tests; no auth, data, or API changes.

Overview
Fixes a bug where closing the last right-panel tab left an empty panel visible because isOpen stayed true after surfaces were cleared.

closeTerminal (when the final pane removes the surface), closeSurface, and closeAllSurfaces in rightPanelStore.ts now set isOpen to false when no surfaces remain (surfaces.length === 0). Closing a non-active surface also applies the same rule so the panel does not stay open after the last tab is gone. Neighboring-tab activation when other surfaces remain is unchanged.

Tests in rightPanelStore.test.ts expect isOpen: false for the last terminal pane, last surface, and close-all flows.

Reviewed by Cursor Bugbot for commit 7295f63. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jun 20, 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

Run ID: f4796bec-1641-4cdb-9e57-8c51f0654187

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/close-empty-right-panel

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Jun 20, 2026
@juliusmarminge
juliusmarminge marked this pull request as ready for review June 20, 2026 06:48
@juliusmarminge
juliusmarminge merged commit dc82f79 into main Jun 20, 2026
21 checks passed
@juliusmarminge
juliusmarminge deleted the t3code/close-empty-right-panel branch June 20, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 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