feat(ui): pick a Manager's face as a section's icon is picked

CH
1h ago
+1529-367

PR 5 of 9 in the Manager faces rollout. It stacks on #11069 (the shared icon picker parts).

What changes

ManagerFacePicker is rebuilt from the shared icon picker parts, in the section icon picker's shape:

  • Search: "Search characters and emoji" finds an emoji typed or pasted first, then the characters whose name holds every word, then emoji by name. Enter presses the first face found, which floats its colors, as the section picker's Enter does.
  • Tabs: Characters | Emoji. The Characters tab shows Recent first (the faces this window picked last, in the colors they were picked in), then the 6 characters. The Emoji tab shows every emoji by Unicode group, loaded the first time it's shown.
  • Drawing: a character not chosen is drawn gray and an emoji not chosen is drawn bare. The chosen face is drawn in its color.
  • Colors: pressing a character or an emoji floats its colors (IconPickerChoice's flyout): the face in gray, then each section color, 2 rows of 5. The current color is pressed and focused, and a color picks the face. There's no Remove.
  • ManagerFaceWell gains size (compact for an editor) and calls onOpenChange(open, away). ManagerFaceMenuPanel draws the same picker.
  • Recent is a recent: ManagerFaceRecent prop (read/write), since a @repo/ui component takes its data as props. The panel keeps it in the window's storage (@manager-face-recent.ts), as the section picker keeps its own Recent. Recent keeps one entry per character or emoji, whatever its color, at most 10.
  • IconPickerEmoji gains optional colors and opened. With them, an emoji press floats that emoji's colors instead of choosing it. The section picker passes neither, so it's unchanged. Cells are memoized, so opening one emoji's colors redraws only that cell.
  • sameManagerFace (character, color, and emoji) joins @repo/features/manager-face, word for word as #11070 adds it. The two web comparisons that dropped the emoji now use it: the Inbox holder's sameAgent and the fixture host's standsOn. The web pick path (changeFace → agents.onFace) compares no faces.
  • The catalog example is updated, with a new compact well. The catalog takes @tanstack/react-query to load the emoji.

Fix: the menu closed while a face's colors were open

A face's colors float in a portal on the body. The Manager's Change face › panel took the focus moving there, or a press on a color, as leaving the menu, and closed the whole menu. Now each flyout is counted as standing from the moment its row is drawn, before it takes the focus. The menu traces a press or the focus on one back to the cell it floats from (iconPickerChoiceOf), as it already traces a hint card back to its control. Escape now puts away the colors alone.

Tests

  • Rewrote manager-face-picker.test.ts:
    • A character's colors: gray first, then the section colors. A pick goes first in Recent.
    • Search order: a typed emoji, then characters, then emoji by name. Enter presses the first found.
    • An emoji pick keeps the standing character.
  • Extended the Change face test in sidebar-managers.test.ts: the menu stays up while the colors are open, Escape closes them alone with the focus back on the cell, and then a color picks. Without the menu fix it fails.
  • Ran: those two, packages/features/src/manager-face.test.ts, the menu and icon picker tests, and packages/host/src/act-port/agents-procedures.test.ts, all passing. Typecheck is clean (tsc -b over catalog, panel, and host), and so is lint.
  • packages/panel/src/desktop/sidebar-sections.test.ts fails in my sandbox the same way on this PR's base, #11069's tip (28 failures there, 27 here). It starts with the first test timing out while Lucide loads. I left it to CI.

Emoji faces draw as their character until #11065 (emoji drawing) is restacked in. Light and dark stills come after that.

🤖 Generated with Claude Code