Alerts are written by hand in about twenty variants, and the design system has no part for a notice #167

Closed
opened 2026-10-06 07:58:02 +00:00 by cgalo5758 · 2 comments
Owner

The question

The console writes every alert by hand: about twenty combinations of Bootstrap's alert classes appear across 45 templates and in Go strings, each with its own padding, size and margins. Dismissing one is built three ways: alert-dismissible on the organization types page, an htmx × on the operator setup banner, and the same × reused for the FedWiki sites list's notices. Two alerts in one card can differ in height. Forms have one library and a lint; alerts have neither. What is the notice part: which meanings it carries, which sizes, how it is dismissed, and what stops a hand-written alert from coming back?

What depends on the answer

Every page that tells a person something happened, went wrong or is about to happen. #22 asks the same question for previews. Notices that integrations declare, which the console will render, need the same part.

Options known so far

  • One part with tones named by meaning (problem, warning, done, information, preview), two sizes (page and inside a card), a dismissible variant that either posts the dismissal or only closes, and a lint that refuses alert markup outside it, as the anatomy lint does for badges.
  • Bootstrap's alerts as they are, with a written rule per meaning and size and no lint.

Decided when

The design system names the part, every alert renders through it, and the lint refuses one written by hand.

## The question The console writes every alert by hand: about twenty combinations of Bootstrap's `alert` classes appear across 45 templates and in Go strings, each with its own padding, size and margins. Dismissing one is built three ways: `alert-dismissible` on the organization types page, an htmx × on the operator setup banner, and the same × reused for the FedWiki sites list's notices. Two alerts in one card can differ in height. Forms have one library and a lint; alerts have neither. What is the notice part: which meanings it carries, which sizes, how it is dismissed, and what stops a hand-written alert from coming back? ## What depends on the answer Every page that tells a person something happened, went wrong or is about to happen. #22 asks the same question for previews. Notices that integrations declare, which the console will render, need the same part. ## Options known so far - One part with tones named by meaning (problem, warning, done, information, preview), two sizes (page and inside a card), a dismissible variant that either posts the dismissal or only closes, and a lint that refuses `alert` markup outside it, as the anatomy lint does for badges. - Bootstrap's alerts as they are, with a written rule per meaning and size and no lint. ## Decided when The design system names the part, every alert renders through it, and the lint refuses one written by hand.
cgalo5758 added the
kind
design
area/operator-uiarea/member-ui
labels 2026-10-06 07:58:02 +00:00
Author
Owner

Related: #168 (notifications) needs the same notice part, and #78 (one place showing what needs attention) renders its lines with it.

Related: #168 (notifications) needs the same notice part, and #78 (one place showing what needs attention) renders its lines with it.
cgalo5758 added this to the Public launch milestone 2026-10-20 23:14:03 +00:00
Author
Owner

Landed in c0e8150c. The notice part is a closed Go value, notice.Notice in internal/notice, rendered by one template part, ui_notice.html:

  • Five tones named by meaning: Problem, Warning, Done, Information and Preview. Each carries its glyph except Preview, whose dashed edge does that job. A screen reader hears "Error: " before a Problem and "Warning: " before a Warning. Only a Problem is announced at once (role="alert"); the others wait for a pause.
  • Two shapes: a box, whose size comes from where it sits (full on a page, compact inside a card, a modal or a form's box), and a line with no box, for a status among other content.
  • Contents: a notice carries its words, at most one link, at most one action, and a body that only the console's own templates fill. A connected application's notice carries words and a link (#173).
  • Closing: a notice is closable only when its owner records the closing on its own row; the part keeps no record of its own (#168, #78).
  • The lint: raw-notice refuses alert markup and alert roles written outside the part, in templates and in Go strings.

Every alert in the console renders through the part, and the 29 visible "Error:" labels are gone. The toasts are their own shared partial on every layout.

Landed in c0e8150c. The notice part is a closed Go value, `notice.Notice` in `internal/notice`, rendered by one template part, `ui_notice.html`: - **Five tones named by meaning:** Problem, Warning, Done, Information and Preview. Each carries its glyph except Preview, whose dashed edge does that job. A screen reader hears "Error: " before a Problem and "Warning: " before a Warning. Only a Problem is announced at once (`role="alert"`); the others wait for a pause. - **Two shapes:** a box, whose size comes from where it sits (full on a page, compact inside a card, a modal or a form's box), and a line with no box, for a status among other content. - **Contents:** a notice carries its words, at most one link, at most one action, and a body that only the console's own templates fill. A connected application's notice carries words and a link (#173). - **Closing:** a notice is closable only when its owner records the closing on its own row; the part keeps no record of its own (#168, #78). - **The lint:** `raw-notice` refuses alert markup and alert roles written outside the part, in templates and in Go strings. Every alert in the console renders through the part, and the 29 visible "Error:" labels are gone. The toasts are their own shared partial on every layout.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wiki-cafe/member-console#167