Widget Registry
Public Made by Adomby adom
The reviewed registry of widgets renderable from plain markdown on any wiki page
adom-table: allowlist the new `mark` attribute (cell emphasis) #2
Adds one attribute, mark, to the adom-table allowlist. No change to the script URL, the
element, or any other entry. attrs goes from 7 to 8, well under the cap of 12.
What mark does
mark="warn:rule:PR ONLY|ASK; accent:rule:^merge:"
style:key:regex, semicolon-separated. Cells in column key whose value matches regex
get a class — warn (red), accent (blue) or ok (green). The cell text is still
HTML-escaped exactly as before; mark only adds a class, so it cannot inject markup. A
malformed rule is dropped rather than thrown, so one bad pattern cannot blank a table.
Why
adom-table escapes every cell, which is correct, but it means a table cannot carry any
emphasis at all. Converting adom/repo-ownership's hand-built ownership frame to the widget
flattened PR ONLY · no direct merge and ASK before merging from red-and-bold into
ordinary grey — on a page whose entire job is to stop someone merging into a repo they do
not own, that is the one thing a reader must not miss.
It is deliberately general rather than an ownership-specific feature: any table with a
pass/fail, blocked/allowed or severity column wants the same thing. This is the same
"benefit the other table consumers too" reasoning that was raised for a bar/type column.
Already shipped
The implementation is live in adom/component-widgets
(widgets/adom-table.js, commit d730a8e4) and is being served right now by
/widget-script/adom-table.js. It is backward compatible: with no mark attribute the
widget renders exactly as before.
Without this registry entry the attribute is silently dropped from a ::adom-table{} tag,
so ::tag users cannot reach it — adom/repo-ownership currently uses the widget through
its own section frame and so is unaffected either way.
The same commit also taught heading= to interpolate {key} from the data envelope
(heading="Regenerated {generated}"). That needs no registry change, since heading is
already allowlisted.
Verification
Rendered in real Chrome against the live widget script and the live data file: 288 rows,
headings APPLICATION / OWNER / MERGE POLICY / WHERE / SHARE % / COMMITS / LAST ACTIVITY,
2 warn cells (git-wiki, hydrogen), 1 accent cell (adom-lbr), 4 dimmed dormant rows.
Related
adom/wiki#166— whyadom/repo-ownershiphas to host the widget in a section frame instead of a::adom-table{}tag: a registered tag's frame is opaque-origin, so itssrcfetch carries no session and a private page's data 404s.
Not merging this myself — adom/widgets is Colby's, and the review is the point of the
registry.
Diff Skip to comments (1)
@@ -1,23 +1,24 @@⋯ 18 unchanged lines ⋯ "element": "adom-footprint-variants", "attrs": ["src", "variant", "heading"] }, { "name": "adom-table", "mode": "frontend", "script": "https://wiki.adom.inc/adom/component-widgets/render/widgets/adom-table.js",- "element": "adom-table", "attrs": ["src", "columns", "heading", "filter", "facet", "sort", "dim"] }+ "element": "adom-table", "attrs": ["src", "columns", "heading", "filter", "facet", "sort", "dim", "mark"] } ]+@@ -1,58 +1,59 @@⋯ 54 unchanged lines ⋯ | `::adom-heatsink-via{src="..."}` | thermal via layout | | `::adom-symbol-variants{src="..."}` | alternate schematic-symbol layouts (2-column, square, grouped, chip outline), generated in the browser | | `::adom-footprint-variants{src="..."}` | footprint-variant family (baseline, heatsink vias, 300 µm solder balls, rounded pads), parsed live from the page's `.kicad_mod` files; takes an adom-footprint `variants.json` `src` — loads from john/footprint-widgets |-| `::adom-table{src="..."}` | any JSON array as a filterable, sortable table — generic, not component-specific; `columns` `heading` `filter` `facet` `sort` `dim` |+| `::adom-table{src="..."}` | any JSON array as a filterable, sortable table — generic, not component-specific; `columns` `heading` `filter` `facet` `sort` `dim` `mark` |+
Comments
Log in to comment.