GeezerVison is showing github.com — fix(web): HTML preview clears native window controls by juliusmarminge · Pull Request #24581 · pingdotgg/t3code
Conversation
Expanded HTML previews account for the desktop titlebar when sizing their content. This keeps the preview close button clear of native window controls while preserving browser geometry.
Original description by @Onik97
Problem
Expanded HTML previews size their content against the full window height, leaving too little clearance between the preview close button and native Windows/Linux window controls.
Change
Subtract the native titlebar height when sizing the preview, matching the image viewer’s existing calculation. Keep the media dialog’s titlebar padding and existing p-4. Regular web and macOS use the zero-height fallback, so their layout stays unchanged.
Scope and approval
This is the focused HTML preview control-spacing fix from Onik97 in #19909. Original contributor history is preserved, and reviewed main fb990765a4 is integrated by merge. No provider, contract or native-mobile behavior changes.
Verification
- One new Chromium geometry regression fails on main and passes with the fix; all seven existing cases remain, for eight passing tests. Scoped web typecheck, lint and formatting pass.
- Fresh complete Claude Opus 5.5 and GPT 6.1 Sol reviews approve d0c7c3a8d5.
- Actual Linux Electron 44.4.5 with native window-controls overlay reports 40px. At both 1280×800 and 1280×620, baseline close-button clearance is 2px and the fixed head gives 22px. This is improved clearance; the native 40px baseline did not reproduce a collision. No simulated 52px titlebar is presented as native proof.
- The native pass covered readable HTML, Close/Escape/reopen, zoom/reset and retained iframe identity, plus real minimize/maximize/fullscreen transitions. Ordinary web baseline/head geometry matched at both heights. Native Windows/macOS were not run.
- Verification used owned isolated app/profile/state and neutral synthetic attachment content. No live user data or provider execution. The earlier white-renderer attempt remains recorded as blocked; only the fresh native run is counted as proof.
| Before: actual Linux Electron, 2px clearance |
After: actual Linux Electron, 22px clearance |
 |
 |
Native interaction recording.
Implementation integration: Claude Fable 5.1. Test stage and independent review: Claude Opus 5.5. Coordination, independent review and delegated native verification: GPT 6.1 Sol through T3 Code.
Takeover
Replaces #19909, with credit to @Onik97 for the titlebar sizing fix. The author's one-line implementation matches the existing image viewer pattern and is retained. Current main had removed the former test file; this replacement keeps only a real geometry regression, plus an accurate nearby comment.
Evidence
Fixture matrix · Full capture report · Public seed and drivers
| Fixture |
Viewport / themes |
Proof |
| Linux Electron, native controls |
1440×800 and 1440×1200, light/dark |
8 before/after stills + 8 diffs |
| Browser, zero titlebar |
1440×800 and 390×800, light/dark |
8 before/after stills + 8 diffs; zero changed pixels |
| Native controls interaction |
1440×800, dark |
Before/after recordings |
| Narrow browser interaction |
390×800, light |
Before/after recordings |
| Native Windows; 390px native |
Unverified: Linux host; unsupported below minWidth 840 |
Explicit limitations |
Environment: Linux X11 under headless-desktop, Electron 44.9.3 / Chromium 152; native titlebar 40px. Browser Chrome 148. CSS viewports as above, DPR/font scale/zoom 1, fixed clock, reduced motion, identical fixture. Each still has an identical 500ms stability companion in the full report. Fresh isolated state only; fixture uses a published HTML attachment and a seeded completed tool row in the real timeline.
Observed: native baseline clears the 40px titlebar by 2px at 800px height; head clears it by 22px. At 1200px, clearance improves from 6px to 23.2px. This demonstrates improved native clearance; the synthetic 52px regression test reproduces overlap. Wide/narrow browser pairs are pixel-identical at zero threshold.
What else changed: native preview pane becomes shorter, Close moves down and the footer moves up; associated shadow, ring, gradient boundary and exposed backdrop follow. Native buttons and horizontal geometry stay fixed. Browser images have zero changed pixels. Diff0 is absolute RGB delta ×8; DiffT highlights channel deltas >16/255.
| Row — Close.top; Zoom.bottom (base→head px) |
Before 3cc31ed27c |
After 9a5d15e3c6 |
Diff0 |
DiffT (>16) |
| L800 light — 42→62; 758→738 |
 |
 |
 |
 |
| L800 dark — 42→62; 758→738 |
 |
 |
 |
 |
| L1200 light — 46→63.2031; 1154→1136.8 |
 |
 |
 |
 |
| L1200 dark — 46→63.2031; 1154→1136.8 |
 |
 |
 |
 |
| W800 light — 22→22; 738→738 |
 |
 |
 |
 |
| W800 dark — 22→22; 738→738 |
 |
 |
 |
 |
| N800 light — 20→20; 740→740 |
 |
 |
 |
 |
| N800 dark — 20→20; 740→740 |
 |
 |
 |
 |
Interactions, both revisions: open → zoom 125% → reset 100% → scroll → Close → reopen → Escape. Timestamped captions appear below the app pixels; native activation uses X11 clicks. Narrow browser recording uses a 500×900 outer window with a 390×800 CSS viewport, without scaling.
Verification log
- Geometry regression: main fails with Close.top=48px against a synthetic 52px titlebar; fixed head passes. Synthetic geometry is automated regression coverage, not native Windows proof.
- Scoped lint and formatting, one Chromium test, and full web typecheck pass after merging main.
- Independent review: round 1 flagged missing proof; rounds 2 and 3 both return MERGE. Corrected proof audit is SUFFICIENT: every still/diff/recording inspected; fresh native rebuild has zero pixel delta. Prior native evidence was recaptured with the details panel closed.
- Main integrated by merge commits; final feature diff remains three files. All eight required checks passed on the published replacement head; 27 checks pass with no failures. CodeRabbit remains pending with no findings posted; Macroscope approved this head. No auth, provider, contracts, permissions, modes, trust, sandboxing or MCP changes in the feature diff.
- Unverified: native Windows and macOS, unavailable on this Linux host. Native mobile is outside the changed web path.
- Models/harness: Claude Opus 5.5 for tests and implementation; GPT 6.1 Sol and Claude Opus 5.5 for independent review; GPT 6.1 Sol for evidence/proof audit and coordination, through T3 Code.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Approved at 9a5d15e
Macroscope's review found this PR approvable — The change is a focused HTML preview layout fix that accounts for native titlebar space while preserving existing browser geometry, with a targeted regression test. No schema, security-sensitive, deployment, product-default, or static-analysis behavior is changed.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Oct 24, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 3cc31ed and 9a5d15e.
Files selected for processing: 3
-
apps/web/src/components/chat/HtmlRenderDialog.browser.test.tsx
apps/web/src/components/chat/HtmlRenderDialog.tsx
apps/web/src/components/chat/ZoomableImage.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Walkthrough
-
The HTML preview dialog now subtracts the native titlebar height from its content height limits. A browser test checks the close and zoom-in button positions with a titlebar present.
Changes: HTML preview layout
| Layer / File(s) |
Summary |
Titlebar-aware preview sizing apps/web/src/components/chat/HtmlRenderDialog.tsx, apps/web/src/components/chat/HtmlRenderDialog.browser.test.tsx, apps/web/src/components/chat/ZoomableImage.tsx |
The dialog height limits now use the viewport height minus the native titlebar height, defaulting to zero when unset. The browser test checks control positions with a 52px titlebar in an 800px viewport. A comment names HtmlRenderDialog as matching the titlebar-height behavior. |
Priority: Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: cravenceiling, otavio
Merge Risk: Minimal · up to 9a5d1
-
The preview sizing change is mergeable with no established user-facing or operational risk.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title clearly and concisely describes the main change: adjusting the HTML preview so native window controls no longer overlap it. |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
| Description check |
 |
The pull request description includes the required Problem, Change, Scope and approval, and Verification sections. It provides reproduction context, implementation details, linked approval, focused te… |
Full details: Description check
-
Explanation
The pull request description includes the required Problem, Change, Scope and approval, and Verification sections. It provides reproduction context, implementation details, linked approval, focused test results, limitations, screenshots, recordings, and agent attribution. The description is complete and relevant.
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Ran the native Windows row on a real Windows 11 25H2 PC (build 26200.9711, x64, display scale 100%) with Electron 44.9.3 / Chromium 152, at base 3cc31ed and head 9a5d15e. That is the PR head as-is, without the main merge. The expanded preview used the same seeded fixture as the PR: one project, a stopped thread, a completed html_render row, and the published attachment.
Windows reports a 40px native overlay: getTitlebarAreaRect() height 40, --native-titlebar-height 40px, caption buttons 137px wide. The preview's Close button sits horizontally under the caption buttons, so vertical clearance is the measure.
| Row — Close.top; Zoom.bottom (base→head px) |
Clearance below caption buttons |
Result |
Evidence |
| Windows 1280×800, 100% — 42→62; 758→738 |
2px → 22px |
Verified |
base, head |
| Windows 1280×620, 100% — 42→62; 578→558 |
2px → 22px |
Verified |
base, head, crop |
1280×800 and 1280×620, forced DSF 1.5 (--force-device-scale-factor, not the OS setting) |
2px → 22px (3 → 33 physical px) |
Verified at an app-level scale |
800 crop, 620 crop |
| Maximize, restore, fullscreen, exit fullscreen, minimize/restore with the preview open |
Maximized 19.4 → 36.6; every restored state 2 → 22 |
Verified; the iframe is kept in every state |
Table in the log below |


In the 1280×800 crop the cursor rests on the native close caption button, so Windows paints its red hover fill over the full 40px band. The maximized crop is without hover. The screen pixels agree with the DOM (pixel measurements). As on Linux, the 40px baseline does not overlap; the change adds clearance.
On head at 1280×800, Close, Escape and reopen behave correctly: open → zoom 125% → reset → Close → reopen → Escape (focus returns to "Open full screen") → reopen, with Close.top back at 62 (steps).
Not checked:
- OS display scaling at 150%. The 1.5 rows use Chromium's forced device scale factor.
- Window states triggered by caption-button clicks, F11, Win+arrow snapping or the taskbar. The transitions used the BrowserWindow API.
- macOS, the PR rebased onto current main, Windows dark theme and high-contrast caption buttons.
- Recordings. Stills only.
Verification log
Window states, starting at 1280×800 (100%), changed through BrowserWindow.maximize/unmaximize/setFullScreen/minimize/restore. Overlay height comes from getTitlebarAreaRect(); clearance is Close.top minus that height.
| State |
Overlay (base / head) |
Close.top base → head |
Clearance base → head |
iframe kept |
Captures |
| Normal |
40 / 40 |
42 → 62 |
2 → 22 |
yes / yes |
the 1280×800 crops above |
| Maximized (3440×1392) |
40 / 40 |
59.4 → 76.6 |
19.4 → 36.6 |
yes / yes |
base, head |
| Restored |
40 / 40 |
42 → 62 |
2 → 22 |
yes / yes |
same as Normal; see the JSON data below |
| Fullscreen (3440×1440) |
40 / 40 reported; no caption buttons drawn |
62.8 → 80 |
22.8 → 40 (against the reported overlay) |
yes / yes |
base, head |
| Exit fullscreen |
40 / 40 |
42 → 62 |
2 → 22 |
yes / yes |
same as Normal; see the JSON data below |
| Minimized |
visible: false, 0 / 0 |
22 → 22 |
n/a |
yes / yes |
no capture (window not on screen) |
| Restored from minimize |
40 / 40 |
42 → 62 |
2 → 22 |
yes / yes |
same as Normal; see the JSON data below |
- "Kept" means four things held: the same
<iframe> element (by reference and by a data attribute set at open), the same contentWindow, zero load events after opening, and the dialog still open. The scroll position inside the iframe never reset to 0. Data: base, head.
- In fullscreen, Windows draws no caption buttons, but
windowControlsOverlay still reports visible: true with a 40px band, so both revisions keep reserving that space. While minimized, the overlay reports not visible.
- Build:
vp run build at head. For base, HtmlRenderDialog.tsx and ZoomableImage.tsx were checked out from 3cc31ed and the build was rerun. The built CSS rule was h-[min(86vh,calc(100vh-160px))] at base and h-[min(calc((100vh-var(--native-titlebar-height,0px))*0.86),…)] at head.
- Launch: the unpackaged desktop through Playwright
_electron, in the logged-in interactive session, with isolated T3CODE_HOME/APPDATA/USERPROFILE. The fixture rows were inserted into the stopped, migrated statev2.sqlite, following the PR's rebuild-seed.py.
- Per size:
setContentBounds(1280×h), reload, click "Open full screen", read DOM rects and getTitlebarAreaRect(), capture the window, and capture again with the cursor on the native close caption button (base hover, head hover).
- Geometry data: base, head, base 1.5, head 1.5.
- Interaction stills: opened, zoom 125%, closed by button, reopened, closed by Escape, reopened again.
- Attempts: base at 100% measured once. Head at 100% measured twice (once before closing the thread details panel, once after; same numbers). Base and head each measured once at forced 1.5. The window-state sequence ran once per revision, and its normal/restored readings repeat 2 → 22 every time.
Model: Claude Opus 5.5 via Claude Code, in T3 Code; reviewed by GPT-6.1-Sol (Codex).
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
bugfix
Fix PR opened by an issue lead; enters the PR loop
pr:needs-verification
Reviewed and green; needs a run on a desktop, Android or iOS device and captures posted
size:XS
0-9 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|