Skip to content

fix(desktop): preserve glyphs at transcript clip edges - #4906

Merged
Astro-Han merged 1 commit into
apache:mainfrom
liuxiaocs7:fix/chat-leading-glyph-clipping
Sep 6, 2026
Merged

fix(desktop): preserve glyphs at transcript clip edges#4906
Astro-Han merged 1 commit into
apache:mainfrom
liuxiaocs7:fix/chat-leading-glyph-clipping

Conversation

@liuxiaocs7

Copy link
Copy Markdown
Member

Summary

Fix assistant text whose leading glyph pixels are clipped by transcript paint containment. Keep content-visibility: auto, but add a 2px overflow-clip-margin so Chromium can paint glyph ink that extends fractionally past the flush-left boundary without changing the message box geometry.

Extend WideAssistantProse to assert that the assistant boundary keeps content visibility, receives the clip margin, and still reaches the existing full-width right edge.

This is an alternative implementation to #4904. It adjusts the paint clip rather than padding and margins, so transcript layout remains unchanged.

Fixes #4898

Verification

  • npm --workspace @maka/desktop run smoke:storybook — passed (310 stories, 337 theme renders), including product-shell-official-appshell--wide-assistant-prose
  • npm --workspace @maka/desktop run build-storybook — passed
  • npm --workspace @maka/desktop run typecheck — passed
  • npx biome check apps/desktop/src/renderer/styles/chat-message.css apps/desktop/stories/app-shell.stories.tsx — passed
  • git diff --check — passed
  • Chromium pixel comparison: the fixed render is pixel-identical to the uncontained reference (pixel_diff=0); zero-margin containment removed 13 pixels within the first 1–4px of the line
  • Oversized-turn check: all 96 transcript boundaries remain present and 14 offscreen boundaries remain skipped, preserving the rendering bound

AI use

Select exactly one:

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

Tool(s) and scope: OpenAI Codex diagnosed the paint-containment regression, implemented the CSS fix and Storybook contract, ran verification, and drafted this pull request. The commit includes the required Generated-by: Codex trailer.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

Keep content-visibility paint containment for transcript boundaries while giving glyph ink a 2px overflow clip margin. This prevents Chromium from shaving flush-left assistant glyphs without changing the message box geometry.

Extend the WideAssistantProse story contract to retain content visibility, the clip margin, and the existing full-width alignment.

Fixes apache#4898

Generated-by: Codex
@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. This is the one to take for #4898.

Head e03e5bc. overflow-clip-margin on the existing [data-maka-transcript-boundary] rule is the smallest fix that keeps content-visibility: auto and does not move the text. WideAssistantProse still asserts the flush right edge, and CI is green.

#4904 aims at the same bug with padding-inline plus a negative margin. That changes layout to dodge a paint clip. Storybook smoke already failed it: product-shell-official-appshell--wide-assistant-prose got expected 8 to be less than or equal to 1. Closing that PR as superseded.

One P3: the new play asserts overflowClipMargin >= 2, not pixels. Fine here; jsdom cannot see the compositor clip. The pixel_diff against the uncontained reference is what shows 2px is enough.

I am not approving yet. Someone still needs to look at product-shell-official-appshell--partial-history-notice on this head (CJK first glyphs on each line) before merge.

Reviewed with Grok.

@Astro-Han Astro-Han 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.

Looked at PartialHistoryNotice: CJK first glyphs on each line are intact. Merging this over #4904.

Head e03e5bc.

@Astro-Han
Astro-Han merged commit bd3646b into apache:main Sep 6, 2026
2 checks passed
Astro-Han added a commit that referenced this pull request Sep 6, 2026
…4923)

The assistant answer bubble is an Astryx ghost ChatMessageBubble: no fill,
no border, and the 28px --radius-chat it inherits paints nothing. #4259 made
that bubble a content-visibility boundary, and paint containment clips to
the rounded padding box, so the invisible corners became clip arcs. In the
app's Electron 43 (Chromium 150) the arc shaves the top-left of the first
glyph of the first line and the bottom-left of the last line.

#4906 added overflow-clip-margin: 2px against the same symptom. That only
pushes the arc out by 2px, and the pixel check that passed there ran in
Playwright's headless Chromium, where the rounded clip does not reproduce.
The margin makes no measurable difference once the radius is gone, so it
goes.

border-radius: 0 on the ghost bubble is legal under DESIGN.md's Full-Bleed
Rule (width 100%, flush both sides) and changes no pixel of its own.
DESIGN.md's chat rung row records the exception. The WideAssistantProse play
walks from the prose to the transcript scroller and requires every clipping
ancestor to be square or to pad its content past its corner radius; on
main's CSS it fails naming the bubble.

No migration or compatibility impact.

Fixes #4898

Generated-by: Claude Code
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