Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

feat(desktop): show action icons in the Windows and Linux tray menu

leepokaifd79c14a9c01
diff --git a/apps/desktop/src/main/tray.ts b/apps/desktop/src/main/tray.ts
index 1152d2c8..5542e47f 100644
--- a/apps/desktop/src/main/tray.ts
+++ b/apps/desktop/src/main/tray.ts
@@ -1,6 +1,6 @@
import { join } from 'node:path'
import { app, clipboard, Menu, nativeImage, shell, Tray as ElectronTray } from 'electron'
-import type { TrayImage, TraySummary, WindowCommand } from '../shared/ipc'
+import type { TrayImage, TraySummary, TraySymbol, WindowCommand } from '../shared/ipc'
import type { HostController } from './host-controller'
import type { Updates } from './updates'
import { updateAction } from '../shared/update-action'
@@ -22,8 +22,6 @@ interface Deps {
const resources = () => (app.isPackaged ? process.resourcesPath : join(__dirname, '../../resources'))
const TEXT_SIZES = [11, 12, 13, 14, 15, 16, 18]
-/** macOS menus show an SF Symbol beside each action; Linux and Windows keep plain rows. */
-const symbol = (name: string) => (process.platform === 'darwin' ? nativeImage.createMenuSymbol(name) : undefined)
/** The menu bar icon and its system menu: macOS owns layout, selection and submenus. */
export class Tray {
@@ -73,6 +71,12 @@ export class Tray {
return image.isEmpty() ? undefined : image
}
+ /** The symbol beside an action: SF Symbols on macOS, the renderer's drawing of it on Windows and Linux. */
+ private symbol(name: TraySymbol) {
+ if (process.platform === 'darwin') return nativeImage.createMenuSymbol(name)
+ return this.image(this.summary?.symbols?.[name] ?? null)
+ }
+
private rebuild() {
const { host, send } = this.deps
const s = this.summary
@@ -85,9 +89,9 @@ export class Tray {
: state.kind === 'failed' ? 'Host problem'
: (s?.status ?? 'Connected')
items.push({ label: this.tr(status), enabled: false })
- items.push({ label: this.tr('Open {name}').replaceAll('{name}', app.getName()), icon: symbol('macwindow'), accelerator: 'CmdOrCtrl+O', click: () => this.deps.openChat() })
+ items.push({ label: this.tr('Open {name}').replaceAll('{name}', app.getName()), icon: this.symbol('macwindow'), accelerator: 'CmdOrCtrl+O', click: () => this.deps.openChat() })
if (state.kind === 'running') {
- items.push({ label: this.tr('Pair iPhone…'), icon: symbol('qrcode'), enabled: s?.canPair ?? false, click: () => this.deps.openPairing() })
+ items.push({ label: this.tr('Pair iPhone…'), icon: this.symbol('qrcode'), enabled: s?.canPair ?? false, click: () => this.deps.openPairing() })
}
items.push({ type: 'separator' })
@@ -98,22 +102,22 @@ export class Tray {
break
}
items.push({ label: this.tr('Reinstall Codync or install the host with Homebrew.'), enabled: false })
- items.push({ label: this.tr('Copy host install command'), icon: symbol('square.on.square'), click: () => clipboard.writeText('brew install leepokai/codync/codync-host') })
+ items.push({ label: this.tr('Copy host install command'), icon: this.symbol('square.on.square'), click: () => clipboard.writeText('brew install leepokai/codync/codync-host') })
break
case 'notInstalled':
- items.push({ label: this.tr('Install host'), icon: symbol('arrow.down.circle'), click: () => void host.install() })
+ items.push({ label: this.tr('Install host'), icon: this.symbol('arrow.down.circle'), click: () => void host.install() })
break
case 'starting':
items.push({ label: this.tr('Starting the host…'), enabled: false })
break
case 'failed':
items.push({ label: this.tr(state.message), enabled: false })
- items.push({ label: this.tr('Restart host'), icon: symbol('arrow.clockwise.circle'), click: () => host.restart() })
- items.push({ label: this.tr('Open log'), icon: symbol('list.bullet.rectangle'), click: () => void shell.openPath(host.logPath) })
+ items.push({ label: this.tr('Restart host'), icon: this.symbol('arrow.clockwise.circle'), click: () => host.restart() })
+ items.push({ label: this.tr('Open log'), icon: this.symbol('list.bullet.rectangle'), click: () => void shell.openPath(host.logPath) })
break
case 'running':
if (s?.approval) {
- items.push({ label: this.tr('Review access request from {name}…').replaceAll('{name}', s.approval), icon: symbol('person.crop.circle.badge.checkmark'), click: () => send({ kind: 'reviewApprovals' }) })
+ items.push({ label: this.tr('Review access request from {name}…').replaceAll('{name}', s.approval), icon: this.symbol('person.crop.circle.badge.checkmark'), click: () => send({ kind: 'reviewApprovals' }) })
items.push({ type: 'separator' })
}
if (!s || s.bots.length === 0) {
@@ -129,8 +133,8 @@ export class Tray {
}
}
if (s?.screen || s?.networks) items.push({ type: 'separator' })
- if (s?.screen) items.push({ label: this.tr('Remote screen'), icon: symbol('display'), submenu: this.screenMenu(s.screen) })
- if (s?.networks) items.push({ label: this.tr('Network'), icon: symbol('point.3.connected.trianglepath.dotted'), submenu: this.networkMenu(s.networks) })
+ if (s?.screen) items.push({ label: this.tr('Remote screen'), icon: this.symbol('display'), submenu: this.screenMenu(s.screen) })
+ if (s?.networks) items.push({ label: this.tr('Network'), icon: this.symbol('point.3.connected.trianglepath.dotted'), submenu: this.networkMenu(s.networks) })
if (s && s.usage.length) {
items.push({ type: 'separator' })
for (const provider of s.usage) {
@@ -146,8 +150,8 @@ export class Tray {
items.push({ type: 'separator' })
// Settings and Quit close the menu as a pair; the version lives in Settings → Updates.
- items.push({ label: this.tr('Settings'), icon: symbol('gearshape'), submenu: this.settingsMenu() })
- items.push({ label: this.tr('Quit {name}').replaceAll('{name}', app.getName()), icon: symbol('power'), accelerator: 'CmdOrCtrl+Q', click: () => app.quit() })
+ items.push({ label: this.tr('Settings'), icon: this.symbol('gearshape'), submenu: this.settingsMenu() })
+ items.push({ label: this.tr('Quit {name}').replaceAll('{name}', app.getName()), icon: this.symbol('power'), accelerator: 'CmdOrCtrl+Q', click: () => app.quit() })
this.tray.setContextMenu(Menu.buildFromTemplate(items))
}
diff --git a/apps/desktop/src/renderer/components/icon-fallbacks.ts b/apps/desktop/src/renderer/components/icon-fallbacks.ts
index 04582a0c..7cea9241 100644
--- a/apps/desktop/src/renderer/components/icon-fallbacks.ts
+++ b/apps/desktop/src/renderer/components/icon-fallbacks.ts
@@ -23,6 +23,7 @@ const map: Record<string, IconNode> = {
'arrow.down': L.ArrowDown,
'arrow.down.to.line': L.Download,
'arrow.down.circle': L.CircleArrowDown,
+ 'arrow.clockwise.circle': L.RotateCw,
'arrow.down.right.and.arrow.up.left': L.Minimize2,
'arrow.left': L.ArrowLeft,
'arrow.left.arrow.right': L.ArrowLeftRight,
@@ -115,6 +116,7 @@ const map: Record<string, IconNode> = {
macmini: L.Server,
'macpro.gen3': L.Server,
macstudio: L.Server,
+ macwindow: L.AppWindow,
magnifyingglass: L.Search,
mic: L.Mic,
moon: L.Moon,
@@ -191,3 +193,26 @@ export function fallbackSvg(name: string): string {
cache.set(name, svg)
return svg
}
+
+/** The same icon as a canvas path in Lucide's 24-point box, for images drawn outside the DOM (menu icons). */
+export function fallbackPath(name: string): Path2D {
+ const path = new Path2D()
+ const n = (v: unknown) => Number(v ?? 0)
+ for (const [tag, a] of map[name] ?? L.Circle) {
+ if (tag === 'path') path.addPath(new Path2D(String(a.d)))
+ else if (tag === 'rect') path.roundRect(n(a.x), n(a.y), n(a.width), n(a.height), n(a.rx))
+ else if (tag === 'line') {
+ path.moveTo(n(a.x1), n(a.y1))
+ path.lineTo(n(a.x2), n(a.y2))
+ } else if (tag === 'circle' || tag === 'ellipse') {
+ const [rx, ry] = tag === 'circle' ? [n(a.r), n(a.r)] : [n(a.rx), n(a.ry)]
+ path.moveTo(n(a.cx) + rx, n(a.cy))
+ path.ellipse(n(a.cx), n(a.cy), rx, ry, 0, 0, Math.PI * 2)
+ } else {
+ const points = String(a.points).trim().split(/[\s,]+/).map(Number)
+ for (let i = 0; i + 1 < points.length; i += 2) path[i ? 'lineTo' : 'moveTo'](points[i], points[i + 1])
+ if (tag === 'polygon') path.closePath()
+ }
+ }
+ return path
+}
diff --git a/apps/desktop/src/renderer/views/tray-summary.ts b/apps/desktop/src/renderer/views/tray-summary.ts
index 041cd9f5..3664dbb3 100644
--- a/apps/desktop/src/renderer/views/tray-summary.ts
+++ b/apps/desktop/src/renderer/views/tray-summary.ts
@@ -1,8 +1,9 @@
import { useEffect } from 'react'
-import type { TrayImage, TraySummary } from '@shared/ipc'
+import { TRAY_SYMBOLS, type TrayImage, type TraySummary } from '@shared/ipc'
import { isGroup, isWorking, needsInput, folderName, type Bot, type UsageWindow } from '@shared/models'
import type { NetworkView } from '@shared/network'
import { drawCharacter, moodOf } from '../components/Avatar'
+import { fallbackPath } from '../components/icon-fallbacks'
import { botsTemplate, presenceTitle, roleTitle } from '../lib/network-copy'
import { useModels } from '../lib/observable'
import { resetLine, resolvedLanguage, translate } from '../lib/l10n'
@@ -95,6 +96,24 @@ function dotIcon(online: boolean) {
})
}
+/** The actions' icons for Windows and Linux menus, from the same fallbacks the app's icons use there. */
+function symbolIcons(): TraySummary['symbols'] {
+ if (isMac) return null
+ const icons: NonNullable<TraySummary['symbols']> = {}
+ for (const name of TRAY_SYMBOLS) {
+ const icon = canvasImage(`symbol|${name}`, 16, 16, (ctx) => {
+ ctx.scale(16 / 24, 16 / 24)
+ ctx.strokeStyle = isDark() ? '#FFFFFF' : '#000000'
+ ctx.lineWidth = 2
+ ctx.lineCap = 'round'
+ ctx.lineJoin = 'round'
+ ctx.stroke(fallbackPath(name))
+ })
+ if (icon) icons[name] = icon
+ }
+ return icons
+}
+
/** "home · Owner" and "desk · Online · 3 bots" per network; null on hosts without networks. */
function networkLines(view: NetworkView | null | undefined): TraySummary['networks'] {
if (!view) return null
@@ -161,6 +180,7 @@ export function useTraySummary(app: AppModel) {
}
: null,
networks: networkLines(local?.network),
+ symbols: symbolIcons(),
needsAttention: app.needsAttention,
textSize,
usageIconStyle: iconStyle,
diff --git a/apps/desktop/src/shared/ipc.ts b/apps/desktop/src/shared/ipc.ts
index ccd54fa2..02c03a64 100644
--- a/apps/desktop/src/shared/ipc.ts
+++ b/apps/desktop/src/shared/ipc.ts
@@ -44,6 +44,22 @@ export interface TrayImage {
}
/** What the tray menu shows; the renderer owns the stores and sends this on every change. */
+/** The SF Symbols beside the tray menu's actions. */
+export const TRAY_SYMBOLS = [
+ 'macwindow',
+ 'qrcode',
+ 'square.on.square',
+ 'arrow.down.circle',
+ 'arrow.clockwise.circle',
+ 'list.bullet.rectangle',
+ 'person.crop.circle.badge.checkmark',
+ 'display',
+ 'point.3.connected.trianglepath.dotted',
+ 'gearshape',
+ 'power',
+] as const
+export type TraySymbol = (typeof TRAY_SYMBOLS)[number]
+
export interface TraySummary {
status: string
canPair: boolean
@@ -57,6 +73,8 @@ export interface TraySummary {
} | null
/** This computer's networks (codync-network), lines already translated; null on hosts without them. */
networks: { title: string; computers: { label: string; dot: TrayImage | null }[] }[] | null
+ /** Windows and Linux: the actions' symbols drawn by the renderer (macOS menus draw SF Symbols); null on macOS. */
+ symbols: Partial<Record<TraySymbol, TrayImage>> | null
needsAttention: boolean
textSize: number
usageIconStyle: 'character' | 'original'
diff --git a/docs/design/ui-conventions.md b/docs/design/ui-conventions.md
index 4f27c475..b5b5c650 100644
--- a/docs/design/ui-conventions.md
+++ b/docs/design/ui-conventions.md
@@ -39,7 +39,7 @@ runs the latest version. The TUI action list has **Check for updates**. Download
install go through electron-updater (`apps/desktop/src/main/updates.ts`); there is no
separate update window.
-The tray menu is Electron's native `Menu` (`apps/desktop/src/main/tray.ts`), the only system menu in the desktop app. Its commands, submenus, checkboxes, usage-icon radio items, separators and keyboard navigation use system styling. Do not add custom cards, hover backgrounds, icon buttons or a window-style menu panel here. On macOS only, action rows (Open, Pair iPhone, host actions, approval review, Remote screen, Settings, Quit) carry an SF Symbol through `nativeImage.createMenuSymbol`; status, bot and usage rows get none, and Linux and Windows keep plain rows. The app version is a row in Settings → Updates, so Settings and Quit end the menu together.
+The tray menu is Electron's native `Menu` (`apps/desktop/src/main/tray.ts`), the only system menu in the desktop app. Its commands, submenus, checkboxes, usage-icon radio items, separators and keyboard navigation use system styling. Do not add custom cards, hover backgrounds, icon buttons or a window-style menu panel here. Action rows (Open, Pair iPhone, host actions, approval review, Remote screen, Settings, Quit) carry an SF Symbol: on macOS through `nativeImage.createMenuSymbol`, on Linux and Windows as the symbol's Lucide fallback the renderer draws (`TRAY_SYMBOLS`, `tray-summary.ts`); status, bot and usage rows get none. The app version is a row in Settings → Updates, so Settings and Quit end the menu together.
The menu retains host installation/restart, bot conversation/stop actions, approval review, usage limits, remote-screen permissions, open-at-login and quit. Pairing opens a separate titled window because its QR needs a persistent scanning surface. The chat window retains its own UI conventions.