Show and customize workspace group icons
Summary
- Render workspace group headers through a validated SF Symbol fallback so empty or unavailable icons show the default folder icon instead of a blank slot.
- Add a group header context-menu action to set or clear a group-specific SF Symbol icon.
- Document the header menu action and existing group icon/color CLI commands.
Testing
- node -e "JSON.parse(require('fs').readFileSync('Resources/Localizable.xcstrings','utf8')); console.log('Localizable.xcstrings JSON OK')"
- ./scripts/lint-pbxproj-test-wiring.sh
- ./scripts/reload.sh --tag grpico --swift-frontend-workaround
Issues
- Task: user request to show workspace group icons and customize group icons.
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.
[!NOTE]
Medium Risk
Changes first-responder yielding for overlay text fields (regression-sensitive around #5269); icon persistence is otherwise low-impact UI state.
Overview
Adds custom workspace group icons (single emoji or validated SF Symbol) with a shared WorkspaceGroupIconPickerView: keyword search over a baked emoji catalog, typed symbol resolution, paging in the grid, and clear-to-default. Headers render via WorkspaceGroupIconPreview / RenderableWorkspaceGroupIcon, with folder.fill when nothing valid is stored; TabManager.setWorkspaceGroupIcon now normalizes through normalizedWorkspaceGroupIcon.
Entry points: sidebar group header “Set Group Icon…” (popover) and Command Palette palette.setGroupIcon when workspace.inGroup is true (inline picker, palette stays open). New command.setGroupIcon.* and workspaceGroup.icon.* strings are localized.
ForeignFirstResponderPolicy is updated so keystrokes reach NSText field editors in the main window or child overlay windows (e.g. SwiftUI popover/command-palette search), without weakening the #5269 rule for stranded responders in unrelated windows. SF Symbol renderability lookup is capped (512 entries, 128-char names) for picker-driven searches.
Reviewed by Cursor Bugbot for commit 140bbfdd28af47b44d71371b62422870e922a5e6. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Show workspace group icons and add a fast, searchable picker to set a custom emoji or SF Symbol from the header menu or the Command Palette. Icons fall back to folder.fill; input is validated and localized. Header icons now scale with the sidebar font size.
-
New Features
- Headers render emoji or SF Symbols via
WorkspaceGroupIconPreview/RenderableWorkspaceGroupIconwith afolder.fillfallback; icons scale with the sidebar font size. - “Set Group Icon…” opens
WorkspaceGroupIconPickerView: keyword emoji search (baked dataset with exact/prefix/substring), typed SF Symbol support, virtualized grid (common set seeded; full catalog loads off the main thread), and “Clear Icon”. Single emoji are stored; invalid or multi-emoji inputs are rejected.TabManager.setWorkspaceGroupIconusesnormalizedWorkspaceGroupIcon. - Command Palette adds “Set Group Icon…” when
workspace.inGroupis true; opens inline and keeps the palette open. Strings (command.setGroupIcon.*,workspaceGroup.icon.*) localized.
- Headers render emoji or SF Symbols via
-
Bug Fixes
- Keystrokes in overlay pickers are respected: the focus policy now yields to
NSTextin the active window or its child windows, preserving #5269. Tests updated. - Capped the SF Symbol renderability cache (512) and rejected overlong names to keep searches memory-safe; added tests.
- Keystrokes in overlay pickers are respected: the focus policy now yields to
Summary by CodeRabbit
-
New Features
- Added ability to customize workspace group icons with emoji or SF Symbols via "Set Group Icon" context menu option
- Introduced interactive icon picker with search, emoji suggestions, and symbol catalog
-
Documentation
- Updated workspace groups documentation with new icon customization CLI commands and UI menu options
-
Tests
- Added validation tests for emoji and symbol icon handling