Add shared-terminal presence accessory and size menu to tabs
Adds an optional TabPresence on Tab/TabItem (settable through updateTab(presence:)). A tab with presence renders an avatar stack with an owner ring, the grid size and an amber dashed-box glyph when this device's window does not match; clicking it sends .showSizePanel. The tab context menu gains Size to My Window, Don't Resize from This Mac, a Terminal Size mode radio group, Show Size Panel… and Disconnect Other Clients… (new TabContextAction cases). Strings are localized in English and Japanese.
Used by cmux shared terminal sizing (local and Cloud terminals). Tests: swift test --filter TabPresenceTests (5 pass) and the existing context-menu tests.
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by cubic
Adds an optional TabPresence to tabs so shared terminals show attached participants in the tab, plus a terminal-size section in the tab context menu and a popover anchor API for hosts.
- Tabs with presence render up to three neutral-grey avatars (owner first with a ring, device glyphs for the viewer's own devices,
+Nfor the rest); clicking the stack sends.toggleSizePanel. Avatars are spaced so no glyph clips the next. - Avatar colors derive from the tab surface and tab-bar text color via
BonsplitContrastPalette, which enforces contrast floors (4.5:1 glyphs, 3:1 rings) on any theme and resolves dynamically per appearance. - The context menu gains Size to My Window, a Terminal Size mode submenu, and Disconnect Others… when anyone else is attached.
updateTab(presence:)acceptsTabPresence??so callers can pass.some(nil)to clear presence.BonsplitController.popoverAnchorView(for:)returns the presence accessory when on screen, else the tab item, so hosts can anchor popovers to the tab.ChromeColors.dividerHexcolors only the divider between split panes, falling back toborderHex, so hosts can honor a terminal's divider color without overriding all chrome.- Strings are localized in English and Japanese.
Summary by CodeRabbit
- New Features
- Shared terminals can show participant avatars in the tab bar, with additional participants summarized by a count.
- Added terminal sizing controls, including “Size to My Window,” five sizing modes, and a size panel toggle.
- Added an option to disconnect other terminal connections when available.
- Added presence information to tabs and made it available through the public API.
- Added contrast-aware colors for improved readability across themes and appearances.
- Tests
- Added coverage for presence, sizing actions, and color contrast across themes.