Skip to content

fix(ui): prevent text shimmer overlap - #44036

Open
opencode-agent[bot] wants to merge 1 commit into
v2from
context-weight
Open

fix(ui): prevent text shimmer overlap#44036
opencode-agent[bot] wants to merge 1 commit into
v2from
context-weight

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • stop the base and shimmer text layers cross-fading over each other when shimmer activity finishes
  • keep the fade-in while active, but switch immediately to the single base layer on completion
  • force reduced-motion mode to render only the base layer instead of stacking both copies

Root cause

TextShimmer intentionally renders two copies of its text. Both opacity layers were visible during the active-to-inactive cross-fade, and reduced-motion mode made both copies fully opaque while active. This made shimmer-backed labels appear artificially bold even though their computed font weight was unchanged.

Checks

  • bun typecheck (packages/ui)
  • bun typecheck (packages/session-ui)
  • bun test src/timeline/projection.test.ts (packages/session-ui)
  • Playwright Storybook probe: completion resolves to base opacity 1, shimmer opacity 0
  • Playwright reduced-motion probe: one visible layer, zero transition, no animation

Requested by: @Hona (Hona via Slack)

@opencode-agent opencode-agent Bot changed the title fix(app): align context tool typography fix(ui): prevent text shimmer overlap Aug 22, 2026
@Enough1122

Copy link
Copy Markdown

AI code review — automated review for reference; please use your judgment.

  1. packages/ui/src/typography/text-shimmer/text-shimmer.css:39 — The transition now exists only under [data-active="true"], so the active→inactive flip loses its fade exactly when the opacity change happens — characters will snap instead of easing out. Why it matters: if the overlap fix requires an instant exit this is correct, but as written it reads accidental. Suggestion: either document the intentional asymmetry here, or declare a shorter reverse transition on the base rule so exits still animate without overlapping.

  2. packages/ui/src/typography/text-shimmer/text-shimmer.css:119 — opacity: 0 !important in the reduced-motion block is heavier than needed if source order/specificity already win, and it permanently blocks theme-level overrides of the shimmer layer's opacity. Suggestion: try the plain declaration first; reserve !important for a proven specificity conflict and note which rule it beats.

  3. packages/ui/src/typography/text-shimmer/text-shimmer.css:39 — A one-line comment explaining the mechanism being prevented (two stacked grid-area: 1/1 layers cross-fading during text swaps ⇒ double-exposure) would stop a future refactor from re-hoisting the transition to the unconditional rule.

  4. tests (coverage) — CSS-only change, but the component has observable computed styles: a Storybook/interaction check asserting (a) no running transition on inactive shimmer and (b) opacity: 0 on the shimmer layer under emulated prefers-reduced-motion would pin both fixes against regression.

— automated review (ox-alpha, round2)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants