refactor(web): all banners through the shared banner component — success variant, non-dismissible, extra classes #283
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/coding-lab#283
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Split out of umbrella #276 (frontend component reuse, follow-up to #275).
A shared
ErrorBannercomponent exists (dismissible;errorandnoticevariants), yet ~20 inline<div class="banner error" role="alert">copies survive across the app shell, most routes, and the settings sections — plus inline variants with extra classes (afk-strip-paused,clone-error) and an inlinebanner success(token reveal). The copies exist because the component's API doesn't cover their needs: non-dismissible usage, a success variant, extra-class passthrough.Extend the banner API to cover the real needs and migrate every inline copy. The agent brief follows in a comment.
Agent Brief
Category: enhancement
Summary: All banner markup renders through the shared banner component(s); migrate the ~20 inline copies.
Current behavior:
ErrorBannerrenders a dismissible banner witherrorandnoticevariants, correct roles (alertfor error,statusotherwise), and text-only message rendering. Alongside it, roughly 20 call sites hand-roll<div class="banner error" role="alert">— the app shell, most list/detail routes, and the settings sections. Some carry site-specific extra classes (the AFK strip's paused banner, Repos' clone-error banner) and the token-reveal flow hand-rolls abanner successwithrole="status". The inline copies exist because the component API lacks what those sites need: non-dismissible rendering, a success variant, extra-class passthrough.Desired behavior:
The shared banner API covers the real needs found in the codebase — non-dismissible usage (no dismiss button rendered when no dismiss handler is meaningful), a success variant, and passthrough of extra classes — and every inline banner copy migrates to it. Role semantics preserved per variant (
alertfor error,statusfor notice/success). Message content keeps rendering as text content, never HTML (the v0 sticky-banner property noted in the component). No visual change.Key interfaces:
ErrorBanner(or a generalizedBannerit delegates to) — extended, not forked; existing call sites keep working unmodified or are trivially migratedbannerCSS classes (error,notice,success, extra modifiers) remain the styling hooks, applied only by the component in production code after migrationSectionCardstyle covering variants, role mapping, dismissible vs notAcceptance criteria:
class="banner …"construction is migrated to the component (test fixtures excepted)Out of scope: