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 an update badge next to Extensions

leepokaid1763300832e
diff --git a/apps/desktop/src/main/updates.ts b/apps/desktop/src/main/updates.ts
index 770a46c7..5140d300 100644
--- a/apps/desktop/src/main/updates.ts
+++ b/apps/desktop/src/main/updates.ts
@@ -37,6 +37,8 @@ export class Updates extends EventEmitter {
waitingForApp: null,
}
private userInitiated = false
+ /** The person chose Update: restart into the release as soon as it's downloaded. */
+ private installWhenDownloaded = false
private preparing: Promise<boolean> | null = null
private prepared = false
private updateGeneration = 0
@@ -49,6 +51,7 @@ export class Updates extends EventEmitter {
register(windows: () => BrowserWindow[]) {
ipcMain.handle('updates:state', () => this.state)
ipcMain.on('updates:check', () => this.check())
+ ipcMain.on('updates:install', () => this.installNow())
ipcMain.on('updates:autoCheck', (_e, on: boolean) => this.setAutoCheck(on))
ipcMain.on('updates:autoDownload', (_e, on: boolean) => this.setAutoDownload(on))
this.on('setAutoCheck', (on: boolean) => this.setAutoCheck(on))
@@ -68,7 +71,10 @@ export class Updates extends EventEmitter {
autoUpdater.autoDownload = false
autoUpdater.autoInstallOnAppQuit = true
autoUpdater.on('checking-for-update', () => this.set({ checking: true, error: null }))
- autoUpdater.on('update-not-available', () => this.checked({ availableVersion: null }))
+ autoUpdater.on('update-not-available', () => {
+ this.installWhenDownloaded = false
+ this.checked({ availableVersion: null })
+ })
autoUpdater.on('update-available', (info) => void this.available(info))
autoUpdater.on('download-progress', ({ percent }) => {
const rounded = Math.floor(percent)
@@ -77,7 +83,9 @@ export class Updates extends EventEmitter {
// Ready to install: the person restarts from the Updates page, or it installs once idle.
autoUpdater.on('update-downloaded', (info) => {
this.set({ staged: true, downloadPercent: null, availableVersion: info.version })
- this.installWhenIdle()
+ if (!this.installWhenDownloaded) return this.installWhenIdle()
+ this.installWhenDownloaded = false
+ void this.install(true)
})
autoUpdater.on('error', (error) => this.failed(error))
@@ -118,6 +126,7 @@ export class Updates extends EventEmitter {
private failed(error: unknown) {
this.updateGeneration++
+ this.installWhenDownloaded = false
prefs.set('updateRelaunchInFront', false)
// A preparation still stopping the host restores it after stop completes.
if (this.prepared) {
@@ -148,6 +157,14 @@ export class Updates extends EventEmitter {
void autoUpdater.checkForUpdates().catch(() => {})
}
+ /** The sidebar's Update badge: restarts into the available release, downloading it first. */
+ installNow() {
+ if (!enabled || !this.state.availableVersion || this.state.waitingForApp) return
+ if (this.state.staged) return void this.install(true)
+ this.installWhenDownloaded = true
+ this.check()
+ }
+
/**
* A release that needs a newer iPhone app than the App Store has (still in review) waits,
* so paired iPhones aren't asked for an update they can't get yet. Without an answer from
@@ -166,6 +183,7 @@ export class Updates extends EventEmitter {
}
this.checked({ availableVersion: info.version, waitingForApp: waiting })
if (waiting) {
+ this.installWhenDownloaded = false
if (this.userInitiated) this.set({ error: `Codync ${info.version} needs the iPhone app ${waiting}, which isn't in the App Store yet. It installs once that version passes review.` })
this.userInitiated = false
return
diff --git a/apps/desktop/src/preload/index.ts b/apps/desktop/src/preload/index.ts
index 9b431041..30768f40 100644
--- a/apps/desktop/src/preload/index.ts
+++ b/apps/desktop/src/preload/index.ts
@@ -89,6 +89,7 @@ const bridge: CodyncBridge = {
state: () => ipcRenderer.invoke('updates:state'),
onChange: (cb) => listen('updates:change', cb),
check: () => ipcRenderer.send('updates:check'),
+ install: () => ipcRenderer.send('updates:install'),
setAutoCheck: (on) => ipcRenderer.send('updates:autoCheck', on),
setAutoDownload: (on) => ipcRenderer.send('updates:autoDownload', on),
},
diff --git a/apps/desktop/src/renderer/demo/bridge.ts b/apps/desktop/src/renderer/demo/bridge.ts
index 429d050b..ee7e7c66 100644
--- a/apps/desktop/src/renderer/demo/bridge.ts
+++ b/apps/desktop/src/renderer/demo/bridge.ts
@@ -87,7 +87,7 @@ const bridge: CodyncBridge = {
openApp() {},
},
cloud: { request: async () => ({ ok: false, error: { status: 503, code: 'demo', message: DEMO_UNAVAILABLE } }) },
- updates: { state: async () => updates, onChange: none, check() {}, setAutoCheck() {}, setAutoDownload() {} },
+ updates: { state: async () => updates, onChange: none, check() {}, install() {}, setAutoCheck() {}, setAutoDownload() {} },
files: { begin: unavailable, write: async () => {}, finish: async () => {}, cancel: async () => {} },
app: {
reportError() {},
diff --git a/apps/desktop/src/renderer/views/ChatWindow.tsx b/apps/desktop/src/renderer/views/ChatWindow.tsx
index 99477fbe..5c8d3b65 100644
--- a/apps/desktop/src/renderer/views/ChatWindow.tsx
+++ b/apps/desktop/src/renderer/views/ChatWindow.tsx
@@ -14,6 +14,7 @@ import type { BotStore } from '../store/bot-store'
import { useComputerRoster } from '../store/computer-roster'
import { BotRoster } from './BotRoster'
import { SidebarFooter } from './SidebarFooter'
+import { UpdateBadge } from './UpdateButton'
import { ComputerFilterHeader, computerSelection } from './ComputerFilterHeader'
import { ThreadView } from './thread/ThreadView'
import { NewChatView } from './bots/NewChatView'
@@ -373,6 +374,7 @@ function ChatSplitView() {
<IconButton title="New" icon="plus" size={36} buttonRef={railNewButton} disabled={!onlineStores.length} onClick={() => setRailNewMenu((o) => !o)} />
<AnchoredMenu open={railNewMenu} onClose={() => setRailNewMenu(false)} anchor={railNewButton} items={newItems} />
<IconButton title="Extensions" icon="square.grid.2x2" size={36} onClick={openMarketplace} />
+ <UpdateBadge size={32} />
<button className="rail-profile" style={{ background: showAccount ? 'var(--bubble-agent)' : undefined }} aria-label="Open account menu for Account" title="Account" onClick={() => setShowAccount((s) => !s)}>
<ProfileAvatar />
</button>
diff --git a/apps/desktop/src/renderer/views/SidebarFooter.tsx b/apps/desktop/src/renderer/views/SidebarFooter.tsx
index 30f631be..99a25348 100644
--- a/apps/desktop/src/renderer/views/SidebarFooter.tsx
+++ b/apps/desktop/src/renderer/views/SidebarFooter.tsx
@@ -1,4 +1,5 @@
import { ProfileAvatar } from './PanelMenus'
+import { UpdateBadge } from './UpdateButton'
import gmail from '../assets/gmail.png'
import calendar from '../assets/google-calendar.png'
import drive from '../assets/google-drive.png'
@@ -28,6 +29,7 @@ export function SidebarFooter({ accountOpen, onAccount, onExtensions }: {
{[gmail, calendar, drive].map((src) => <img key={src} src={src} alt="" draggable={false} />)}
</span>
</button>
+ <UpdateBadge size={34} />
</div>
)
}
diff --git a/apps/desktop/src/renderer/views/UpdateButton.tsx b/apps/desktop/src/renderer/views/UpdateButton.tsx
index 9e1f0edb..c4a6118e 100644
--- a/apps/desktop/src/renderer/views/UpdateButton.tsx
+++ b/apps/desktop/src/renderer/views/UpdateButton.tsx
@@ -2,6 +2,8 @@ import { useEffect, useState } from 'react'
import type { UpdateState } from '@shared/ipc'
import { updateAction } from '@shared/update-action'
import { Button } from '../components/Controls'
+import { Icon } from '../components/Icon'
+import { Dialog } from '../components/Overlay'
/** The app's update state, kept live. */
export function useUpdates() {
@@ -22,3 +24,31 @@ export function UpdateButton({ updates, kind = 'secondary' }: { updates: UpdateS
</Button>
)
}
+
+/** The sidebar's nudge while a release is available: Update, once confirmed, restarts into it. */
+export function UpdateBadge({ size }: { size: number }) {
+ const updates = useUpdates()
+ const [confirming, setConfirming] = useState(false)
+ if (!updates?.supported || !updates.availableVersion || updates.waitingForApp) return null
+ return (
+ <>
+ <button
+ className="update-badge"
+ style={{ width: size, height: size }}
+ title="Update"
+ aria-label="Update"
+ disabled={updates.installing}
+ onClick={() => setConfirming(true)}
+ >
+ <Icon name="arrow.down" size={size * 0.42} weight="semibold" />
+ </button>
+ <Dialog
+ open={confirming}
+ title={`Update to Codync ${updates.availableVersion}?`}
+ message="Codync restarts to install it."
+ actions={[{ title: 'Update', action: () => window.codync.updates.install() }]}
+ onClose={() => setConfirming(false)}
+ />
+ </>
+ )
+}
diff --git a/apps/desktop/src/renderer/views/sidebar-footer.css b/apps/desktop/src/renderer/views/sidebar-footer.css
index c6f2eb2a..bbb56738 100644
--- a/apps/desktop/src/renderer/views/sidebar-footer.css
+++ b/apps/desktop/src/renderer/views/sidebar-footer.css
@@ -77,8 +77,25 @@
.extensions-logos img { width: 14px; height: 16px; padding: 1px; background: #fff; border-radius: 3px; object-fit: contain; }
.extensions-logos > * + * { margin-left: -3px; }
+/* An available release: one filled circle that stands out from the quiet chrome around it. */
+.update-badge {
+ flex: none;
+ display: grid;
+ place-items: center;
+ border-radius: 50%;
+ color: var(--on-accent);
+ background: var(--accent-fill);
+ animation: update-badge-in var(--layout) both;
+ transition: opacity var(--hover), transform var(--hover);
+}
+.update-badge:hover:not(:disabled) { opacity: .85; }
+.update-badge:active:not(:disabled) { transform: scale(.94); }
+.update-badge:disabled { opacity: .35; }
+@keyframes update-badge-in { from { opacity: 0; transform: scale(.6); } }
+
@media (prefers-reduced-motion: reduce) {
- .extensions:active, .sidebar-account:active { transform: none; }
+ .extensions:active, .sidebar-account:active, .update-badge:active:not(:disabled) { transform: none; }
+ .update-badge { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
.sidebar-footer-fade { background: var(--surface); inset: 0; }
diff --git a/apps/desktop/src/shared/ipc.ts b/apps/desktop/src/shared/ipc.ts
index b60a0e41..39ed17c2 100644
--- a/apps/desktop/src/shared/ipc.ts
+++ b/apps/desktop/src/shared/ipc.ts
@@ -178,6 +178,8 @@ export interface CodyncBridge {
state(): Promise<UpdateState>
onChange(cb: (s: UpdateState) => void): () => void
check(): void
+ /** Downloads the available release if needed, then restarts into it. */
+ install(): void
setAutoCheck(on: boolean): void
setAutoDownload(on: boolean): void
}
diff --git a/apps/desktop/src/shared/updates.test.ts b/apps/desktop/src/shared/updates.test.ts
index a0f98e0d..45b29b9c 100644
--- a/apps/desktop/src/shared/updates.test.ts
+++ b/apps/desktop/src/shared/updates.test.ts
@@ -70,6 +70,27 @@ test('manual check downloads with progress, then waits for Restart to update', a
assert.equal(f.preferences.get('updateRelaunchInFront'), true)
})
+test('the Update badge downloads the release if needed, then restarts into it', async () => {
+ const f = updaterFixture({ prefs: { updatesAutoDownload: false } })
+ f.ipc.emit('updates:install')
+ assert.equal(f.calls.check, 0, 'nothing to install before a release is found')
+ await f.emit('update-available', release)
+ assert.equal(f.calls.download, 0)
+ f.ipc.emit('updates:install')
+ await f.emit('update-available', release)
+ assert.equal(f.calls.download, 1)
+ await f.emit('update-downloaded', release)
+ assert.equal(f.calls.install, 1, 'restarts without a second click')
+ assert.equal(f.preferences.get('updateRelaunchInFront'), true)
+
+ const staged = updaterFixture()
+ await staged.emit('update-downloaded', release)
+ staged.ipc.emit('updates:install')
+ await settle()
+ assert.equal(staged.calls.check, 0)
+ assert.equal(staged.calls.install, 1)
+})
+
test('the app relaunched by a chosen restart opens its own bundle once to come forward', () => {
const relaunched = updaterFixture({ prefs: { updateRelaunchInFront: true } })
assert.deepEqual(relaunched.opened, ['/Applications/Codync.app'])
diff --git a/docs/design/ui-conventions.md b/docs/design/ui-conventions.md
index 81faaa95..66cbf56c 100644
--- a/docs/design/ui-conventions.md
+++ b/docs/design/ui-conventions.md
@@ -28,7 +28,11 @@ whole flow (`apps/desktop/src/shared/update-action.ts`, the same label in the tr
Updates page and the update-needed card): **Check for updates** → **Update to <version>**
→ **Downloading… N%** (the Updates page adds a progress bar) → **Restart to update** →
**Restarting…**. A finished download never quits the app on its own; the person restarts,
-or it installs once idle. The TUI action list has **Check for updates**. Download and
+or it installs once idle. While a release is available (and not waiting for the iPhone
+app), a filled arrow badge sits right of **Extensions** in the sidebar footer (under the
+Extensions icon in the collapsed rail), tooltip **Update**; it asks **Update to Codync
+<version>?** and then restarts into the release, downloading it first if needed, and it
+is gone once the app runs the latest version. The TUI action list has **Check for updates**. Download and
install go through electron-updater (`apps/desktop/src/main/updates.ts`); there is no
separate update window.
diff --git a/docs/guides/updates.md b/docs/guides/updates.md
index b8d2e589..3cc4fc85 100644
--- a/docs/guides/updates.md
+++ b/docs/guides/updates.md
@@ -19,6 +19,12 @@ installer takes over. The relaunched app comes to the front (macOS doesn't activ
the installer relaunches from the background, so a one-shot `updateRelaunchInFront`
preference asks for it).
+While a release is available, an **Update** badge sits right of **Extensions** in the
+chat window's sidebar (`UpdateBadge`). After a confirmation it restarts into the release
+(`updates.install()`): straight away when it is staged, otherwise once its download
+finishes, without a second click. The badge hides while the release waits for the iPhone
+app and disappears once Codync runs the latest version.
+
The app checks daily (hourly while a release waits for the iPhone app, below).
Automatic installation waits until no Codync window is focused, there has been no
keyboard/mouse input for ten minutes, and the local host reports that it is idle.