Skip to content
quarry View Ticket
Login

View Ticket

Component catalogue and guard test: native elements first, one source of markup

Closedcffde42876bf0b89c2f999f1539cdb6627adeb01Created 101.2 days agoUpdated 13.7 days ago
Description2026-08-21 19:48:46
The fleet row menu was first built as a
disclosure while the account menu is a native popover — nothing names the sanctioned pattern, so the next author reaches for whatever works. Make native-first enforceable.

1. internal/web/components.go: Go helpers returning template.HTML for each sanctioned primitive, registered in the FuncMap like navlink/tipcol: menu (popover + anchor + .menu, the only dropdown), fold (

), badge (.tl-badge variants), confirm (acknowledgement form), toggle, pager, rows. Two-line doc each: when to use, which native element it wraps, what it deliberately does not do. 2. args helper (dict) so named templates take parameters instead of copying fragments. 3. TestNativeComponentsOnly: scan template sources and fail on reinvented patterns — .menu without popover,
without a catalogued class, role=menu/dialog on a div, onclick beyond the pinned allowlist, class=dropdown|modal|tooltip. Failure message names the component to use. 4. One-paragraph rule at the top of the template file; a pointer from the wiki page Audit after change. 5. Migrate the existing account menu, fleet kebab, folds, pager and toggle onto the catalogue as the proof.

Not: a templates directory or a component framework — one file, one script, html/template stays.

2026-11-17 06:50:09

Closing as a duplicate of #173, which asks for the same thing (one source of markup for each pattern, native elements first, a guard test that keeps pages on it) and carries the discussion. The catalogue and guard test described here are part of that ticket's scope.