feat(desktop): add macOS dock badge for chats with unseen activity
Show a count of chats (root sessions) with unseen activity on the macOS dock icon. The count is computed in the existing tray snapshot (full cross-project list, not the capped tray view; a subtask's unseen rolls up to its root only when subtask notifications are enabled) and pushed to the main process over the existing desktop_tray_update IPC, which calls app.setBadgeCount (0 clears it). The badge clears as sessions are marked seen on window focus. Add a Dock badge toggle in Appearance settings (default on, persisted, darwin desktop only), localized across all dictionaries, with a matching settings-search entry whose availability mirrors the render guard exactly.
This commit is contained in:
@@ -20,6 +20,8 @@ export interface SettingsSearchResult extends SettingsSearchItem {
|
||||
interface SettingsSearchAvailabilityContext extends SettingsRuntimeContext {
|
||||
isMobile: boolean;
|
||||
isDesktopLocalOrigin: boolean;
|
||||
// macOS desktop shell — for controls that only render on darwin (e.g. dock badge).
|
||||
isMac: boolean;
|
||||
}
|
||||
|
||||
const SETTINGS_SEARCH_ITEMS: readonly SettingsSearchItem[] = [
|
||||
@@ -65,6 +67,16 @@ const SETTINGS_SEARCH_ITEMS: readonly SettingsSearchItem[] = [
|
||||
keywords: ['transparent', 'transparency', 'vibrancy', 'blur', 'macos', 'opaque'],
|
||||
isAvailable: (ctx) => ctx.isDesktopLocalOrigin,
|
||||
},
|
||||
{
|
||||
id: 'appearance.dock-badge',
|
||||
page: 'appearance',
|
||||
titleKey: 'settings.openchamber.visual.field.dockBadge',
|
||||
descriptionKey: 'settings.openchamber.visual.field.dockBadgeHint',
|
||||
keywords: ['dock', 'badge', 'unread', 'unseen', 'counter', 'count', 'notification', 'macos'],
|
||||
// Exactly matches the render guard in OpenChamberVisualSettings: any darwin
|
||||
// Electron shell (isMac already implies isDesktopShell), local or remote host.
|
||||
isAvailable: (ctx) => ctx.isMac,
|
||||
},
|
||||
{
|
||||
id: 'appearance.pwa-install-name',
|
||||
page: 'appearance',
|
||||
|
||||
Reference in New Issue
Block a user