Overview
| Artifact ID: | c64331a7a2b0e9db097c9b6cef1dcd93a3377ba7072274676350fc64c031d372 |
|---|---|
| Ticket: | cffde42876bf0b89c2f999f1539cdb6627adeb01
Component catalogue and guard test: native elements first, one source of markup |
| User & Date: | ai-local on 2026-08-21 19:48:46 |
Changes
- Untracked field cmimetype: "text/x-markdown"
- comment changed to:
The fleet row menu was first built as a <details> 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 (<details>), 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, <details> 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.
- priority changed to: "Medium"
- severity changed to: "Important"
- status changed to: "Open"
- subsystem changed to: "web"
- title changed to:
Component catalogue and guard test: native elements first, one source of markup
- type changed to: "Feature_Request"