Skip to content

fix(web): right panel opens at half the window on wide screens - #13734

Open
otavio wants to merge 1 commit into
pingdotgg:mainfrom
otavio:t3code/widen-right-widget-container
Open

otavio wants to merge 1 commit into
pingdotgg:mainfrom
otavio:t3code/widen-right-widget-container

Conversation

@otavio

@otavio otavio commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

The right panel (browser, diff, files, terminal, etc.) always opened at a fixed 540px in a thread that had not been resized yet. On large monitors that is a thin strip, and because widths are remembered per thread (#11310), you had to drag it wider again in every new thread.

The panel now opens at half the viewport width, never smaller than the previous 540px. The existing max-width clamp still reserves room for the chat column, and threads that already have a saved width keep it. The pull-requests page already opened its panel at half the window, so this lines up with that.

Before / after (1920×1080 viewport, this PR's diff open in the panel)

Before: the panel opens at 540px, so diff lines wrap

before

After: the panel opens at 960px (half the window), so the same diff fits

after

Verification

  • vp test run apps/web/src/components/preview/PreviewPanelShell.test.ts (adds cases for the half-viewport default and the 540px floor)
  • vp lint on the touched files, apps/web typecheck
  • Checked in a dev build: on a 1920px viewport the inline panel measured 540px before and 960px after

Surfaces: the width only applies to the inline desktop/web panel. The sheet mode on narrow windows and mobile are unchanged.

Made by Claude Opus 5.5 in Claude Code (via T3 Code).

@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 26, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The production preview panel now uses a viewport-dependent initial width instead of the fixed 540px default, changing the opening layout on wide screens. Existing saved widths and maximum-width constraints remain in place, and targeted tests cover the new calculation.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 7b06e314-3eee-4fa6-941e-5a2f61900cea

📥 Commits

Reviewing files that changed from the base of the PR and between 2a9832b and 1fd75eb.

📒 Files selected for processing (2)
  • apps/web/src/components/preview/PreviewPanelShell.test.ts
  • apps/web/src/components/preview/PreviewPanelShell.tsx

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


📝 Walkthrough

Walkthrough

The preview panel now uses half the viewport width as its default when that value exceeds 540px. The existing maximum-width clamp remains in place. Tests cover a 2,561px viewport and a 1,000px viewport.

Changes

Preview panel width

Layer / File(s) Summary
Derive and apply the default width
apps/web/src/components/preview/PreviewPanelShell.tsx, apps/web/src/components/preview/PreviewPanelShell.test.ts
The exported getPreviewPanelDefaultWidth returns the greater of 540px and half the supplied viewport width. The shell uses window.innerWidth when available, or 0 during server-side rendering, when no defaultWidth override is supplied. Tests expect 1,280px for a 2,561px viewport and 540px for a 1,000px viewport.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: bil0000

Merge Risk: ⚪ Minimal · up to 1fd75

The panel’s new default width is consistent with the stated behavior, and no actionable merge-blocking risk is established.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description check ✅ Passed The description clearly explains what changed and why. It includes before-and-after UI screenshots, verification steps, and scope details. It does not reproduce the checklist section, but the required…
Title check ✅ Passed The title is concise and accurately identifies the main change: the right panel now opens at half the window width on wide screens.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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

otavio added a commit to otavio/nix-config that referenced this pull request Sep 26, 2026
The right panel opened at a fixed 540px in every thread without a saved
width, a thin strip on large monitors that had to be dragged wider in each
new thread. Carry pingdotgg/t3code#13734, which defaults it to half the
viewport with 540px as the floor. The preview moved the panel sizing into
usePreviewPanelInlineSize, so the patch is rebased onto that hook.

This branch has not been deployed

No deployments
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