feat(mobile,ui-native,brand): draw any Lucide glyph a section wears on iOS

Merged
DA
7d ago
+2097-15

What

The developer reported on TestFlight 65 that their "Users" section draws a folder instead of the icon they chose.

Cause. The panel's section icon picker offers every Lucide glyph (1,869, stored by kebab-case name), but the app's asset catalog held only the 141 that @repo/ui-native names. sectionGlyph mapped just the picker's 12 suggestions and fell back to the folder for every other name, users among them.

Fix.

  • @repo/brand, scripts/every-lucide-symbol.mjs: outlines every Lucide glyph into an SF Symbols template with the existing symbolTemplate, from the same lucide-react @repo/ui resolves. It runs only when a prebuild writes the catalog (about 0.6 s), so the templates (about 15 MB of SVG) are never committed. A .d.mts types it for the app's config.
  • apps/mobile/app.config.ts: withImageSets writes every glyph as a symbol set, a superset of the 141 it wrote before. The extensions still carry only the symbols they name.
  • @repo/ui-native:
    • The surface generator emits only the names: tokens/every-lucide-symbol.ts, 31 KB, kept in step by the generator's drift check.
    • sectionGlyph maps a wire name to Lucide's asset name, arrow-down01 as ArrowDown01, as the panel's glyphKey spells it back. The folder stays for a name the catalog holds no glyph of, or an emoji.
    • glyphImage reads the full name set, so any of these draws from the catalog.

A prebuild on Linux wrote 1,881 symbol sets (1,869 Lucide plus the status, priority and Keel marks), about 26 MB of source in Images.xcassets. The compiled Assets.car and .ipa size change is measured on the Mac. It stays unarmed until that build: 27.2, the 26.5 symbol audit, and a size report. Over about 5 MB goes back to the orchestrator before arming.

Tests

  • packages/ui-native/src/glyph.test.ts: one table for sectionGlyph: a suggested glyph, flask's old name, users, a digits name, an unknown name, and an emoji. The users and digits rows fail on main and pass here.
  • Ran locally:
    • that test;
    • @repo/brand's check (no drift);
    • Biome on the changed files;
    • expo config, which loads the new import;
    • a Linux expo prebuild --platform ios --no-install, which counted the symbol sets above.
  • Left to CI: the rest. @repo/ui-native's local tsc shows only errors from a stale checkout's other files, none in glyph.ts.

šŸ¤– Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • The iOS app now includes the full Lucide symbol collection in its available icon catalog. Section icons can use additional Lucide symbols beyond the suggested choices, including symbols with digits in their names. Recognized Lucide names display their matching icons; names without a matching icon continue to display the folder icon.