Skip to content

fix(ui): render failed-turn and retry notices as card banners - #6021

Merged
Astro-Han merged 1 commit into
apache:mainfrom
ggbdpq:fix/5799-card-banners
Oct 9, 2026
Merged

Astro-Han merged 1 commit into
apache:mainfrom
ggbdpq:fix/5799-card-banners

Conversation

@ggbdpq

@ggbdpq ggbdpq commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Summary

A failed turn's banner and the provider retry notice both passed container="section" to Astryx Banner — the page-level, full-bleed, square-cornered variant — so the 800px message column showed a hard-edged block of status color that read as a page-level alert instead of part of the turn. This drops the prop at both call sites so both fall back to the default card container (standalone, rounded), which is the variant for content inside a column.

  • packages/ui/src/chat-turn.tsx — failed-turn Banner
  • packages/ui/src/provider-retry-notice.tsx — provider retry notice (ProviderRetryNotice)

Nothing else changes. The retry notice keeps its role="status" live region with the ticking countdown aria-hidden, so its accessible name stays stable (ModelProviderRetryIndicator in chat-turn.tsx) — the constraint stated in the issue.

CSS rules removed

Per the acceptance criterion, every rule in the .maka-turn-failed-banner family in packages/ui/src/styles.css was audited against the section→card switch (which only swaps border-radius; Astryx applies identical margins for both containers):

Rule Verdict
.maka-turn-failed-banner { margin-block: … } kept — block rhythm between banner and timeline, unrelated to container shape
.maka-turn-failure-detail { … } (+ @keyframes maka-turn-failure-enter + reduced-motion opt-out) kept — styles the <pre> diagnostic inside the banner, still rendered
.maka-turn-failure-unavailable { display: block } kept — still rendered when no failure message exists

Rules removed: none. No product rule compensated the section shape (no width/negative-margin bleed anywhere), so nothing became dead. Verified with rg 'maka-turn-failed-banner|maka-turn-provider-retry|maka-turn-failure' across the repo plus the Astryx Banner source in node_modules.

Verification

Check Result
FailedTurnWithToolError / ProviderRetrying captures (light + dark, A0 loop: scripts/storybook-visual-diff.mjs, storybook rebuilt per tree) before/after in comment below; compare reports pixel changes confined to the banner box (800×84 @ (368,578) failed-turn, 800×64 @ (368,600) retry) — 0.015% of each frame, the rounded corners only
node --test on chat-turn-answer-identity, chat-turn-inline-references, chat-turn-steering-order, provider-retry-countdown, turn-running-spinner 61 pass before, 61 pass after
npx biome check on both changed files clean
npm run check:asf-headers pass (4311 covered files)
Not run full desktop suite, renderer typecheck — out of proportion for a two-prop style change; no test asserts the section container

Interim fix as scoped in the issue: two props, mergeable before C1. C1 must keep the retry notice announcing (stable accessible name, aria-hidden countdown).

AI use

Implemented and verified by GLM-5.3-Flash (ZCode) under the Apache Maka contribution workflow; author reviewed the diff, captures and test output.

Checklist

  • Both Banner calls use the default card container
  • .maka-turn-failed-banner rules audited; removals reported (none needed — see table above)
  • Before/after captures of FailedTurnWithToolError and ProviderRetrying in light and dark are attached (comment below)

A failed turn's banner and the provider retry notice both passed
`container="section"` to Astryx `Banner`. That variant is the page-level,
full-bleed, square-cornered surface, so the 800px message column showed a
hard-edged block of status color that read as a page alert instead of part
of the turn (apache#5799).

Drop the prop so both fall back to the default `card` container — the
standalone, rounded variant for content inside a column. Nothing else
changes: the retry notice keeps its `role="status"` live region with the
aria-hidden countdown (stable accessible name, see
`ModelProviderRetryIndicator`), and every `.maka-turn-failed-banner` rule
in styles.css was audited — all of them set block rhythm or style the
`<pre>` diagnostic, none compensate the section shape, so none is dead.

Fixes apache#5799

Generated-by: GLM-5.3-Flash (ZCode)
@ggbdpq

ggbdpq commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Before/after captures for the acceptance criteria (storybook-visual-diff.mjs — the A0/#5794 evidence loop; storybook rebuilt per tree, light and dark):

FailedTurnWithToolError

Before (section — square, full-bleed):

failed turn before, light
failed turn before, dark

After (card — rounded):

failed turn after, light
failed turn after, dark

ProviderRetrying

Before (section — square, full-bleed):

retry before, light
retry before, dark

After (card — rounded):

retry after, light
retry after, dark

Pixel diff (compare): changes confined to the banner box — failed-turn 800×84 at (368,578), retry 800×64 at (368,600), ~0.015% of each frame in all four pairs; nothing else on either surface moved.

@github-actions github-actions Bot added the effort/XS Under 10 readable lines label Oct 9, 2026

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

Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.

Review of fdcd031c (+0/-2, 2 files). The PR removes container="section" from the failed-turn Banner in packages/ui/src/chat-turn.tsx and from ProviderRetryNotice in packages/ui/src/provider-retry-notice.tsx, so both use the Banner's default container instead of the full-bleed page-level variant.

Findings: None at P0-P3.

  • The retry notice keeps role="status", aria-label and its class, so its live-region behavior and stable accessible name are unchanged. The failed-turn banner keeps its status, class, title and description.
  • No test asserts the section container. The .maka-turn-failed-banner / .maka-turn-provider-retry CSS does not depend on full-bleed width, which matches the PR's audit.
  • The only other container="section" use on main is the artifact preview (artifact-preview.tsx:251). That one is a page-level surface and is correctly out of scope.
  • I could not inspect the Astryx Banner source locally, so the claim that the default container is card rests on the PR's Storybook captures. The before/after diff confined to the banner corners is consistent with it.

Status: CI test passes on fdcd031c, and the PR is MERGEABLE. No protocol files, so there is no epoch impact.

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

Approved at @Astro-Han's explicit request: a small, focused change with no blocking findings in our automated review of this exact head, and CI is green.

@Astro-Han
Astro-Han merged commit 53f4c0b into apache:main Oct 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XS Under 10 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants