Repository navigation
fix(web): keep HTML prototype selection rings visible - #23745
stevan-borus wants to merge 3 commits into
Conversation
Generated HTML pages start flush against the iframe viewport, so selected cards can paint their rings outside the visible page. Reserve an overridable 8px gutter and include it in normal document sizing, with an iframe regression covering both edge cards.
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — The fix is narrowly scoped and includes an iframe regression test, but it changes the default CSS and layout guidance applied to newly generated HTML pages. That product-default behavior change warrants explicit review despite the small diff. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Root gutter contract and CSS packages/shared/src/htmlRender.ts |
The layout guide documents an overridable 8px HTML gutter. The base CSS applies border-box sizing and 8px padding to the root element. |
Fitted iframe bounds test apps/web/src/components/files/BrowserDocumentFrame.browser.test.tsx |
The browser test checks the first and last selected-card outlines against the fitted iframe viewport and verifies that the document has no horizontal overflow. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
pingdotgg/t3code#23864: The changes adjust generated page sizing and test page-to-viewport height and overflow. They do not implement the issue’s proposed scroll-suppression fix.
Suggested reviewers: t3dotgg, maria-rcks
Merge Risk: 
Minimal · up to 8a030
-
No actionable issue remains identified for the HTML selection-ring gutter; the change is mergeable after normal checks.
Pre-merge checks: 
4
-
Full details: Title check
-
Explanation
The title "fix(web): keep HTML prototype selection rings visible" follows conventional commit format and names the primary change: stopping selection rings on generated HTML prototypes from being clipped at the iframe edge. The diff adds an 8px html gutter in the shared renderer CSS, updates the layout guide, and adds a browser test for edge cards, so the title matches the changeset.
Full details: Description check
-
Explanation
The description follows the template's main sections. Problem gives the clipping cause and reproduction detail: a 3px outline with 2px offset paints 5px outside the fitted frame. Change explains the 8px overridable gutter, border-box sizing, the updated layout guidance, and the integration test. Scope and approval states this is a small, focused fix and that the regression test was requested. Verification lists the TDD failure, the focused test run, check results, and before/after screenshots. It also states what was not checked: native mobile clients and keyboard interaction. Minor gaps: the Scope section does not link a triaged issue or maintainer approval comment, and the template asks for an explicit approval reference for small fixes, which the author addresses only by explanation. The description also includes a model/harness attribution line, which the template requests.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- 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.
|
Note Written by thanks @stevan-borus. the overridable root gutter and border-box sizing fix the clipping without changing keyboard focus. i kept your commit and merged current main ( verification on
main before, desktop: updated branch, desktop: main before, phone width: updated branch, phone width: first/last selection and inset keyboard focus in the app: |
|
Note Written by merged current main ( blacksmith the old failed CI log contains two Word-preview timeouts, outside this diff. main's latest CI passed. fresh CI is pending on the merged head. native mobile, electron, and a provider-cli-generated turn were not exercised this pass. |




Problem
Selection rings on generated HTML prototypes are cut off when the first or last card touches the iframe edge. A card with a 3px outline and 2px outline offset paints 5px outside the page, while the fitted frame only includes the document's layout box.
Change
Give newly generated HTML pages an overridable 8px gutter, with border-box sizing so fluid content still fits the frame. Update the agent layout guidance to account for that gutter. The existing inset keyboard-focus rule stays unchanged.
Add an integration test using the real
HtmlRenderDocumentsandboxed iframe and injected bootstrap. It selects both edge cards and checks their ring bounds, fitted height, and horizontal overflow.Scope and approval
This is a small, focused fix for an obvious visual clipping bug in the existing HTML renderer. It adds no new workflow or setting. The regression test was explicitly requested by the developer.
Verification
expected -5 to be greater than or equal to 0, then passes with the gutter.vp test run apps/web/src/components/files/BrowserDocumentFrame.browser.test.tsx packages/shared/src/htmlRender.test.ts: 2 files, 12 tests passed.vp run check:changed upstream/main: formatting, lint, knip, typechecks for 28 affected packages, and both test files passed.dc667126e7: no findings.Fresh prototype rendered with the production headless screenshot helper, using the same source before and after. The original report image was not used. Integrated app screenshot capture timed out, so these captures show the rendered document itself.
Before, clipped at the left and bottom:
After, complete selection ring:
Notes
The default gutter applies when pages are generated. Previously stored HTML snapshots retain their embedded styles and need to be regenerated. Page-authored CSS can override the gutter.
Implementation: GPT-6.1-Sol via Codex in T3 Code; reviews by GPT-6.1-Sol and GPT-6-Astra via Codex.