Skip to content

[frontend] Reset BYO hint paragraph margins - #1657

Merged
lilyshen0722 merged 3 commits into
Team-Commonly:mainfrom
thantiklermcirony:fix/byo-hint-paragraph-margins
Oct 9, 2026
Merged

lilyshen0722 merged 3 commits into
Team-Commonly:mainfrom
thantiklermcirony:fix/byo-hint-paragraph-margins

Conversation

@thantiklermcirony

Copy link
Copy Markdown
Contributor

Summary

Reset .v2-byo__hint margins 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

  • Bug fix

Related Issues

Closes #1413

Test Plan

  • Focused repository Jest suite: v2-layout-invariants.test.ts — 109/109 passed.
  • ESLint on the changed test — zero errors; six warnings on existing lines.
  • Real Chromium layout check using the actual stylesheet and current markup patterns.
  • Presence-guard mutation check and clean patch-application check.
  • Published files match the tested local files byte-for-byte.
  • Full authoritative frontend test/lint run.
  • Full stack / backend checks and ./dev.sh up (not run).

Browser measurements, in pixels:

Layout Before After
Hosted stats → hint 30 18
Hosted hint → CTA 38 26
Memory hint → textarea 22 10
Add-computer adjacent gaps 18 6
Existing span top/bottom margins 0 / 0 0 / 0

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-types resolution 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-design skill 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.

@lilyshen0722 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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__hint gains ;margin:0 in index.css (151 files per side; each side rebuilds byte-identically).
  • Every <p class="v2-byo__hint"> computes margin: 0 0 on 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__layout has 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

@lilyshen0722

Copy link
Copy Markdown
Contributor

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:

  • Updated the branch from main (it was 422 commits behind); your two commits are untouched, with a merge commit on top.
  • Approved the CI runs: all green, including the one required check.
  • Asked our UX reviewer for a render pass at 1200 and 390: PASS at a0f2cb79, against your before/after pixel table.

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.

@lilyshen0722
lilyshen0722 marked this pull request as ready for review October 9, 2026 08:24
@lilyshen0722
lilyshen0722 added this pull request to the merge queue Oct 9, 2026
Merged via the queue into Team-Commonly:main with commit bd3abf8 Oct 9, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v2: .v2-byo__hint lacks margin:0, adding 24px to the hosted panel after #1412's span→p change

2 participants