Name every icon by the pixel grid it is drawn for

Groundwork for redrawing the icons on their pixel grids. A name is now
<icon><px> (server14, server16, server24) and must match the size token
where it renders: 14 at --icon-size-sm, 16 at -md, 24 at -xl.
tdesignLoading is the one exception, since it spins. Every name not yet
redrawn aliases its TDesign glyph, so nothing changes on screen except
the manager-open overlay icon, which moves from lg to xl ("a status
mark on a card").

- pixel-icons.ts holds the redrawn glyphs, so far add14 (the + from
  3f7145d, renamed from pixelAdd).
- TS code that picks icons takes Icon14 / Icon16 (menu items, file
  glyphs, the copy arrow, toasts, transfer states), so build:ui
  rejects a wrong name.
- icons.spec.ts checks every <ng-icon> in the skins: it has a size
  token, and each literal name, both sides of a [name] ternary
  included, is registered and drawn for that token's grid.
- TDesign's file1 is now fileText, since file1 plus a suffix would
  read file114.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-10-09 13:24:38 +02:00
co-authored by Claude
parent 3f7145d69a
commit 5d23809d48
21 changed files with 208 additions and 138 deletions
+9 -5
View File
@@ -372,11 +372,15 @@ component; tokens → `ui/src/styles.css`.
walker check the flag themselves.
- `file-icons.ts` — extension → category map driving glyphs, colors
(fixed `--icon-*` tokens from Oxide's hue scales) and the Kind column.
- `icons.ts` — the one icon registry (TDesign, `@ng-icons/tdesign-icons`, plus one
redrawn glyph: `pixelAdd`, TDesign's + on the 14px pixel grid so it stays sharp
on 1x screens), passed to `provideIcons` in `app.config.ts`. Icon names are plain strings in templates and
the build never checks them: an unregistered name renders nothing (console error
only), so every name used anywhere must be listed here.
- `icons.ts` — the one icon registry, passed to `provideIcons` in `app.config.ts`.
A name is `<icon><px>`: the pixel grid its glyph is drawn for, which must match
the size token where it renders (`server14` at `--icon-size-sm`, `server16` at
`-md`, `server24` at `-xl`). The one exception is `tdesignLoading`, which spins.
`pixel-icons.ts` holds the glyphs redrawn on their grids, and names not yet
redrawn alias TDesign's (`@ng-icons/tdesign-icons`). Templates can't type-check
icon names, and an unregistered one renders nothing (a console warning only), so
`icons.spec.ts` checks every `<ng-icon>` in the skins. TS code that picks an icon
takes the `Icon14` / `Icon16` types.
- `platform.ts` — preload-global readers (`PLATFORM`, `APP_MODE`,
`EDITOR_CONTEXT`, `IS_MAC`/`IS_MAC_CHROME`, `IS_WINDOWS`, `IS_LINUX`) +
`blockNativeContextMenu` (kills WebKit's Reload/Inspect menu outside text
+1 -1
View File
@@ -86,7 +86,7 @@ touching the adjacent code.
small size.** At 12 or 14px the centre is a pixel boundary, so a ~1px bar
covers two pixels at half ink. A 1px stroke alone doesn't help, because the
bar stays centred on the boundary. This is geometry, not Electrobun:
headless Chrome renders the same. So the + is `pixelAdd` (`icons.ts`),
headless Chrome renders the same. So the + is `add14` (`pixel-icons.ts`),
redrawn on the 14px grid with 1px bars at 7.5, which fill whole pixels at 1x
and at 2x. It's tuned for `--icon-size-sm` only. Arrow shafts (↑ →) have
the same issue if it ever shows.