Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): reopening the right panel keeps it maximized #46985

Openkelvenhighermind(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/46985/headopened View on GitHub

Problem

The right panel forgets that it was maximized. Maximize it, close it, and open it again, and it comes back at its normal width. Fixes #46884.

The panel toggle calls closePreviewPanel, which cleared maximized in the right-panel store just before closing. The maximized layout is already gated by isOpen, so the chat column comes back while the panel is closed either way; clearing the stored flag only lost the user's choice.

Change

Keep the stored maximized flag when the panel closes. The panel reopens at the size the user left it, and the titlebar still offers Restore panel size to return to the normal width. One client-side line; no server, contracts, or native changes.

Verification

  • New browser test reopening the right panel keeps it maximized: open the panel, maximize it, close it, reopen it, and assert Restore panel size is still shown. The test times out on the old code and passes with the change.
  • ChatView.browser.test.tsx plus rightPanelStore.test.ts: 108 tests pass.
  • pnpm run check:changed: format, lint, knip, typecheck (2 packages), browser test, and React Compiler all pass.
  • Before/after captured in the dev web app on Linux at 1280×800. The "before" state is the reopened panel at normal width; the "after" state is the same flow with the panel maximized:

Right panel before and after reopening

Full size: before, after.

Model: EXP DEEP 4.1 Flash (experientiallabs/deepseek-v4.1-flash-1017) via OpenCode in T3 Code.

    1. tanstack-source added labelsbug

    2. Explain Change →

      No actionable comments were generated in the recent review.

      Walkthrough

      Closing the right panel no longer clears its maximized state. A browser test opens the Files panel, maximizes it, closes and reopens it, and checks that the restore-size control remains visible.

      Changes: Right panel state

      Layer / File(s)Summary
      Preserve maximized state
      apps/web/src/components/chat/useRightPanelActions.ts, apps/web/src/components/ChatView.browser.test.tsx
      The close action no longer resets the maximized state. A browser test verifies that the panel remains maximized after reopening.

      Estimated code review effort: 2 (Simple) | ~8 minutes

      Change: Bug fix · Severity of issue fixed: Low

      Suggested reviewers: juliusmarminge, stienswout

      Merge Risk: Minimal · up to 91b08

      The right panel now reopens maximized if it was maximized when closed, and the user can still restore its size. The change is small, client-only and covered by a browser test, so merge risk is minimal.

      Pre-merge checks: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe title "fix(web): reopening the right panel keeps it maximized" matches the main change. The PR stops closePreviewPanel from clearing the stored maximized flag, so a maximized right panel stays max…
      Description checkPassedThe description follows the template. It has Problem, Change, and Verification sections, and it links issue #46884 under the bug-fix scope. The Problem section gives the reproduction steps and expecte…
      Linked Issues checkPassed[#46884] requires that a maximized right panel reopen maximized after close and reopen. At the reviewed head, closePreviewPanel in apps/web/src/components/chat/useRightPanelActions.ts no longer ca…
      Out of Scope Changes checkPassedThe whole-PR diff against the merge base has two files according to the summary: a browser test in apps/web/src/components/ChatView.browser.test.tsx (+34 lines) and the one-line removal in `apps/web…
      Full details: Title check

      Explanation

      The title "fix(web): reopening the right panel keeps it maximized" matches the main change. The PR stops closePreviewPanel from clearing the stored maximized flag, so a maximized right panel stays maximized after it is closed and reopened. The title uses a conventional commit prefix and names the affected area (web) and the behavior.

      Full details: Description check

      Explanation

      The description follows the template. It has Problem, Change, and Verification sections, and it links issue #46884 under the bug-fix scope. The Problem section gives the reproduction steps and expected behavior. The Change section explains the one-line fix. The Verification section lists a new browser test, the test results, check runs, and before/after screenshots. The Scope section is only partly covered: the description cites the linked issue but does not explicitly say why the change is a bug fix and not a feature. The template's optional model attribution is present.

      Full details: Linked Issues check

      Explanation

      [#46884] requires that a maximized right panel reopen maximized after close and reopen. At the reviewed head, closePreviewPanel in apps/web/src/components/chat/useRightPanelActions.ts no longer calls useRightPanelStore.getState().setMaximized(activeThreadRef, false) before close(activeThreadRef). That reset was the only code path in this flow that cleared the stored maximized flag. The diff against the merge base shows this one-line removal. Reopening goes through toggleVisibility, and the maximize toggle sets the flag through setMaximized, so the retained flag controls the reopened layout. The PR reports a new browser test, reopening the right panel keeps it maximized, which fails on the old code and passes with the change. Limits: rightPanelStore.ts was truncated at 16000 bytes, so I did not confirm that close() or toggleVisibility() leave maximized untouched. The browser test diff could not be read because its blob is missing from the checkout, so I did not re-run or inspect it. The verdict relies on the diff and the author's reported test result.

      Full details: Out of Scope Changes check

      Explanation

      The whole-PR diff against the merge base has two files according to the summary: a browser test in apps/web/src/components/ChatView.browser.test.tsx (+34 lines) and the one-line removal in apps/web/src/components/chat/useRightPanelActions.ts. The removed line is directly tied to #46884. The test covers the same reopen flow. No server, contracts, or native changes are reported. The changed blob for the test file was unavailable, so its contents were not inspected. Its described scope matches the issue.

      Finishing Touches

      Generate unit tests (beta)

      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
      Recent review info

      Run configuration

      Commits

      Reviewing files that changed from the base of the PR and between d5ebed78e9f0b4f8507b14a68562cf7a6bdf682a and 91b0858e32137f161e978771101937f5060059f8.

      Files selected for processing: 2

      • apps/web/src/components/ChatView.browser.test.tsx
      • apps/web/src/components/chat/useRightPanelActions.ts
      Files with no reviewable changes: 1

      • apps/web/src/components/chat/useRightPanelActions.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

    3. juliusmarminge added labelstakeover:in-progress

    4. Approvability

      Verdict: Approved at 91b0858

      Macroscope's review found this PR approvable — Closing and reopening the right panel now preserves its existing maximized state. This is a limited presentation-state change, and users can still toggle maximization explicitly.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. juliusmarminge added labelstakeover:blocked

    6. juliusmarminge removed labelstakeover:in-progress

Sign in to join this conversation.