Files
yellowjacket/frontend/src/icons/names.txt
T
logan 89882b4863
CI / check (push) Skipped
CI / e2e (push) Skipped
CI / check (pull_request) Successful in 2m27s
CI / e2e (pull_request) Successful in 6m42s
refactor(ui): give the icons one vocabulary and sweep the call sites
`plus` meant "add to the queue", "add to a playlist", "make a new
playlist" and "you do not own this" -- the first two adjacent in the
same context menu, so two neighbouring items were the same glyph doing
different things. `list` meant the queue (the button that opens it), the
Playlists destination, and adding to the queue in `queue-panel` alone.
Two icons carrying seven meanings is not a vocabulary, and nothing
catches it: a wrong-but-real icon renders perfectly.

`utils/icon-language.ts` is the table, beside `library-status.ts` as the
issue suggested. The rule it is built on is that an icon names the
**noun** it acts on, not the verb: "add to queue" and "add to playlist"
are one verb on two nouns, so the noun is what differs -- which is why
adding to a playlist wears the Playlists destination's own icon, and why
the queue took `bars-staggered` and stopped wearing Playlists'. `plus`
keeps the one meaning it is unambiguous about, making something that is
not there yet, which covers New Playlist and the drop zones.

`bars-staggered` is the only new glyph, vendored through names.txt and
fetch-icons.mjs after confirming it is in Font Awesome **Free** 7.3.1.

Two things this found rather than changed:

- The request toggle's outline/solid pair was already in the app and
  already right -- `explore-album-details`'s "Request this" button has
  used `regular/bookmark` -> `solid/bookmark` since it was written --
  while the badge forty pixels away showed a **plus** for the same
  state. That is `utils/library-status.ts`'s fault one layer down: it
  made the two surfaces agree on what wanting *means* and left them
  disagreeing on what it looks like.
- `explore-artist-details`'s Follow button was `bookmark-check`, which
  is Font Awesome **Pro** and has never been bundled, so it has drawn
  the missing-icon fallback -- a circled question mark -- for every
  followed artist since it was written. `requested-badge.spec.ts` was
  written for exactly this bug on the album button and says so in its
  docstring; this is the same bug one component over, still live,
  because `offline-icons.spec.ts` sweeps `__yjIconMisses` and no spec
  had ever followed an artist.

So the test does what reaching the state cannot. `icon-language.test.ts`
reads every `src/**/*.ts` as raw text and fails on a governed name
written outside the table, and separately asserts every `ICON_*` is a
*bundled* name -- which is what makes a Pro name a failing test rather
than a runtime report from a state something has to reach first. Its
first assertion is that it read any source at all, because a sweep over
an empty glob passes.

`chrome.test.ts` asserted `['check', 'bookmark', 'plus']` and so pinned
the badge's glyphs against the vocabulary they were meant to follow; it
names them from the table now, and keeps the assertion that the three
differ, which is the property the states actually need.

Downloads keeps the solid bookmark on purpose. That is one word twice,
not two words: the badge says the entity is on your list and the nav
item is that list.

Closes #34
2026-08-18 21:18:36 -04:00

86 lines
1.9 KiB
Plaintext

# Every icon this app bundles, as <style>/<name>, one per line.
#
# It is a list rather than a glob because the alternative is shipping
# 2 001 SVGs to use 64 of them. It is *committed* rather than derived
# because twenty call sites compute their icon name from state
# (`jobIcon(job)`, `TONE_ICONS[tone]`, `this.favCtrl.iconName`), so no
# static analysis can produce this list and no build step can check it.
#
# What checks it is the runtime: `src/icons/index.ts` reports a name it
# cannot resolve to `window.__yjIconMisses` and renders a fallback, and
# `frontend/scripts/icon-sweep.mjs` drives the app to collect them. A
# missing icon is therefore a visible, findable bug rather than a
# silent request to a CDN.
#
# Names must exist in Font Awesome **Free** (CC BY 4.0); see
# fetch-icons.mjs for why that is not negotiable. Re-vendor with:
# node frontend/scripts/fetch-icons.mjs
regular/heart
regular/star
solid/arrow-down-wide-short
solid/arrow-left
solid/arrow-rotate-right
solid/arrows-rotate
solid/arrow-up-short-wide
solid/backward-step
solid/bars
solid/bars-staggered
regular/bookmark
solid/bookmark
solid/box-open
solid/check
solid/chevron-down
solid/chevron-right
solid/circle-check
solid/circle-exclamation
solid/circle-info
solid/circle-minus
solid/circle-question
solid/clock-rotate-left
solid/compact-disc
solid/copy
solid/database
solid/download
solid/file-import
solid/filter
solid/floppy-disk
solid/folder
solid/forward-step
solid/gear
solid/globe
solid/heart
solid/home
solid/hourglass-half
solid/house
solid/images
solid/info
solid/list
solid/list-check
solid/magnifying-glass
solid/masks-theater
solid/music
solid/pause
solid/pen
solid/pen-to-square
solid/play
solid/plus
solid/quote-left
solid/remove
solid/repeat
solid/rotate
solid/running
solid/shuffle
solid/star
solid/stop
solid/tag
solid/tags
solid/trash
solid/triangle-exclamation
solid/user
solid/user-group
solid/volume-high
solid/volume-low
solid/volume-off
solid/volume-xmark
solid/xmark