feat(desktop): per-session metadata and status icons in the tray menu
Enrich each session row in the macOS tray menu and refine its layout. - Add a "project · branch" sublabel to every session row, resolved from the session directory: project-root sessions map to their project + live/cached git branch; worktree sessions map back to their parent project and use the worktree's branch. Branch resolution falls back live VCS → git store → worktree metadata, with normalized directory keys. - Replace the inline text status glyph with a native left-aligned status icon (vertically centred across the title + sublabel). Idle rows use a transparent placeholder so every row shares the same gutter and both text lines align. - Status icons use the app icon set: pulse (busy), check (unread), error-warning (error), loop-right (retry); all rendered as tinted template images. - Drop the unread count "(n)" from the row label — the check icon already signals it and the number wasn't self-explanatory. - Show the first 8 sessions inline; the rest stay in the overflow submenu. - Subscribe the tray to the projects, worktree and git stores so subtitles stay current.
This commit is contained in:
@@ -4080,11 +4080,21 @@ const resolveTraySurface = () => {
|
||||
|
||||
const trayIconAssets = () => {
|
||||
const dir = path.join(resourceRoot(), 'icons', 'tray');
|
||||
const statusDir = path.join(dir, 'status');
|
||||
return {
|
||||
idleIconPath: path.join(dir, 'trayTemplate-idle.png'),
|
||||
unseenIconPath: path.join(dir, 'trayTemplate-unseen.png'),
|
||||
breathIconPaths: Array.from({ length: TRAY_BREATH_FRAME_COUNT }, (_, i) =>
|
||||
path.join(dir, `trayTemplate-breath-${String(i).padStart(2, '0')}.png`)),
|
||||
// Per-session status icons shown in the menu rows (left, vertically centred
|
||||
// across the title + sublabel). 'blank' reserves the gutter for idle rows.
|
||||
statusIconPaths: {
|
||||
busy: path.join(statusDir, 'busy.png'),
|
||||
retry: path.join(statusDir, 'retry.png'),
|
||||
error: path.join(statusDir, 'error.png'),
|
||||
unseen: path.join(statusDir, 'unseen.png'),
|
||||
blank: path.join(statusDir, 'blank.png'),
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user