NLDD icon buttons, and an icon per concept that exists and means it #245
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "style/nldd-icon-alignment"
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?
Supersedes #236, #239 and #242, and closes #171. Those three converted
hand-rolled controls to
nldd-icon-button; this branch adds the layer they donot touch - the glyph inside the button, and a test that notices when a glyph
name stops existing. They land together because #242 rewrites the exact lines
the icon work changes.
The buttons (commits 1-6, unchanged from #236/#239/#242)
<button>/<a>nldd-icon-button size="xs" variant="neutral-transparent"border-top-color+@keyframesnldd-activity-indicator size="16"nldd-icon-button, md like the close button beside itnldd-icon-button size="sm", 32x32 in bothThree regressions surfaced only in the running app and are fixed in place: the
hover plate (neutral-transparent hard-codes a transparent hover background, so
the plate has to come from the host),
display: flexon the host (:hostisinline-block and built a 27px line box around a 24px control, which leaked the
card's pointer cursor and misaligned it 1.5px), and a skipped tab stop
(
useCardKeyboardNav's selector only knew light-DOM elements, so "Open inMattermost" was unreachable by Tab).
The glyphs (commit 7)
<nldd-icon>resolves a name through the registry or the alias table andrenders nothing when it hits neither: no warning, no throw, an empty box. The
iconfield is typedstring, so typecheck cannot see it either, and NLDDretires and renames icons inside 0.8.x patch releases.
An audit of every icon name in
src/against the 311 registry names and thealias table found exactly one dead name - and it sat on the case #171 is about:
video: 'media'in AttachmentPreview. NLDD retired the bare name when themedia-transport set gained its
media-prefix, so every video attachmentcard has rendered an empty 40x40 box. Now
play, which is what the card'sown hint already says ("… afspelen"). The map moves to the plain
<script>block as
ATTACHMENT_ICONso the test can read it.Three more names carried a meaning NLDD has since assigned elsewhere:
clock-arrow-counter-clockwise, aliasedhistory. Theaction skips the wait →
media-forward-end, one of the icons #171 askedabout.
inbox, whichTRACK_ICON.inboxalready owns; the two sit inone card menu ("Naar backlog" above "Verplaats naar inbox"). Now
check-list,NLDD's own
backlogalias.rectangle-stacklooked better on paper (itcollides with nothing, while
check-listis also the composer's task-listbutton) but measured at 16px it is the same lidded box as
file-box, twosection headers below. A collision you can see beats one you cannot; the
composer button and the section headers never share a screen.
arrow-2-counter-clockwise, aliasedsync. Nowarrow-clockwise(refresh).imagebecomesphoto: unreachable in practice (images go to the thumbnailrow, never to the file-card grid), but a text-document glyph for an image is
wrong in the map.
No custom video controls. #171 suggested them; the modal keeps
<video controls>. Hand-built transport controls mean re-implementing thekeyboard, scrubbing and screen-reader behaviour the browser already gets right,
and NLDD's own guidance is to lean on native HTML.
The point of the change
iconNames.test.tsfails on a name that is in neither the registry nor thealias table. It covers the six icon maps and every literal name in a template,
and asserts the registry parse itself looks sane so a broken regex cannot make
the whole thing vacuous. Same reasoning as
nlddTokens.test.ts, for the othersilent failure mode: a dead
var()and a dead icon name both fail without aword anywhere.
Proven to fail, not just to pass: injecting
backlog: 'media'andname="chevron-left-teeny"makes it report both, with file names.Verification
vue-tsc, eslint (0 errors), vitest 700 in 96 files, vite build. No backend file
is in the diff. Looked at in the running app: the section headers, a video
attachment card, the outbox rows and the card quick actions.
<nldd-icon> resolves a name through the registry or the alias table and renders nothing when it hits neither - no warning, no throw, an empty box. The `icon` field is typed `string`, so typecheck cannot see it either. AttachmentPreview mapped video to `media`, which NLDD retired when the media-transport set gained its `media-` prefix. Every video attachment card has shown an empty 40x40 box since. It is `play` now, which is also what the card's own hint says ("... afspelen"), and the map moves to the plain <script> block as ATTACHMENT_ICON so a test can read it. Three more names carried a meaning NLDD has since assigned elsewhere: - "Verzend nu" drew clock-arrow-counter-clockwise, aliased `history`. The action skips the wait, so media-forward-end. - Backlog drew `inbox`, which TRACK_ICON.inbox already owns; the two sit in one card menu. Now check-list, NLDD's own `backlog` alias. rectangle-stack looked like the better pick on paper - it collides with nothing, while check-list is also the composer's task-list button - but measured at 16px it is the same lidded box as file-box, which sits two section headers below it. A collision you can see beats one you cannot. - Retry drew arrow-2-counter-clockwise, aliased `sync`. Now arrow-clockwise (`refresh`). `image` becomes `photo` - unreachable in practice, images never reach the file-card grid, but a text-document glyph for an image is wrong in the map. iconNames.test.ts is the point of the change: it fails on a name that is in neither the registry nor the alias table, covering the icon maps and every literal name in a template. Verified against injected bad names in both places. Same reasoning as nlddTokens.test.ts, for the other silent failure.