fix(ui): extract shared ErrorBanner and migrate inline banners #481
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/MAPPS-418-error-banner"
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?
Implements MAPPS-418 (durable follow-up to MAPPS-412 F3): extracts a shared
ErrorBannercomponent and routes every inline error-message banner through it, so the red recipe lives in one place and cannot re-drift.Component
New
src/components/error_banner.rs: a compact, icon-less banner (distinct from the heavierAlert) rendering the MAPPS-412 recipe (bg-red-50 dark:bg-red-950/30+border-red-200 dark:border-red-900+text-red-700 dark:text-red-300,rounded-md px-3 py-2 text-sm). The message is passed aschildren; an optionalclassprop carries caller spacing (mb-3/mb-4). It always setsrole="alert"- a bonus a11y win, since none of the migrated bare divs announced.Migration
57 inline error banners across 16 files now use
ErrorBanner, collapsing both drifted recipes onto one: recipe A (the majority) and the divergentdark:bg-red-900/20 p-3tint in time/projects/assets/profile (which MAPPS-412 did not reach). Net -148 lines. Each banner's message expression and margin are preserved; the divergent tint's innerp.text-red-600wrapper is dropped in favor of the standardized styling.Three red divs were deliberately left (not compact error-message banners): the app-wide
server_status_banneroutage bar (role=status/aria-live,border-b, static copy + Link), the persistentsettingsdestructive-import warning (always rendered, not error-gated -role="alert"on it would be an a11y regression), and the existingAlertcomponent's Error color tuple.Verification
Diff-reviewed (no local cargo): the component renders the exact recipe, is re-exported via
components/mod.rs, every file that importsErrorBanneruses it (no orphaned imports), and no non-banner red usage (destructive buttons, required asterisks, inline label text) was touched. No em-dash. CI runs fmt/clippy(-D warnings)/wasm-build/tests; theuseblocks that gainedErrorBannermay need a rustfmt repack (rustfmt is not runnable on this box), which I will apply from CI if it flags them.#MAPPS-418