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.
Rust acpagent-client-protocolai-agentsai-assistantclaudeclaude-codecodexcoding-agentscursorgeminigemini-cligrok-bot-alternativeiosiphonelinuxmacosmcpopen-sourcerustself-hosted
fix(desktop): redraw bot avatars when the appearance changes
leepokaif4e1e21f2f3b
diff --git a/apps/desktop/src/renderer/lib/theme.ts b/apps/desktop/src/renderer/lib/theme.tsindex e9cd7f3b..2bbbc496 100644--- a/apps/desktop/src/renderer/lib/theme.ts+++ b/apps/desktop/src/renderer/lib/theme.ts@@ -1,23 +1,42 @@import { useSyncExternalStore } from 'react'-const darkQuery = window.matchMedia('(prefers-color-scheme: dark)')-const motionQuery = window.matchMedia('(prefers-reduced-motion: reduce)')--const subscribe = (query: MediaQueryList) => (cb: () => void) => {- query.addEventListener('change', cb)- return () => query.removeEventListener('change', cb)+/**+ * A media query read from one MediaQueryList and listened to on another: Chromium shares a list's+ * `matches` with its change detection, so a read while the window is hidden can swallow the `change`+ * and memoized canvases (avatars) keep the old appearance's ink. Showing or focusing the window+ * checks again, so a missed change never outlives the next look at the window.+ */+function mediaQuery(media: string) {+ const reads = window.matchMedia(media)+ const events = window.matchMedia(media)+ return {+ get: () => reads.matches,+ subscribe: (cb: () => void) => {+ events.addEventListener('change', cb)+ document.addEventListener('visibilitychange', cb)+ window.addEventListener('focus', cb)+ return () => {+ events.removeEventListener('change', cb)+ document.removeEventListener('visibilitychange', cb)+ window.removeEventListener('focus', cb)+ }+ },+ }}+const darkQuery = mediaQuery('(prefers-color-scheme: dark)')+const motionQuery = mediaQuery('(prefers-reduced-motion: reduce)')+export function useDark() {- return useSyncExternalStore(subscribe(darkQuery), () => darkQuery.matches)+ return useSyncExternalStore(darkQuery.subscribe, darkQuery.get)}export function useReduceMotion() {- return useSyncExternalStore(subscribe(motionQuery), () => motionQuery.matches)+ return useSyncExternalStore(motionQuery.subscribe, motionQuery.get)}-export const isDark = () => darkQuery.matches-export const reduceMotion = () => motionQuery.matches+export const isDark = darkQuery.get+export const reduceMotion = motionQuery.get/** Palette values for drawing code (canvas) that can't read CSS variables. */export const palette = (dark: boolean) => ({