refactor(ui,panel): move the section icon picker's emoji and colors into @repo/ui

Merged
CH
1h ago
+594-235

PR 2 of 9 in the Manager faces rollout. Stacked on feat/icon-picker-larger-cells (PR 1), to be retargeted to main once that merges. No visible change.

Carried onto current main, where #11068 floats a glyph's colors through IconPickerChoice's flyout. This PR builds on that flyout rather than bringing back the old colors popover.

What moves into @repo/ui

The parts of the sidebar section icon picker that the Manager face picker (PR 5) will share, so the app has one emoji picker and one set of color cells:

  • useEmojiGroups: the on-demand load of unicode-emoji-json/data-by-group.json through emojiGroups, under a query key @repo/ui owns. The unicode-emoji-json dependency moves to @repo/ui. The panel keeps it only as a dev dependency, because sidebar-sections.test.ts preloads the JSON.
  • IconPickerEmoji (and IconPickerEmojiChoice, one emoji's cell, which the section's Recent group also draws): every emoji by category with nothing searched, and what a search found. An emoji typed or pasted comes first (checked with @repo/features/emoji-wire's emojiSchema), then what the owner's own set found (beside, the section's glyphs), then the emoji whose name matches. It carries the loading, failed, and no-match notes. It takes its data as props (groups, failed), as @repo/ui components do, and the owner reads useEmojiGroups. So the emoji still load only when the Emoji tab shows or a search is typed.
  • IconPickerColors<Color>: a choice drawn in each color it is asked in, the starting one pressed, a press handing the color on. It's the content of an IconPickerChoice flyout, generic over what each color draws (face). The flyout keeps the frame: floating, roving keys, focus, and Escape.

The section picker composes them. Its Lucide, Suggested, and Recent data stay in the panel. The catalog's icon picker example now draws the new parts (Icons and Emoji tabs, a glyph's colors flyout, a recent emoji and glyph, a search over both), as the catalog-examples check requires.

Tests

  • packages/panel/src/desktop/sidebar-sections.test.ts is unchanged, and all 69 tests pass. I ran it with --testTimeout=30000 because this 4-core sandbox runs its first picker test past the 5 s default; the base branch does the same here.
  • apps/catalog and packages/ui/src/components/manager-face tests pass.
  • pnpm lint passes. In check:affected, the repository checks (catalog examples included), typecheck, and lint passed. My local run then timed out during its test stage, so I left the rest to CI.

šŸ¤– Generated with Claude Code