feat(panel,ui): open a Manager page's title on its face from Change face
What changes
On a Manager's page, Change face in the ⋯ menu and in the title's right-click menu is now a plain action, no longer a submenu panel. It opens the title's in-place rename, and the face in the toolbar's lead becomes a compact ManagerFaceWell with its picker already open. A pick saves the face right away (the toolbar, sidebar and chat all read it) and puts the focus back in the name field. Escape or Return ends the rename as before.
On the phone layout (PhoneHead), there is no face beside the name, so Change face keeps the panel beside the menu item, which now shows PR 5's picker.
How
-
useAgentActions(agent-actions.tsx): a new option,faceIn: FACE_IN.EDITOR | FACE_IN.PANEL, defaulting to PANEL, because other Manager surfaces (the pinned tab, crumb menus, history) draw no face well. Under EDITOR it returnsface: AgentFaceEdit(picking,onPicking,onPick), and Change face starts the rename with the picker open. The rename it returns resetspickingon both begin and end, so a plain Rename never opens the picker. The row in PR 6 builds on the same door. -
Toolbar:ToolbarTitleEditgainsholdingandref(anInlineEditHandle). Whenholdingis set, the lead box counts as part of the edit (InlineEdit'swithin), so moving the focus to the face well, into its picker, or into the colors that float from it doesn't end the edit. A press away from the picker ends it throughleave(), as a section head's editor does. -
Page (
desktop-agent-page.tsx): while the name is being edited, the lead shows the well instead ofManagerGlyph.finalFocusreturns the focus to the title field after a pick. -
Phone fix (
icon-picker.tsx): a phone's menu is a modal sheet that names no layer, so the colors floating from a face in the Change face panel stood on the window's layer, under the sheet, where nothing could press them. A flyout from a picker inside a modal card with no named layer now stands over the dialog, the same wayPopoverIconButtonpicks its layer. I checked it in a browser on the phone layout. There's no jsdom test: the only thing jsdom can show is the flyout'sdata-layer, which is markup, and stacking isn't something it can see.
Stack
Base: PR 5, agent/manager-face-picker (#11072). This branch also carries PR 6's two ui commits (InlineEdit's holding/within/ref and its focusout on each within box, and PopoverIconButton/ManagerFaceWell finalFocus) and the shared agent-actions commit, both cherry-picked so the two siblings build on the same pieces.
Tests
- Added one case to
desktop-agent-page.test.ts: ⋯ → Change face opens the title field with the picker in the lead; a face's colors opening leaves the field standing; a pick callsonFaceand the focus goes back to the name. I checked that it fails when the page doesn't passholding. - In a production-like web build on
?fixture=inbox, Change face opens the title field with the picker in the lead, the field stays open while a face's colors are up, and a pick puts the focus back in the name. On the phone layout, a pick from the panel's colors closes the sheet. The fixture doesn't keep a face change on any path, the Settings card's included, so the face drawn there stays the same after a pick. - Ran
desktop-agent-page.test.ts,toolbar.test.ts,sidebar-managers.test.ts, and the icon-picker, inline-edit and manager-face tests (all pass), plus typecheck for@repo/uiand@repo/panel. I left the rest to CI.