Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Description

@lilyshen0722

Found while gating #1412; it merged at 31f7c1c4 mid-review, so filing here rather than as a post-hoc PR comment. The head I reviewed and the merged head are the same sha, and I re-confirmed all three facts below against origin/main.

#1412 is a good change — the missing-comma fix is real and I verified it repairs exactly what it should (details at the bottom). This is the one thing it introduces.

The defect

V2AgentBYO.tsx:562 promotes .v2-byo__hint from <span> to <p>:

<p className="v2-byo__hint">{t('agentByo.hosted.latencyHint')}</p>

.v2-byo__hint (v2.css:6155) sets only font-size and colorno margin: 0. It never needed one, because every prior use in this panel was a <span>: inline, so the UA default margin: 1em 0 had no vertical effect. As a <p> it now does.

The parent is .v2-byo__result (v2.css:6120) — display: flex; flex-direction: column; gap: 18px. Flex items do not margin-collapse, so the UA margins add to the gap on both sides rather than merging into it.

Measured, in a real browser

jsdom has no layout engine, so I served the real v2.css over http and measured computed geometry. Both variants in one page, identical markup, the only difference being margin: 0:

as shipped with margin: 0
parent flex / gap 18px flex / gap 18px
.v2-byo__hint margin 12px / 12px 0 / 0
stats → hint 30px 18px
hint → cta-row 38px 26px
stats → cta-row total 85px 61px

+24px of unintended vertical space. Sheet integrity confirmed alongside it (cssRules.length = 1121), so this isn't a parse artifact.

I first measured this at +13px with a plain-div parent and it was wrong — block-flow margin collapsing absorbed about half. The flex parent is what makes it 24px. Worth stating because the smaller number is what you get if you reason about it without running it.

Fix

One line, matching the convention already in the file — the sibling <p> class .v2-byo__memory-done (v2.css:6191) sets margin: 0 for exactly this reason:

.v2-byo__hint {
  font-size: 12px;
  color: var(--v2-text-tertiary);
  margin: 0;
}

Check the pre-existing <p class="v2-byo__hint"> at V2AgentBYO.tsx:666 when applying — different parent (.v2-byo__memory), so it may be relying on the current spacing.

Two unrelated things noticed nearby

What I verified about the comma fix (all clean)

  • Parsed v2.css with postcss at both base and head: rules 1177 → 1177, selectors 1401 → 1402, same last selector. +1 selector, nothing lost — the swallowed descendant selector correctly splits into the two intended ones.
  • Swept the whole stylesheet for the same defect class (a root-ish class appearing mid-selector, or two :lang( in one selector): 0 remaining instances.
  • i18n: only two locales exist, both updated. statLatency / statLatencyValue have 0 remaining references anywhere in frontend/ — no orphans. latencyHint defined in both.
  • CI at 31f7c1c4: 11/11 pass including Test & Coverage, E2E and Playwright; swept gh run list --branch for startup_failure runs invisible to gh pr checks — none.

cc @ux-lead — spacing call is yours; I'm reporting the number, not prescribing the design.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions