Skip to content

fix(desktop): stop the transcript boundary from clipping the first glyph - #4904

Closed
Adarsh-Me wants to merge 1 commit into
apache:mainfrom
Adarsh-Me:fix/transcript-boundary-glyph-clipping
Closed

fix(desktop): stop the transcript boundary from clipping the first glyph#4904
Adarsh-Me wants to merge 1 commit into
apache:mainfrom
Adarsh-Me:fix/transcript-boundary-glyph-clipping

Conversation

@Adarsh-Me

Copy link
Copy Markdown
Contributor

Summary

Fixes #4898. content-visibility: auto on [data-maka-transcript-boundary] (added by d2d9f90 for #4259) applies paint containment, which clips descendants at the marked element's own box. The ghost assistant bubble carries no horizontal padding (padding: var(--space-0-5) 0 0), so the containment clip edge sat on the line-box origin itself: glyph ink reaching a pixel or two past the origin — italic overhang, CJK ideographs — lost its leftmost column, and the first character of each assistant line rendered partially.

The fix keeps the containment (and with it the #4259 rendering bound) and moves the clip edge instead of the text: the assistant boundary gains padding-inline: var(--space-1) with a matching margin-inline: calc(-1 * var(--space-1)). The clip boundary now sits four pixels past the text on each side; the text keeps its exact position; the ghost bubble paints nothing of its own, so the wider box is invisible. Card-styled boundary sites (reasoning, tool activity) already pad their content, so they are untouched.

Verification

Measured live on the fixture the issue names (product-shell-official-appshell--partial-history-notice, served by Storybook from this branch):

  • Before (inline overriding the fix off): containment box left edge at x=316, first glyph origin at x=316 — zero clearance; ink at the boundary itself is clipped, which on the issue's macOS/zh-CN rasterization visibly cut the first stroke.
  • After (rule applied): containment box left edge at x=312, first glyph origin at x=316 — 4px of guaranteed clearance, text at the identical visual position.
  • Screenshots of the fixture before/after confirm the rendered output is otherwise unchanged.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope:

Checklist

  • Tests cover the change and fail without it — the failure mode is compositor-side (paint-containment clipping); jsdom cannot see it, so the differential was verified against the running Storybook fixture with before/after measurements instead of an automated test. Reproduction steps from the issue apply directly: without this rule the first glyph origin sits at the clip edge with zero clearance.
  • Lint, format, typecheck and the affected suites pass locally — biome check clean on the changed file; CSS-only change, no TS surface touched.

Does this PR entail a change in behavior?

  • No — clipping behavior only; layout position, containment perf bound, and scroll anchoring are unchanged.

content-visibility: auto on [data-maka-transcript-boundary] applies paint
containment, which clips descendants at the marked element's own box. The
ghost assistant bubble has no horizontal padding, so that clip edge sat on
the line-box origin itself: glyph ink reaching a pixel or two past the
origin — italic overhang, CJK ideographs — lost its leftmost column, and
the first character of each assistant line rendered partially (apache#4898).

Pad the assistant boundary by one space token and pull the wider box back
with a matching negative margin. The clip edge moves four pixels past the
text on each side, the text keeps its exact position, and the ghost
bubble paints nothing of its own, so the wider box is invisible.
Card-styled boundary sites (reasoning, tool activity) already pad their
content and are untouched. Measured on the partial-history Storybook
fixture: the first glyph's origin sat at the clip edge with zero
clearance before, 4px inside it after.
@github-actions github-actions Bot added the effort/S Under 100 readable lines label Sep 6, 2026
@Astro-Han

Copy link
Copy Markdown
Contributor

Thanks. Closing in favor of #4906.

Head b7c6c1e. The diagnosis matches #4898: content-visibility: auto from #4259 paint-clips at the boundary box. The padding-inline + negative-margin compensation is the wrong tool for that. It moves layout to dodge a paint clip.

CI already shows the cost. Storybook smoke failed on product-shell-official-appshell--wide-assistant-prose: expected 8 to be less than or equal to 1. That story is the reading-column flush contract. Negative margin does not buy width against the parent clip, so the 4px padding just insets the prose.

#4906 keeps containment and sets overflow-clip-margin on the existing boundary rule, which is the clip edge. CI is green there.

Reviewed with Grok.

@Astro-Han Astro-Han closed this Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/S Under 100 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(desktop): assistant response glyphs are clipped at the left edge

2 participants