Skip to content

feat(web): reset right panel width on double click - #11219

Closed
cmaciasjimenez wants to merge 2 commits into
pingdotgg:mainfrom
cmaciasjimenez:feat/right-panel-width-reset
Closed

cmaciasjimenez wants to merge 2 commits into
pingdotgg:mainfrom
cmaciasjimenez:feat/right-panel-width-reset

Conversation

@cmaciasjimenez

@cmaciasjimenez cmaciasjimenez commented Sep 11, 2026 •

Copy link
Copy Markdown

What Changed

  • Double-clicking the right panel's resize handle restores its default width.
  • The persisted width is cleared, so the reset survives a reload.

Why

The right panel can be dragged to any width but had no way back to the default, so a mis-drag is a one-way door. The left sidebar's rail has had double-click-to-reset since #6320; this brings the right panel to parity and matches VS Code / Cursor.

The reset lives in useResizableWidth rather than in the handle, so every surface built on PreviewPanelShell picks it up — the thread right panel, the pull requests panel, and the preview/device panels — each restoring its own default and clearing its own storage key. It clears the stored width instead of overwriting it with defaultWidth, because the pull requests panel derives its default from the viewport; writing a value in would freeze a stale one.

A maximized panel renders no handle, so the gesture is unavailable there, as before.

One ordering detail: a double-click delivers two motionless drags before dblclick fires, and each of those persists the current width. The reset lands last and wins. The new test replays that exact sequence so a future refactor can't quietly break it.

UI Changes

doubleclick.mov

Before — dragged out to a custom width

still-before-dragged-wide

After — double-click on the handle restores the default

still-after-default-width

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Implemented with Claude Opus 5 using the Claude Code harness in T3 Code.

Summary by CodeRabbit

  • New Features

    • Double-clicking the resizable panel now restores its default width.
    • The saved custom width is cleared when the panel is reset.
  • Tests

    • Added coverage verifying panel reset behavior and removal of the saved width.

Double-clicking the right panel's resize handle restores its default
width and clears the persisted width, matching the app sidebar's rail.
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 11, 2026
Drop the sidebar cross-references and the notes that restate what the
code already says.
@cmaciasjimenez
cmaciasjimenez marked this pull request as ready for review September 11, 2026 10:00
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 739a5042-0a7a-4105-8b30-32b661702123

📥 Commits

Reviewing files that changed from the base of the PR and between 211618f and e7f5aa3.

📒 Files selected for processing (3)
  • apps/web/src/components/preview/RightPanelResizeHandle.tsx
  • apps/web/src/hooks/useResizableWidth.test.tsx
  • apps/web/src/hooks/useResizableWidth.ts

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


📝 Walkthrough

Walkthrough

The resizable width hook now supports double-click reset. The reset removes the persisted width, restores defaultWidth, exposes a new handler, and includes test coverage and documentation.

Changes

Panel width reset

Layer / File(s) Summary
Double-click reset handler
apps/web/src/hooks/useResizableWidth.ts, apps/web/src/components/preview/RightPanelResizeHandle.tsx
The hook adds onDoubleClick, removes the stored width, restores defaultWidth, and documents the handle behavior.
Reset behavior validation
apps/web/src/hooks/useResizableWidth.test.tsx
Tests mock localStorage.removeItem and verify that double-click restores the default width and removes the persisted value once.

Priority: ⬇️ Low

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

Change: Feature

Merge Risk: ⚪ Minimal · up to e7f5a

Double-click reset is reachable from the resize handle and clears the saved width as intended.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: resetting the right panel width with a double click.
Description check ✅ Passed The description includes complete What Changed and Why sections, documents affected surfaces and behavior, provides UI evidence for the interaction change, and completes the checklist.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@t3-code

t3-code Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

thanks for the contribution, @cmaciasjimenez! at @extoci’s request, this is superseded by #12395, which reimplements the double-click width reset on current main while preserving the newer per-thread width handling. you are credited as a co-author on the replacement commit and in the new pr description. closing this conflicting version in favor of that replacement.

@t3-code t3-code Bot closed this Sep 18, 2026
mikhail-filippov-azurgames pushed a commit to mikhail-filippov-azurgames/t3code that referenced this pull request Sep 21, 2026
Reimplement the behavior proposed in pingdotgg#11219 on the current per-thread resize hook.

Co-authored-by: cmacias <cmacias@teldat.com>
Co-authored-by: Exotic <118054752+extoci@users.noreply.github.com>
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:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant