Repository navigation
[frontend] Reset BYO hint paragraph margins - #1657
lilyshen0722 merged 3 commits into
Conversation
lilyshen0722
left a comment
There was a problem hiding this comment.
UX-GATE: PASS @ a0f2cb7 — on /v2/agents/byo every hint paragraph sits on its parent's gap at 1200 and 390, with no collapsed-margin regression
Thank you for this, @thantiklermcirony, and sorry it sat so long without a reply.
What I rendered. /v2/agents/byo from two vite builds, main at the merge base e6ecfe08 and this head a0f2cb79, against the same sample-data fixture at DPR 2, at 1200×900 and 390×844, in all four states that show a hint: the form with the add-computer block, machine mode, the hosted result, and the BYO memory paste.
- The two bundles differ in one place only:
.v2-byo__hintgains;margin:0inindex.css(151 files per side; each side rebuilds byte-identically). - Every
<p class="v2-byo__hint">computesmargin: 0 0on both builds, and every gap equals its parent's: add-computer 10 / 10, hosted result 28 above and 36 below (the CTA row adds its own 8px top margin), memory paste 10 below. The<span>hints are 0 on both, as before. - Every visible element under
.v2-byo__layouthas the same box on both builds in all 8 state × width cells, and the 16 viewport screenshots are pixel-identical. (One pair first differed by 34 pixels at 1/255; main differed from its own first run by the same 34 pixels, and the re-run pair is byte-identical.)
Why your table doesn't reproduce on today's main. Your numbers are right for the tree you branched from, 10b1ffe8 (2026-09-11). There the result gap was 18, the add-computer gap 6 and the memory gap 10, and no parent reset paragraph margins, so each <p> picked up the browser's 12px (1em at 12px) on both sides: 18 + 12 = 30, 18 + 12 + 8 = 38, 10 + 12 = 22, 6 + 12 = 18. That is your before column exactly. On 2026-09-27, #1917 added > p { margin: 0 } to all three parents (and moved the result gap to 28 and the add-computer gap to 10), so on main the paragraphs already sit on their gaps and this PR changes no pixels today.
What it does buy. It puts the reset on the class instead of relying on every parent to remember one. To check that, I stripped the three parent resets from both builds' CSS. Main's paragraphs got their 12px back (gaps 22 / 22, 40 / 48, 22), while this head's stayed on their gaps (10 / 10, 28 / 36, 10) at both widths. So this is a real guard for the next parent that hosts a hint paragraph, and it is the class-level margin: 0 that #1413 proposed. #1413's question about the memory paste hint: it sits on the memory block's 10px gap on both builds, unchanged by this PR.
The presence test in v2-layout-invariants.test.ts is outside my gate.
For maintainers, not this PR: #1413's side note still holds on main. .v2-byo__listen-note has no rule in v2.css and is used 4 times in V2AgentBYO.tsx, so closing #1413 with this PR drops that note unless it moves to its own issue.
Written by UX Lead, a Commonly agent — pod thread
|
Thank you for this, and I'm sorry it sat four weeks without a reply from us. That is on me, not you, and it is the opposite of how we want to treat a contribution. What I did today, as a maintainer:
Your "full validation" box is what the draft was waiting on, and the gates above are that validation, so I'm marking the PR ready and pressing it. The squash will carry you as co-author. Issue #1413 closes with it. Written by Lily Shen (eng lead) with Claude Code. |
Summary
Reset
.v2-byo__hintmargins so paragraph hints in BYO flex layouts use the components' explicit gaps. Add the required layout-invariant guard. This implements the one-line fix proposed and measured in the issue by lilyshen0722.Type
Related Issues
Closes #1413
Test Plan
v2-layout-invariants.test.ts— 109/109 passed../dev.sh up(not run).Browser measurements, in pixels:
The memory and add-computer paragraphs consequently become tighter, matching their parents' declared gaps. The hosted CTA still has its existing additional 8px top margin.
Notes for Reviewer
Draft while full validation is unresolved. Full frontend lint reports 20 errors in existing files outside this diff. An isolated pnpm install with lifecycle scripts and lockfile writing disabled ran 60 passing suites / 531 passing tests, but other suites encountered DiceBear ESM transform and missing
prop-typesresolution problems under that installation topology. This is not a clean full-suite result; the repository's normal npm/CI run is still needed. No manifest or lockfile was changed.The public design README and surrounding CSS were checked. The referenced external
commonly-designskill is absent from the public archive. The change follows the existing sibling paragraph margin reset and the issue's proposed repair.Implemented by OpenAI Codex, directed by Daniel J. Murray.