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
refactor(desktop): one style system for every view
leepokaib61724b7c7dc
diff --git a/AGENTS.md b/AGENTS.mdindex c20f7898..45236840 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -4,7 +4,7 @@- `host/`: Rust daemon, ACP integration, SQLite storage, HTTP/SSE API, and terminal UI; unit tests live alongside modules in `src/`.- `apps/ios/`: iPhone app (SwiftUI); widgets live in `apps/ios/Widgets/`. `apps/ios/Kit/` is its Swift package: `CodyncKit` (models, clients, design primitives) and `CodyncUI` (screens and stores); tests in `apps/ios/Kit/Tests/CodyncKitTests/`.-- `apps/desktop/`: desktop app for macOS, Linux and Windows (Electron, React, TypeScript): [docs/architecture/desktop-app.md](docs/architecture/desktop-app.md).+- `apps/desktop/`: desktop app for macOS, Linux and Windows (Electron, React, TypeScript): [docs/architecture/desktop-app.md](docs/architecture/desktop-app.md); how its views are styled: [docs/guides/desktop-styles.md](docs/guides/desktop-styles.md).- `apps/android/`: Android phone app (Kotlin, Jetpack Compose), ported from the iPhone app: `core` (models, crypto, transport), `design` (Codync's components), `app` (screens, store, widgets): [apps/android/README.md](apps/android/README.md).- `apps/screen-macos` and `apps/screen-linux`: Remote screen helpers.- `cloud/`: Cloudflare accounts, encrypted relay, Durable Objects and D1; tests live in `cloud/test/`.diff --git a/CLAUDE.md b/CLAUDE.mdindex 3816a4c1..35fe5bd3 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -9,7 +9,7 @@ Bot-based remote for coding agents: persistent named bots on your computer, mess- Use structured concurrency (`async/await`, `TaskGroup`) over Combine- Use `sending`, `nonisolated`, `@MainActor` correctly per Swift 6 rules- Avoid `@unchecked Sendable` — prefer proper `Sendable` conformance-- Desktop app (`apps/desktop/`) is Electron + React + strict TypeScript: state in `Observable` models (`src/renderer/store/`), host calls through the `window.codync` bridge (`src/shared/ipc.ts`), main-process code in `src/main/`; CI runs `npm run typecheck` and `npm test`+- Desktop app (`apps/desktop/`) is Electron + React + strict TypeScript: state in `Observable` models (`src/renderer/store/`), host calls through the `window.codync` bridge (`src/shared/ipc.ts`), main-process code in `src/main/`; views style through `Text`, `HStack`/`VStack` and theme tokens, with no static inline styles ([desktop styles](docs/guides/desktop-styles.md)); CI runs `npm run typecheck` and `npm test`- Android app (`apps/android/`) is Kotlin + Jetpack Compose, ported screen for screen from the iPhone app: screens use the `design` module (glass, sheets, menus, controls, `Symbol` for SF Symbol names), never Material widgets beyond `Text`; CI runs the Gradle checks in `.github/workflows/android.yml` ([apps/android/README.md](apps/android/README.md))- Host is Rust 2024 edition and follows the `rust-skills` rules (`~/.agents/skills/rust-skills`). Lints live in `host/Cargo.toml` (`[lints]`: default groups + pedantic, `unwrap_used`); CI runs `cargo fmt --check` and `cargo clippy --all-targets -- -D warnings`- Host conventions: no `unwrap()` outside tests (`expect("why this can't fail")` for true invariants); lock std mutexes with `LockExt::locked()` (poison-tolerant); enums, not strings, for states and modes (`BotStatus`, `Permission`, `EntryKind`, `AlertKind`); `tracing` with structured fields (`error = format!("{e:#}")` keeps the context chain); blocking fs/process work goes through `spawn_blocking`; registry JSON is untrusted (paths are validated)diff --git a/apps/desktop/src/renderer/components/Avatar.tsx b/apps/desktop/src/renderer/components/Avatar.tsxindex 0b76d986..458c3be6 100644--- a/apps/desktop/src/renderer/components/Avatar.tsx+++ b/apps/desktop/src/renderer/components/Avatar.tsx@@ -2,6 +2,7 @@ import { memo, useEffect, useRef, type CSSProperties } from 'react'import { isGroup, isWorking, needsInput, type Bot } from '@shared/models'import { avatarColor, palette, useDark, useReduceMotion } from '../lib/theme'import { Icon } from './Icon'+import './avatar.css'export type Mood = 'idle' | 'working' | 'needsInput'@@ -107,14 +108,13 @@ interface CharacterProps {mood?: Mood/** Draws for a dark ground whatever the system appearance (the notch island is always black). */dark?: boolean- style?: CSSProperties}/*** Grok-Bot-style character drawn like the app icon: an even grid of dots shaded as if the* silhouette were a ball, with hollow eyes that glance while it works and blink now and then.*/-export const CharacterAvatar = memo(function CharacterAvatar({ shape, color, tint, size = 40, mood = 'idle', dark: forceDark, style }: CharacterProps) {+export const CharacterAvatar = memo(function CharacterAvatar({ shape, color, tint, size = 40, mood = 'idle', dark: forceDark }: CharacterProps) {const canvas = useRef<HTMLCanvasElement>(null)const dark = useDark() || forceDark === trueconst reduce = useReduceMotion()@@ -155,7 +155,7 @@ export const CharacterAvatar = memo(function CharacterAvatar({ shape, color, tin}}, [shape, fill, size, mood, dark, reduce])- return <canvas ref={canvas} aria-hidden style={{ width: size, height: size, display: 'block', flex: 'none', ...style }} />+ return <canvas ref={canvas} aria-hidden style={{ width: size, height: size, display: 'block', flex: 'none' }} />})/** Draws one frame of a character at the context's origin (views and menu bar icons). */@@ -221,7 +221,7 @@ export function BotAvatar({ bot, size = 40, animated = true }: { bot: Bot; size?*/export function GroupAvatar({ members, size = 40, animated = true }: { members: Bot[]; size?: number; animated?: boolean }) {const place = (bot: Bot, side: number, corner: CSSProperties) => (- <div key={bot.id} style={{ position: 'absolute', ...corner }}>+ <div key={bot.id} className="avatar-slot" style={corner}><BotAvatar bot={bot} size={side} animated={animated} /></div>)@@ -229,7 +229,7 @@ export function GroupAvatar({ members, size = 40, animated = true }: { members:switch (members.length) {case 0:content = (- <div style={{ display: 'grid', placeItems: 'center', width: '100%', height: '100%', color: 'var(--secondary)' }}>+ <div className="avatar-empty"><Icon name="person.2" size={size * 0.4} /></div>)@@ -255,42 +255,26 @@ export function GroupAvatar({ members, size = 40, animated = true }: { members:members.length === 4 ? (place(members[3]!, size * 0.5, { bottom: 0, right: 0 })) : (- <div- key="more"- style={{- position: 'absolute', right: 0, bottom: 0, width: size * 0.5, height: size * 0.5, display: 'grid', placeItems: 'center',- fontSize: size * 0.24, fontWeight: 700, color: 'var(--secondary)', fontFamily: 'ui-rounded, var(--font)',- }}- >+ <div key="more" className="avatar-more" style={{ width: size * 0.5, height: size * 0.5, fontSize: size * 0.24 }}>+{members.length - 3}</div>),]}- return <div aria-hidden style={{ position: 'relative', width: size, height: size, flex: 'none' }}>{content}</div>+ return <div aria-hidden className="avatar-frame" style={{ width: size, height: size }}>{content}</div>}/** Avatar with the roster status dot: filled = unread, amber = needs you. A group shows its members. */export function AvatarWithStatus({ bot, members = [], size = 44 }: { bot: Bot; members?: Bot[]; size?: number }) {return (- <div style={{ position: 'relative', width: size, height: size, flex: 'none' }}>+ <div className="avatar-frame" style={{ width: size, height: size }}>{isGroup(bot) ? <GroupAvatar members={members} size={size} /> : <BotAvatar bot={bot} size={size} />}{needsInput(bot) ? (- <div- style={{- position: 'absolute', right: 0, bottom: 0, width: size * 0.36, height: size * 0.36, borderRadius: '50%',- background: 'var(--warning)', boxShadow: '0 0 0 2px var(--background)', display: 'grid', placeItems: 'center', color: 'var(--on-warning)',- }}- >+ <div className="avatar-badge needs-you" style={{ width: size * 0.36, height: size * 0.36 }}><Icon name="exclamationmark" size={size * 0.2} weight="black" scaled={false} /></div>) : bot.unread > 0 ? (- <div- style={{- position: 'absolute', right: 0, bottom: 0, width: size * 0.28, height: size * 0.28, borderRadius: '50%',- background: 'var(--accent-fill)', boxShadow: '0 0 0 2px var(--background)',- }}- />+ <div className="avatar-badge unread" style={{ width: size * 0.28, height: size * 0.28 }} />) : null}</div>)diff --git a/apps/desktop/src/renderer/components/Controls.tsx b/apps/desktop/src/renderer/components/Controls.tsxindex 1ecc311a..0137e2ab 100644--- a/apps/desktop/src/renderer/components/Controls.tsx+++ b/apps/desktop/src/renderer/components/Controls.tsx@@ -1,7 +1,8 @@import { Children, Fragment, useRef, useState, type CSSProperties, type KeyboardEvent, type PointerEvent, type ReactNode } from 'react'-import { font } from '../lib/fonts'import { Icon } from './Icon'import { AnchoredMenu, IconButtonBase, type MenuItem } from './Overlay'+import { HStack, Spacer, VStack } from './Stack'+import { Text } from './Text'import './controls.css'// Codync's own controls (kit Controls.swift): never the stock ones.@@ -9,17 +10,16 @@ import './controls.css'export const IconButton = IconButtonBase/** The filled call-to-action (`.primary`) or the quieter filled one (`.secondary`). */-export function Button({ kind = 'primary', children, onClick, disabled, style, className, title }: {+export function Button({ kind = 'primary', children, onClick, disabled, className, title }: {kind?: 'primary' | 'secondary'children: ReactNodeonClick?: () => voiddisabled?: boolean- style?: CSSPropertiesclassName?: stringtitle?: string}) {return (- <button className={`styled-button ${kind} ${className ?? ''}`} onClick={onClick} disabled={disabled} style={style} title={title}>+ <button className={`styled-button ${kind} ${className ?? ''}`} onClick={onClick} disabled={disabled} title={title}>{children}</button>)@@ -39,9 +39,9 @@ export function Spinner({ size = 14 }: { size?: number }) {/** On/off switch: label on the left, a flat capsule track on the right. *//** `label` names a switch whose visible label sits outside it (beside an info button, say). */-export function Switch({ on, onChange, children, label, disabled, style }: { on: boolean; onChange: (on: boolean) => void; children?: ReactNode; label?: string; disabled?: boolean; style?: CSSProperties }) {+export function Switch({ on, onChange, children, label, disabled, className }: { on: boolean; onChange: (on: boolean) => void; children?: ReactNode; label?: string; disabled?: boolean; className?: string }) {return (- <button className="switch" role="switch" aria-checked={on} aria-label={label} disabled={disabled} onClick={() => onChange(!on)} style={style}>+ <button className={`switch${className ? ` ${className}` : ''}`} role="switch" aria-checked={on} aria-label={label} disabled={disabled} onClick={() => onChange(!on)}>{children !== undefined ? <span className="switch-label">{children}</span> : null}<span className={`switch-track ${on ? 'on' : ''}`}><span className="switch-knob" />@@ -78,8 +78,8 @@ export function ChoicePicker<T extends string | number>({ selection, options, onreturn (<DropdownMenutitle={label}- className={`choice-picker ${fill ? '' : 'outlined'}`}- style={{ background: fill, width: fits ? '100%' : undefined }}+ className={`choice-picker${fill ? '' : ' outlined'}${fits ? ' fits' : ''}`}+ style={{ background: fill }}items={() => options.map((o) => ({ title: o.label, leading: o.leading, selected: o.id === selection, action: () => onChange(o.id) }))}>{chosen?.leading}@@ -120,26 +120,26 @@ export function TabChoice<T extends string>({ label, selection, options, onChang/** A list of choices, one per row with a checkmark: the replacement for `.inline` pickers. */export function ChoiceList<T extends string>({ selection, options, onChange }: { selection: T; options: { id: T; label: string; detail?: string | null }[]; onChange: (id: T) => void }) {return (- <div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>+ <VStack gap={10}>{options.map((o) => (<button key={o.id} className="choice-row" onClick={() => onChange(o.id)}>- <div style={{ flex: 1, display: 'flex', flexDirection: 'column', gap: 2 }}>- <span style={{ color: 'var(--text)' }}>{o.label}</span>- {o.detail ? <span style={{ ...font('compactSecondary'), color: 'var(--secondary)' }}>{o.detail}</span> : null}- </div>- <span style={{ opacity: o.id === selection ? 1 : 0, display: 'flex' }}>+ <VStack gap={2} className="choice-row-label">+ <Text tone="text">{o.label}</Text>+ {o.detail ? <Text size="compactSecondary" tone="secondary">{o.detail}</Text> : null}+ </VStack>+ <span className={`check-slot${o.id === selection ? ' on' : ''}`}><Icon name="checkmark" size={10} weight="semibold" /></span></button>))}- </div>+ </VStack>)}/** A scrolling page of cards: the replacement for `Form` / grouped `List`. */-export function CardForm({ children, style }: { children: ReactNode; style?: CSSProperties }) {+export function CardForm({ children }: { children: ReactNode }) {return (- <div className="card-form" style={style}>+ <div className="card-form"><div className="card-form-content">{children}</div></div>)@@ -155,8 +155,8 @@ export function CardSection({ title, footer, accessory, children }: { title?: st<section className="card-section">{title || accessory ? (<div className="card-section-title">- {title ? <h3 style={{ ...font(13, 'semibold'), color: 'var(--text)' }}>{title}</h3> : null}- <span style={{ flex: 1 }} />+ {title ? <Text as="h3" size="body" weight="semibold" tone="text">{title}</Text> : null}+ <Spacer />{accessory}</div>) : null}@@ -173,21 +173,28 @@ export function CardSection({ title, footer, accessory, children }: { title?: st)}-/** A 1-pixel separator line in the border color. */-export function Hairline({ style }: { style?: CSSProperties }) {- return <div className="hairline" style={style} />+/** A 1-pixel separator line in the border color; `grow` makes it fill a row. */+export function Hairline({ grow = false, className, style }: { grow?: boolean; className?: string; style?: CSSProperties }) {+ return <div className={`hairline${grow ? ' grow' : ''}${className ? ` ${className}` : ''}`} style={style} />+}++/** A row's title with an optional note under it (rows, fields and switches share it). */+export function RowLabel({ label, detail, labelId, detailId, grow = false }: { label: ReactNode; detail?: string | null; labelId?: string; detailId?: string; grow?: boolean }) {+ return (+ <VStack as="span" gap={3} grow={grow} shrink>+ <Text id={labelId} tone="text">{label}</Text>+ {detail ? <span id={detailId} className="detail-note" title={detail}>{detail}</span> : null}+ </VStack>+ )}/** Label on the left, value on the right: the replacement for `LabeledContent`. */export function ValueRow({ label, detail, children }: { label: string; detail?: string | null; children?: ReactNode }) {return (<div className="value-row">- <div style={{ display: 'flex', flexDirection: 'column', gap: 3, minWidth: 0 }}>- <span style={{ color: 'var(--text)' }}>{label}</span>- {detail ? <span className="detail-note" title={detail} style={{ ...font('caption'), color: 'var(--secondary)', lineHeight: 1.35 }}>{detail}</span> : null}- </div>- <span style={{ flex: 1, minWidth: 12 }} />- <span style={{ color: 'var(--secondary)', display: 'flex', alignItems: 'center' }}>{children}</span>+ <RowLabel label={label} detail={detail} />+ <Spacer min={12} />+ <HStack as="span" className="value-row-value">{children}</HStack></div>)}@@ -210,32 +217,32 @@ export function SearchField({ value, onChange, prompt = 'Search', inputRef }: {/** A row that expands to show more: the replacement for `DisclosureGroup`. */export function Disclosure({ expanded, onToggle, label, children }: { expanded: boolean; onToggle: () => void; label: ReactNode; children: ReactNode }) {return (- <div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>+ <VStack gap={8}><button className="disclosure-label" onClick={onToggle} aria-expanded={expanded}>{label}- <span style={{ flex: 1, minWidth: 8 }} />- <span style={{ display: 'flex', transform: `rotate(${expanded ? 90 : 0}deg)`, transition: 'transform var(--layout)', color: 'var(--secondary)' }}>+ <Spacer min={8} />+ <span className={`disclosure-chevron${expanded ? ' open' : ''}`}><Icon name="chevron.right" size={10} weight="semibold" /></span></button>{expanded ? children : null}- </div>+ </VStack>)}/** A filled rounded value box, or outlined (outline or fill, never both). */-export function Pill({ children, fill = 'var(--background)', outlined = false, style }: { children: ReactNode; fill?: string; outlined?: boolean; style?: CSSProperties }) {+export function Pill({ children, fill = 'var(--background)', outlined = false, className }: { children: ReactNode; fill?: string; outlined?: boolean; className?: string }) {return (- <span className="pill" style={{ background: outlined ? 'transparent' : fill, boxShadow: outlined ? 'inset 0 0 0 1px var(--border)' : undefined, ...style }}>+ <span className={`pill${outlined ? ' outlined' : ''}${className ? ` ${className}` : ''}`} style={{ background: outlined ? undefined : fill }}>{children}</span>)}/** Determinate progress (`value` 0...1): a thin capsule track that fills from the left. */-export function ProgressBar({ value, label, fill, style }: { value: number; label: string; fill?: string; style?: CSSProperties }) {+export function ProgressBar({ value, label, fill, className }: { value: number; label: string; fill?: string; className?: string }) {return (- <div className="progress-track" role="progressbar" aria-label={label} aria-valuemin={0} aria-valuemax={100} aria-valuenow={Math.round(value * 100)} style={style}>+ <div className={`progress-track${className ? ` ${className}` : ''}`} role="progressbar" aria-label={label} aria-valuemin={0} aria-valuemax={100} aria-valuenow={Math.round(value * 100)}><div className="progress-fill" style={{ transform: `scaleX(${value})`, background: fill }} /></div>)diff --git a/apps/desktop/src/renderer/components/Overlay.tsx b/apps/desktop/src/renderer/components/Overlay.tsxindex ef8d5b77..cdbbff8c 100644--- a/apps/desktop/src/renderer/components/Overlay.tsx+++ b/apps/desktop/src/renderer/components/Overlay.tsx@@ -1,8 +1,9 @@import { createContext, useContext, useEffect, useId, useLayoutEffect, useRef, useState, type ReactNode, type RefObject } from 'react'import { createPortal } from 'react-dom'-import { font } from '../lib/fonts'import { reduceMotion } from '../lib/theme'import { Icon } from './Icon'+import { HStack, VStack } from './Stack'+import { Text } from './Text'import './overlay.css'/** Keeps a layer mounted while it animates away; `shown` drives the CSS transition. */@@ -38,7 +39,7 @@ export const useDismiss = () => useContext(DismissContext)/** Stack depth: only the top layer takes Escape. */const stack: number[] = []let nextLayer = 0-function useEscape(active: boolean, onEscape: () => void) {+export function useEscape(active: boolean, onEscape: () => void) {const handler = useRef(onEscape)handler.current = onEscapeuseEffect(() => {@@ -122,7 +123,7 @@ export function Sheet({ open, onClose, width, height, dismissOnDim = false, chil<ModalTitleContext.Provider value={titleId}><div ref={layer} className={`modal-card ${shown ? 'shown' : ''}`} role="dialog" aria-modal aria-labelledby={titleId}><div className="modal-dim" onClick={dismissOnDim ? onClose : undefined} />- <div className="modal-content" data-modal-card tabIndex={-1} style={{ width, height, maxWidth: 'calc(100vw - 48px)', maxHeight: 'calc(100vh - 48px)' }}>+ <div className="modal-content" data-modal-card tabIndex={-1} style={{ width, height }}>{open ? children : last.current}</div></div>@@ -161,8 +162,8 @@ export function Dialog({ open, title, message, actions, cancel = 'Cancel', onClo<div className="dialog-dim" onClick={() => cancel !== null && onClose()} /><div className="dialog-card" data-modal-card tabIndex={-1}><div className="dialog-text">- <h2 id={`${id}-title`} style={font('headline')}>{shownContent.title}</h2>- {shownContent.message ? <div id={`${id}-message`} style={{ ...font('compactSecondary'), color: 'var(--secondary)' }}>{shownContent.message}</div> : null}+ <Text as="h2" id={`${id}-title`} size="headline">{shownContent.title}</Text>+ {shownContent.message ? <Text as="div" id={`${id}-message`} size="compactSecondary" tone="secondary">{shownContent.message}</Text> : null}</div><div className="dialog-buttons">{shownContent.actions.map((a) => (@@ -210,7 +211,7 @@ export interface ReactionPick {export function ReactionStrip({ pick, dismiss, size = 26 }: { pick: ReactionPick; dismiss?: () => void; size?: number }) {return (- <div style={{ display: 'flex' }}>+ <HStack align="stretch">{pick.emoji.map((emoji) => {const chosen = pick.chosen.includes(emoji)return (@@ -225,11 +226,11 @@ export function ReactionStrip({ pick, dismiss, size = 26 }: { pick: ReactionPickpick.toggle(emoji)}}>- <span style={font(14)}>{emoji}</span>+ <Text size={14}>{emoji}</Text></button>)})}- </div>+ </HStack>)}@@ -253,7 +254,7 @@ export function MenuPanel({ items, reactions, dismiss, maxHeight }: { items: Menreturn (<div className="menu-panel" role="menu" style={{ maxHeight }}>{reactions ? (- <div style={{ paddingBottom: items.length ? 4 : 0 }}>+ <div className={items.length ? 'menu-reactions' : undefined}><ReactionStrip pick={reactions} dismiss={dismiss} /></div>) : null}@@ -278,7 +279,7 @@ export function MenuPanel({ items, reactions, dismiss, maxHeight }: { items: Men) : null}<span className="menu-title">{item.title}</span>{item.selected !== undefined ? (- <span style={{ opacity: item.selected ? 1 : 0, display: 'flex' }}>+ <span className={`check-slot${item.selected ? ' on' : ''}`}><Icon name="checkmark" size={10} weight="semibold" /></span>) : null}@@ -289,6 +290,27 @@ export function MenuPanel({ items, reactions, dismiss, maxHeight }: { items: Men)}+/**+ * Where a panel opens beside `rect`: below it or above (whichever has more room), aligned to the+ * anchor's leading or trailing edge and kept on screen. `room` is the height available.+ */+export function anchorPlacement(rect: DOMRect) {+ const W = window.innerWidth+ const H = window.innerHeight+ const roomBelow = Math.max(0, H - rect.bottom - 14)+ const roomAbove = Math.max(0, rect.top - 14)+ const below = roomBelow >= roomAbove+ const leading = rect.left + rect.width / 2 < W * 0.6+ const width = Math.min(320, W - 16)+ const inset = Math.max(8, W - width - 8)+ const style: React.CSSProperties = {+ [below ? 'top' : 'bottom']: below ? rect.bottom + 6 : H - rect.top + 6,+ ...(leading ? { left: Math.min(Math.max(8, rect.left), inset) } : { right: Math.min(Math.max(8, W - rect.right), inset) }),+ transformOrigin: `${below ? 'top' : 'bottom'} ${leading ? 'left' : 'right'}`,+ }+ return { style, width, room: below ? roomBelow : roomAbove }+}+/*** Presents `MenuPanel` next to `anchor` (or at `point`, for right-clicks), flipping to stay on* screen; a click anywhere else closes it (`.codyncMenu` / `.contextActions`).@@ -312,25 +334,11 @@ export function AnchoredMenu({ open, onClose, anchor, point, items, reactions }:}, [open, point, anchor])useEscape(open, onClose)if (!mounted || !rect) return null- const W = window.innerWidth- const H = window.innerHeight- const roomBelow = Math.max(0, H - rect.bottom - 14)- const roomAbove = Math.max(0, rect.top - 14)- const below = roomBelow >= roomAbove- const leading = rect.left + rect.width / 2 < W * 0.6- const width = Math.min(320, W - 16)- const inset = Math.max(8, W - width - 8)- const style: React.CSSProperties = {- position: 'absolute',- [below ? 'top' : 'bottom']: below ? rect.bottom + 6 : H - rect.top + 6,- ...(leading ? { left: Math.min(Math.max(8, rect.left), inset) } : { right: Math.min(Math.max(8, W - rect.right), inset) }),- maxWidth: width,- transformOrigin: `${below ? 'top' : 'bottom'} ${leading ? 'left' : 'right'}`,- }+ const { style, width, room } = anchorPlacement(rect)return createPortal(<div className={`anchored ${shown ? 'shown' : ''}`} onMouseDown={(e) => e.target === e.currentTarget && onClose()} onContextMenu={(e) => { e.preventDefault(); onClose() }}>- <div className="anchored-panel" style={style}>- <MenuPanel items={frozen.current} reactions={reactions} dismiss={onClose} maxHeight={Math.min(420, below ? roomBelow : roomAbove)} />+ <div className="anchored-panel" style={{ ...style, maxWidth: width }}>+ <MenuPanel items={frozen.current} reactions={reactions} dismiss={onClose} maxHeight={Math.min(420, room)} /></div></div>,document.body,@@ -352,14 +360,30 @@ export function useContextMenu() {}}-/** A modal's title row: title, optional trailing actions, and a close button. */-export function ModalHeader({ title, trailing }: { title: ReactNode; trailing?: ReactNode }) {+/** A sheet's content: a full-height column on the page color, usually a ModalHeader and a body. */+export function SheetPage({ className, children }: { className?: string; children: ReactNode }) {+ return <div className={`sheet-page${className ? ` ${className}` : ''}`}>{children}</div>+}++/**+ * A modal's title row: title (and a line under it), optional trailing actions, and a close+ * button that dismisses the modal, or calls `onClose` for a panel that isn't one.+ */+export function ModalHeader({ title, subtitle, trailing, onClose, closeTitle = 'Close' }: { title: ReactNode; subtitle?: ReactNode; trailing?: ReactNode; onClose?: () => void; closeTitle?: string }) {const dismiss = useDismiss()+ const titleId = useContext(ModalTitleContext)return (<div className="modal-header">- <h2 id={useContext(ModalTitleContext)} style={{ ...font('compactBody', 'semibold'), flex: 1, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{title}</h2>+ {subtitle !== undefined ? (+ <VStack grow>+ <Text as="h2" id={titleId} size="compactBody" weight="semibold" tone="text">{title}</Text>+ <Text size="caption" tone="tertiary" truncate>{subtitle}</Text>+ </VStack>+ ) : (+ <Text as="h2" id={titleId} size="compactBody" weight="semibold" truncate className="modal-title">{title}</Text>+ )}{trailing}- <IconButtonBase title="Close" icon="xmark" onClick={dismiss} />+ <IconButtonBase title={closeTitle} icon="xmark" onClick={onClose ?? dismiss} /></div>)}diff --git a/apps/desktop/src/renderer/components/Stack.tsx b/apps/desktop/src/renderer/components/Stack.tsxnew file mode 100644index 00000000..a26afd79--- /dev/null+++ b/apps/desktop/src/renderer/components/Stack.tsx@@ -0,0 +1,55 @@+import type { ComponentPropsWithoutRef, CSSProperties, ReactNode } from 'react'+import type { Tone } from './Text'++type StackProps = {+ as?: 'div' | 'span'+ gap?: number+ align?: CSSProperties['alignItems']+ justify?: CSSProperties['justifyContent']+ wrap?: boolean+ /** Takes the free space along the parent stack (and may shrink below its content). */+ grow?: boolean+ /** May shrink below its content inside the parent stack, so long text inside can truncate. */+ shrink?: boolean+ className?: string+ style?: CSSProperties+ children?: ReactNode+} & Omit<ComponentPropsWithoutRef<'div'>, 'className' | 'style' | 'children'>++function Stack({ direction, as = 'div', gap, align, justify, wrap = false, grow = false, shrink = false, className, style, children, ...rest }: StackProps & { direction: 'row' | 'column' }) {+ // The element only changes the tag; the props are a div's either way.+ const Tag = as as 'div'+ return (+ <Tag+ className={`${direction === 'row' ? 'hstack' : 'vstack'}${className ? ` ${className}` : ''}`}+ style={{ gap, alignItems: align, justifyContent: justify, flexWrap: wrap ? 'wrap' : undefined, flex: grow ? 1 : undefined, minWidth: grow || shrink ? 0 : undefined, ...style }}+ {...rest}+ >+ {children}+ </Tag>+ )+}++/** Children side by side, centered vertically unless `align` says otherwise (SwiftUI's `HStack`). */+export function HStack({ align = 'center', ...props }: StackProps) {+ return <Stack direction="row" align={align} {...props} />+}++/** Children top to bottom, stretched across (SwiftUI's `VStack`). */+export function VStack(props: StackProps) {+ return <Stack direction="column" {...props} />+}++/** Pushes its neighbors apart in a stack, keeping at least `min` between them (SwiftUI's `Spacer`). */+export function Spacer({ min }: { min?: number }) {+ return <span className="spacer" style={min ? { minWidth: min, minHeight: min } : undefined} />+}++/** A fixed-width column that centers an icon, so the labels beside it line up (`width` in points). */+export function IconSlot({ width, tone, className, children, ...rest }: { width: number; tone?: Tone; className?: string; children: ReactNode } & Omit<ComponentPropsWithoutRef<'span'>, 'className' | 'children'>) {+ return (+ <HStack as="span" align="stretch" justify="center" className={`icon-slot${className ? ` ${className}` : ''}`} style={{ width, color: tone && `var(--${tone})` }} {...rest}>+ {children}+ </HStack>+ )+}diff --git a/apps/desktop/src/renderer/components/Text.tsx b/apps/desktop/src/renderer/components/Text.tsxnew file mode 100644index 00000000..d8b4936e--- /dev/null+++ b/apps/desktop/src/renderer/components/Text.tsx@@ -0,0 +1,35 @@+import type { ComponentPropsWithoutRef, CSSProperties, ReactNode } from 'react'+import { font, weights, type TextStyleName, type Weight } from '../lib/fonts'++/** The color tokens text takes (styles/theme.css). */+export type Tone = 'text' | 'secondary' | 'tertiary' | 'danger' | 'attention' | 'accent' | 'added' | 'removed'++/**+ * A run of text in a type style and tone (kit's `.appFont` + `.foregroundStyle`). Without `size`+ * it keeps the surrounding size; `truncate` ends one line with an ellipsis, `lines` clamps to n,+ * `grow` takes a stack's free space like `HStack grow`, `tabular` lines digits up.+ */+export function Text({ as = 'span', size, weight, mono = false, tone, truncate = false, lines, grow = false, tabular = false, className, style, children, ...rest }: {+ as?: 'span' | 'div' | 'h2' | 'h3'+ size?: TextStyleName | number+ weight?: Weight+ mono?: boolean+ tone?: Tone+ truncate?: boolean+ lines?: number+ grow?: boolean+ tabular?: boolean+ className?: string+ style?: CSSProperties+ children?: ReactNode+} & Omit<ComponentPropsWithoutRef<'span'>, 'className' | 'style' | 'children'>) {+ const type = size !== undefined ? font(size, weight, mono) : { fontWeight: weight && weights[weight], fontFamily: mono ? 'var(--mono)' : undefined }+ // The element only changes the tag; the props are a span's either way.+ const Tag = as as 'span'+ const classes = [truncate ? 'truncate' : '', lines ? 'line-clamp' : '', className ?? ''].filter(Boolean).join(' ')+ return (+ <Tag className={classes || undefined} style={{ ...type, color: tone && `var(--${tone})`, WebkitLineClamp: lines, ...(grow ? { flex: 1, minWidth: 0 } : {}), fontVariantNumeric: tabular ? 'tabular-nums' : undefined, ...style }} {...rest}>+ {children}+ </Tag>+ )+}diff --git a/apps/desktop/src/renderer/components/avatar.css b/apps/desktop/src/renderer/components/avatar.cssnew file mode 100644index 00000000..e1b1508b--- /dev/null+++ b/apps/desktop/src/renderer/components/avatar.css@@ -0,0 +1,42 @@+/* Character avatars: a group's cluster and the roster's status badge (Avatar.tsx); sizes follow+ the avatar's size inline. */+.avatar-frame {+ position: relative;+ flex: none;+}+.avatar-slot {+ position: absolute;+}+.avatar-empty {+ display: grid;+ place-items: center;+ width: 100%;+ height: 100%;+ color: var(--secondary);+}+.avatar-more {+ position: absolute;+ right: 0;+ bottom: 0;+ display: grid;+ place-items: center;+ font-family: ui-rounded, var(--font);+ font-weight: 700;+ color: var(--secondary);+}+.avatar-badge {+ position: absolute;+ right: 0;+ bottom: 0;+ border-radius: 50%;+ box-shadow: 0 0 0 2px var(--background);+}+.avatar-badge.needs-you {+ display: grid;+ place-items: center;+ background: var(--warning);+ color: var(--on-warning);+}+.avatar-badge.unread {+ background: var(--accent-fill);+}diff --git a/apps/desktop/src/renderer/components/controls.css b/apps/desktop/src/renderer/components/controls.cssindex e4ebe405..7986e24c 100644--- a/apps/desktop/src/renderer/components/controls.css+++ b/apps/desktop/src/renderer/components/controls.css@@ -1,5 +1,5 @@.styled-button {- font-size: calc(12px * var(--scale));+ font-size: var(--text-callout);font-weight: 500;padding: 6px 12px;border-radius: var(--radius-pill);@@ -84,7 +84,7 @@display: inline-flex;align-items: center;gap: 6px;- font-size: calc(12px * var(--scale));+ font-size: var(--text-callout);color: var(--text);padding: 5px 9px;border-radius: var(--radius-s);@@ -93,6 +93,9 @@.choice-picker.outlined {box-shadow: inset 0 0 0 1px var(--border);}+.choice-picker.fits {+ width: 100%;+}.choice-label {white-space: nowrap;overflow: hidden;@@ -122,7 +125,7 @@position: relative;flex: 1;text-align: center;- font-size: calc(11px * var(--scale));+ font-size: var(--text-caption);font-weight: 500;color: var(--secondary);padding: 5px 0;@@ -147,7 +150,7 @@height: calc(24px * var(--scale));padding: 0 calc(10px * var(--scale));border-radius: var(--radius-pill);- font-size: calc(13px * var(--scale));+ font-size: var(--text-body);color: var(--secondary);white-space: nowrap;transition: background-color var(--hover), color var(--hover);@@ -166,6 +169,17 @@gap: 10px;width: 100%;}+.choice-row-label {+ flex: 1;+}+/* The checkmark beside a choice: its space is kept when it's off. */+.check-slot {+ display: flex;+ opacity: 0;+}+.check-slot.on {+ opacity: 1;+}.card-form {height: 100%;@@ -177,7 +191,7 @@flex-direction: column;gap: 28px;padding: 14px;- font-size: calc(12px * var(--scale));+ font-size: var(--text-callout);}.card-section {@@ -210,7 +224,7 @@min-width: 0;}.card-section-footer {- font-size: calc(11px * var(--scale));+ font-size: var(--text-caption);color: var(--secondary);line-height: 1.4;padding: 0 2px;@@ -226,6 +240,9 @@height: 0.5px;}}+.hairline.grow {+ flex: 1;+}.hairline.inset {margin: 0 16px;}@@ -235,6 +252,15 @@align-items: center;width: 100%;}+.value-row-value {+ color: var(--secondary);+}+/* A row's note under its title (RowLabel). */+.detail-note {+ font-size: var(--text-caption);+ color: var(--secondary);+ line-height: 1.35;+}.search-field {display: flex;@@ -243,7 +269,7 @@padding: 7px 10px;background: var(--bubble-agent);border-radius: var(--radius-pill);- font-size: calc(12px * var(--scale));+ font-size: var(--text-callout);}.search-field input {flex: 1;@@ -287,6 +313,14 @@gap: 6px;width: 100%;}+.disclosure-chevron {+ display: flex;+ color: var(--secondary);+ transition: transform var(--layout);+}+.disclosure-chevron.open {+ transform: rotate(90deg);+}.pill {display: inline-flex;@@ -294,6 +328,9 @@padding: 5px 9px;border-radius: var(--radius-s);}+.pill.outlined {+ box-shadow: inset 0 0 0 1px var(--border);+}.progress-track {width: 100%;diff --git a/apps/desktop/src/renderer/components/overlay.css b/apps/desktop/src/renderer/components/overlay.cssindex ac9ed41d..4c8905a4 100644--- a/apps/desktop/src/renderer/components/overlay.css+++ b/apps/desktop/src/renderer/components/overlay.css@@ -15,6 +15,8 @@}.modal-content {position: relative;+ max-width: calc(100vw - 48px);+ max-height: calc(100vh - 48px);background: var(--background);border-radius: var(--radius-xl);overflow: hidden;@@ -47,6 +49,9 @@padding: 0 10px 0 16px;flex: none;}+.modal-title {+ flex: 1;+}/* Sheets, dialogs and menus: one subtle outline over the fill. */.modal-content::after,@@ -112,7 +117,7 @@gap: 8px;}.dialog-button {- font-size: calc(12px * var(--scale));+ font-size: var(--text-callout);font-weight: 500;text-align: center;padding: 8px 0;@@ -125,6 +130,14 @@background: var(--accent-fill);color: var(--on-accent);}+/* A sheet's content: a full-height column on the page color (SheetPage). */+.sheet-page {+ display: flex;+ flex-direction: column;+ height: 100%;+ background: var(--background);+}+[data-modal-card]:focus {outline: none;}@@ -158,6 +171,7 @@opacity: 1;}.anchored-panel {+ position: absolute;background: var(--bubble-agent);border-radius: var(--radius-l);box-shadow: var(--shadow-l);@@ -168,6 +182,10 @@.anchored.shown .anchored-panel {transform: none;}+/* Quick reactions above a message's menu rows. */+.menu-reactions {+ padding-bottom: 4px;+}.menu-panel {padding: 6px;display: flex;@@ -187,7 +205,7 @@width: 100%;padding: 6px 10px;border-radius: var(--radius-s);- font-size: calc(12px * var(--scale));+ font-size: var(--text-callout);color: var(--text);transition: background-color var(--hover);}diff --git a/apps/desktop/src/renderer/lib/fonts.ts b/apps/desktop/src/renderer/lib/fonts.tsindex 9557e47a..13ce68fd 100644--- a/apps/desktop/src/renderer/lib/fonts.ts+++ b/apps/desktop/src/renderer/lib/fonts.ts@@ -1,40 +1,39 @@import type { CSSProperties } from 'react'-// macOS text styles in points (NSFont.preferredFont), scaled by the app's text size preference-// like kit's `AppFont`.-export const TextStyle = {- largeTitle: 26,- title: 22,- title2: 17,- title3: 15,- headline: 13,- body: 13,- callout: 12,- subheadline: 11,+// macOS text styles (NSFont.preferredFont) mapped onto the type ramp in styles/theme.css, which+// scales with the app's text size preference like kit's `AppFont`.+const TextStyle = {+ largeTitle: 'large-title',+ title: 'title',+ title2: 'title2',+ title3: 'title3',+ headline: 'body',+ body: 'body',+ callout: 'callout',+ subheadline: 'caption',// macOS draws these at 10; 11 is the floor for text people read or click.- footnote: 11,- caption: 11,- caption2: 11,- /** Codync's compact desktop body (12) and secondary (11). */- compactBody: 12,- compactSecondary: 11,+ footnote: 'caption',+ caption: 'caption',+ caption2: 'caption',+ /** Codync's compact desktop body and secondary text. */+ compactBody: 'callout',+ compactSecondary: 'caption',} as constexport type TextStyleName = keyof typeof TextStyle/** `calc(<pt>px * var(--scale))` */-export const px = (size: number) => `calc(${size}px * var(--scale))`+const px = (size: number) => `calc(${size}px * var(--scale))`-type Weight = 'regular' | 'medium' | 'semibold' | 'bold' | 'black' | 'light'-const weights: Record<Weight, number> = { light: 300, regular: 400, medium: 500, semibold: 600, bold: 700, black: 900 }+export type Weight = 'regular' | 'medium' | 'semibold' | 'bold' | 'black' | 'light'+export const weights: Record<Weight, number> = { light: 300, regular: 400, medium: 500, semibold: 600, bold: 700, black: 900 }-/** `.appFont(...)`: a text style name or a point size, with weight and design. */-export function font(style: TextStyleName | number, weight?: Weight, design?: 'monospaced' | 'rounded'): CSSProperties {- const size = typeof style === 'number' ? style : TextStyle[style]+/** `.appFont(...)`: a text style name or a point size, with weight, optionally monospaced. */+export function font(style: TextStyleName | number, weight?: Weight, mono = false): CSSProperties {const w = weight ?? (style === 'headline' ? 'bold' : 'regular')return {- fontSize: px(size),+ fontSize: typeof style === 'number' ? px(style) : `var(--text-${TextStyle[style]})`,fontWeight: weights[w],- ...(design === 'monospaced' ? { fontFamily: 'var(--mono)' } : design === 'rounded' ? { fontFamily: 'ui-rounded, var(--font)' } : {}),+ ...(mono ? { fontFamily: 'var(--mono)' } : {}),}}diff --git a/apps/desktop/src/renderer/styles/theme.css b/apps/desktop/src/renderer/styles/theme.cssindex 3d8738d1..42eb7ce3 100644--- a/apps/desktop/src/renderer/styles/theme.css+++ b/apps/desktop/src/renderer/styles/theme.css@@ -76,6 +76,19 @@--mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, 'DejaVu Sans Mono', monospace;}+/* The type ramp (lib/fonts.ts maps the macOS style names onto it). It is declared again wherever+ --scale is reset (the island stays at the default size), so it resolves against that scale. */+:root,+.island {+ --text-large-title: calc(26px * var(--scale));+ --text-title: calc(22px * var(--scale));+ --text-title2: calc(17px * var(--scale));+ --text-title3: calc(15px * var(--scale));+ --text-body: calc(13px * var(--scale));+ --text-callout: calc(12px * var(--scale));+ --text-caption: calc(11px * var(--scale));+}+@media (prefers-color-scheme: dark) {:root {--background: #070707;@@ -202,7 +215,33 @@ a {color: inherit;}-/* Headings carry structure; each sets its own type with font(). */+/* Layout and text primitives (components/Stack.tsx, Text.tsx). */+.hstack {+ display: flex;+}+.vstack {+ display: flex;+ flex-direction: column;+}+.spacer {+ flex: 1;+}+.icon-slot {+ flex: none;+}+.truncate {+ min-width: 0;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+}+.line-clamp {+ display: -webkit-box;+ -webkit-box-orient: vertical;+ overflow: hidden;+}++/* Headings carry structure; each sets its own type with Text. */h1,h2,h3 {diff --git a/apps/desktop/src/renderer/views/AccountWelcomeView.tsx b/apps/desktop/src/renderer/views/AccountWelcomeView.tsxindex e6f522b6..b7c1c3d2 100644--- a/apps/desktop/src/renderer/views/AccountWelcomeView.tsx+++ b/apps/desktop/src/renderer/views/AccountWelcomeView.tsx@@ -2,10 +2,12 @@ import { useEffect, useState, type CSSProperties } from 'react'import { CharacterAvatar, type Mood } from '../components/Avatar'import { Button, Spinner } from '../components/Controls'import { Icon } from '../components/Icon'-import { font } from '../lib/fonts'+import { HStack, Spacer, VStack } from '../components/Stack'+import { Text } from '../components/Text'import { useReduceMotion } from '../lib/theme'import { useAccount } from '../store/account'import googleLogo from '../assets/google.svg'+import './account-welcome.css'const deviceName = window.codync.platform === 'darwin' ? 'Mac' : 'computer'@@ -28,13 +30,13 @@ export function AccountWelcomeView({ onContinue }: { onContinue: () => void }) {if (!account.isReady) {// Keep first-run sign-in choices behind the persisted-session restore on launch.return (- <div style={{ height: '100%', display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 14 }}>+ <VStack align="center" justify="center" gap={14} className="welcome-restoring"><Spinner size={24} />- <div style={{ ...font('callout'), color: 'var(--secondary)' }}>Checking for a saved account…</div>- <button style={{ color: 'var(--secondary)' }} onClick={onContinue}>+ <Text as="div" size="callout" tone="secondary">Checking for a saved account…</Text>+ <button className="welcome-skip" onClick={onContinue}>Continue on this {deviceName}</button>- </div>+ </VStack>)}@@ -45,53 +47,53 @@ export function AccountWelcomeView({ onContinue }: { onContinue: () => void }) {})return (- <div style={{ height: '100%', overflowY: 'auto', background: 'var(--background)' }}>- <div style={{ minHeight: '100%', maxWidth: 480, margin: '0 auto', display: 'flex', flexDirection: 'column', padding: '0 24px 12px' }}>- <div style={{ flex: 1, minHeight: 24 }} />+ <div className="welcome">+ <VStack className="welcome-column">+ <Spacer min={24} /><WelcomeCrew shown={beat >= 1} />- <div style={{ flex: 1, minHeight: 24 }} />- <div style={{ paddingBottom: 24 }}>+ <Spacer min={24} />+ <div className="welcome-glimpse"><WelcomeChatGlimpse shown={beat >= 2} /></div>- <div style={{ display: 'flex', flexDirection: 'column', gap: 10, ...rise(beat >= 3) }}>- <div style={{ fontSize: 34, fontWeight: 600, letterSpacing: -0.6, color: 'var(--text)', lineHeight: 1.15 }}>+ <VStack gap={10} style={rise(beat >= 3)}>+ <div className="welcome-title">Your coding agents,<br />as teammates.</div>- <div style={{ ...font('body'), color: 'var(--secondary)' }}>Give each one a name and a project. They work on your computer while you're away.</div>- </div>- <div style={{ flex: 1, minHeight: 32 }} />- <div style={{ display: 'flex', flexDirection: 'column', gap: 10, ...rise(beat >= 4) }}>- <Button onClick={onContinue} style={{ ...font('headline'), minHeight: 50, width: '100%' }}>+ <Text as="div" size="body" tone="secondary">Give each one a name and a project. They work on your computer while you're away.</Text>+ </VStack>+ <Spacer min={32} />+ <VStack gap={10} style={rise(beat >= 4)}>+ <Button onClick={onContinue} className="welcome-button">Continue on this {deviceName}</Button>- <Button onClick={() => void account.signIn('apple')} disabled={!account.isConfigured || account.isBusy} style={{ ...font('headline'), minHeight: 50, width: '100%' }}>+ <Button onClick={() => void account.signIn('apple')} disabled={!account.isConfigured || account.isBusy} className="welcome-button">{account.isBusy ? (<Spinner size={18} />) : (- <span style={{ display: 'flex', alignItems: 'center', gap: 10 }}>+ <HStack as="span" gap={10}><Icon name="apple.logo" size={20} />Continue with Apple- </span>+ </HStack>)}</Button>- <Button kind="secondary" onClick={() => void account.signIn('google')} disabled={!account.isConfigured || account.isBusy} style={{ ...font('headline'), minHeight: 50, width: '100%' }}>+ <Button kind="secondary" onClick={() => void account.signIn('google')} disabled={!account.isConfigured || account.isBusy} className="welcome-button">{account.isBusy ? (<Spinner size={18} />) : (- <span style={{ display: 'flex', alignItems: 'center', gap: 10 }}>+ <HStack as="span" gap={10}><img src={googleLogo} alt="" width={20} height={20} />Continue with Google- </span>+ </HStack>)}</Button>{!account.isConfigured ? (- <div style={{ ...font('footnote'), color: 'var(--tertiary)' }}>Sign-in isn't configured in this build. You can still use Codync on this {deviceName}.</div>+ <Text as="div" size="footnote" tone="tertiary">Sign-in isn't configured in this build. You can still use Codync on this {deviceName}.</Text>) : null}- {account.errorMessage ? <div style={{ ...font('footnote'), color: 'var(--attention)' }}>{account.errorMessage}</div> : null}- </div>- </div>+ {account.errorMessage ? <Text as="div" size="footnote" tone="attention">{account.errorMessage}</Text> : null}+ </VStack>+ </VStack></div>)}@@ -119,12 +121,12 @@ function WelcomeCrew({ shown }: { shown: boolean }) {return () => cancelAnimationFrame(frame)}, [reduce, shown])return (- <div aria-hidden style={{ position: 'relative', height: 170 }}>+ <div aria-hidden className="welcome-crew">{crew.map((m, i) => (<divkey={m.shape}+ className="welcome-crew-member"style={{- position: 'absolute', left: '50%', top: '50%',transform: `translate(calc(-50% + ${m.x}px), calc(-50% + ${m.y + (reduce ? 0 : Math.sin(t * 1.3 + i * 1.7) * 5)}px)) scale(${shown ? 1 : 0.3})`,opacity: shown ? 1 : 0,transition: `opacity 0.7s var(--ease-out) ${i * 0.07}s, scale 0.7s var(--ease-out) ${i * 0.07}s`,@@ -148,21 +150,20 @@ function WelcomeChatGlimpse({ shown }: { shown: boolean }) {}, [shown, reduce])const rise: CSSProperties = { opacity: shown ? 1 : 0, transform: shown ? 'none' : 'translateY(14px)', transition: 'opacity 0.6s, transform 0.6s var(--ease-out)' }return (- <div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>- <div style={{ display: 'flex', justifyContent: 'flex-end', ...rise }}>- <span style={{ ...font('subheadline'), color: 'var(--text)', padding: '9px 14px', background: 'var(--bubble-user)', borderRadius: 18 }}>Fix the flaky login test</span>- </div>- <div style={{ display: 'flex', alignItems: 'flex-end', gap: 8, ...rise }}>+ <VStack gap={10}>+ <HStack align="stretch" justify="flex-end" style={rise}>+ <Text size="subheadline" tone="text" className="welcome-bubble user">Fix the flaky login test</Text>+ </HStack>+ <HStack align="flex-end" gap={8} style={rise}><CharacterAvatar shape="blob" color="blue" size={28} mood={replied ? 'idle' : 'working'} />{replied ? (- <span style={{ ...font('subheadline'), color: 'var(--text)', padding: '9px 14px', background: 'var(--bubble-agent)', borderRadius: 18, animation: 'bubble-in 0.45s var(--ease-out) both', transformOrigin: 'bottom left' }}>+ <Text size="subheadline" tone="text" className="welcome-bubble agent">Done. It raced the session refresh; tests pass on fix/login.- </span>+ </Text>) : (- <span style={{ ...font('subheadline'), color: 'var(--tertiary)' }}>Working…</span>+ <Text size="subheadline" tone="tertiary">Working…</Text>)}- </div>- <style>{'@keyframes bubble-in { from { opacity: 0; transform: scale(0.92) } }'}</style>- </div>+ </HStack>+ </VStack>)}diff --git a/apps/desktop/src/renderer/views/BotRow.tsx b/apps/desktop/src/renderer/views/BotRow.tsxindex 75fbf572..74f9f51a 100644--- a/apps/desktop/src/renderer/views/BotRow.tsx+++ b/apps/desktop/src/renderer/views/BotRow.tsx@@ -2,69 +2,52 @@ import { memo } from 'react'import { folderName, isGroup, isWorking, needsInput, type Bot } from '@shared/models'import { AvatarWithStatus } from '../components/Avatar'import { Icon } from '../components/Icon'+import { HStack, VStack } from '../components/Stack'+import { Text } from '../components/Text'import { ThinkingOrb } from '../components/ThinkingOrb'-import { font } from '../lib/fonts'import { messagePreview } from '../lib/message-preview'import type { BotStore } from '../store/bot-store'/** A roster row: avatar with status, name, and the live activity or last message (Grok Bot's desktop sidebar). */export const BotRow = memo(function BotRow({ bot, store, compact, usingComputer, members }: { bot: Bot; store: BotStore; compact: boolean; usingComputer: boolean; members: Bot[] }) {return (- <div style={{ display: 'flex', alignItems: 'center', gap: compact ? 0 : 10, padding: '9px 0', width: '100%', justifyContent: compact ? 'center' : 'flex-start' }}>+ <HStack gap={compact ? 0 : 10} justify={compact ? 'center' : 'flex-start'} className="bot-row"><AvatarWithStatus bot={bot} members={members} size={30} />- <div- aria-hidden={compact}- style={{- display: 'flex', flexDirection: 'column', gap: 2, lineHeight: 'calc(16px * var(--scale))', minWidth: 0, overflow: 'hidden',- width: compact ? 0 : undefined, flex: compact ? 'none' : 1, opacity: compact ? 0 : 1,- transition: 'opacity var(--layout)',- }}- >- <div style={{ display: 'flex', alignItems: 'baseline', gap: 4, minWidth: 0 }}>+ <VStack gap={2} className={`bot-row-text ${compact ? 'collapsed' : ''}`} aria-hidden={compact}>+ <HStack align="baseline" gap={4} shrink>{bot.pinned ? <Icon name="pin.fill" size={10} color="var(--tertiary)" /> : null}- <span style={{ ...font('body', bot.unread > 0 ? 'semibold' : 'medium'), color: 'var(--text)', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{bot.name}</span>+ <Text size="body" weight={bot.unread > 0 ? 'semibold' : 'medium'} tone="text" truncate>{bot.name}</Text>{usingComputer ? <Icon name="cursorarrow.motionlines" size={10} color="var(--accent)" title="Using the computer" /> : null}- </div>- <div style={{ display: 'flex', alignItems: 'center', gap: 6, minWidth: 0 }}>- <div style={{ flex: 1, minWidth: 0, display: 'flex' }}>+ </HStack>+ <HStack gap={6} shrink>+ <HStack align="stretch" grow><Preview bot={bot} store={store} />- </div>- {bot.unread > 0 ? (- <span- style={{- ...font('caption2', 'semibold'), color: 'var(--on-accent)', background: 'var(--accent-fill)', borderRadius: 999,- padding: '0 6px', minWidth: 18, height: 18, display: 'grid', placeItems: 'center', flex: 'none',- }}- >- {bot.unread}- </span>- ) : null}- </div>- </div>- </div>+ </HStack>+ {bot.unread > 0 ? <span className="unread-badge">{bot.unread}</span> : null}+ </HStack>+ </VStack>+ </HStack>)})-const line: React.CSSProperties = { ...font('callout'), whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', minWidth: 0 }-/** Live activity while working, otherwise the last message (Grok Bot row behavior). */function Preview({ bot, store }: { bot: Bot; store: BotStore }) {if (needsInput(bot)) {return (- <span style={{ display: 'flex', alignItems: 'center', gap: 6, color: 'var(--attention)', minWidth: 0 }}>+ <HStack as="span" gap={6} shrink><ThinkingOrb state="listening" size={16} color="var(--warning)" />- <span style={line}>{bot.activity || 'Needs your approval'}</span>- </span>+ <Text size="callout" tone="attention" truncate>{bot.activity || 'Needs your approval'}</Text>+ </HStack>)}if (isWorking(bot)) {return (- <span style={{ display: 'flex', alignItems: 'center', gap: 6, color: 'var(--secondary)', minWidth: 0 }}>+ <HStack as="span" gap={6} shrink><ThinkingOrb size={13} color="var(--secondary)" />- <span style={line}>{bot.activity || 'Working…'}</span>- </span>+ <Text size="callout" tone="secondary" truncate>{bot.activity || 'Working…'}</Text>+ </HStack>)}- if (bot.status === 'error') return <span style={{ ...line, color: 'var(--danger)' }}>{messagePreview(bot.lastMessage ?? 'Something went wrong')}</span>- return <span style={{ ...line, color: 'var(--secondary)' }}>{messagePreview(bot.lastMessage ?? (isGroup(bot) ? `${bot.members.length} bots` : `${store.backendName(bot.backend)} · ${folderName(bot)}`))}</span>+ if (bot.status === 'error') return <Text size="callout" tone="danger" truncate>{messagePreview(bot.lastMessage ?? 'Something went wrong')}</Text>+ return <Text size="callout" tone="secondary" truncate>{messagePreview(bot.lastMessage ?? (isGroup(bot) ? `${bot.members.length} bots` : `${store.backendName(bot.backend)} · ${folderName(bot)}`))}</Text>}diff --git a/apps/desktop/src/renderer/views/ChatWindow.tsx b/apps/desktop/src/renderer/views/ChatWindow.tsxindex fd1fb885..50f5295e 100644--- a/apps/desktop/src/renderer/views/ChatWindow.tsx+++ b/apps/desktop/src/renderer/views/ChatWindow.tsx@@ -5,7 +5,8 @@ import { draftOf, type Bot, type BotDraft } from '@shared/models'import { CharacterAvatar } from '../components/Avatar'import { Button, ChoicePicker, IconButton, ResizeHandle } from '../components/Controls'import { AnchoredMenu, Dialog, ModalHeader, Sheet, type MenuItem } from '../components/Overlay'-import { font } from '../lib/fonts'+import { HStack, Spacer } from '../components/Stack'+import { Text } from '../components/Text'import { useModels } from '../lib/observable'import { prefs, stepTextSize, usePref, DEFAULT_TEXT_SIZE } from '../lib/prefs'import { useApp, StoreContext } from '../store/context'@@ -37,8 +38,6 @@ import { useSSH, useSSHAttachments } from './settings/ssh-model'import './chat-window.css'import './sidebar-header.css'-const isMac = window.codync.platform === 'darwin'-/** Native desktop chat: roster on the left, the conversation on the right (Grok Bot's desktop layout). */export function ChatWindow() {const app = useApp()@@ -328,13 +327,13 @@ function ChatSplitView() {detail = (<div className="empty-detail"><div className="detail-drag drag" />- <div style={{ display: 'flex' }}>+ <HStack align="stretch" className="empty-detail-crew"><CharacterAvatar shape="blob" color="blue" size={60} mood="working" />- <CharacterAvatar shape="squircle" color="orange" size={60} style={{ marginLeft: -10 }} />- <CharacterAvatar shape="teardrop" color="violet" size={60} mood="working" style={{ marginLeft: -10 }} />- </div>- <div style={font('title2', 'semibold')}>{connecting ? 'Connecting to your computers…' : 'Your coding agents, as teammates.'}</div>- <div style={{ color: 'var(--secondary)', textAlign: 'center', maxWidth: 420 }}>{connecting ? 'Your bots will appear once connected. Manage computers to see connection progress.' : 'Pick a bot, or create one for each kind of work and point it at a project.'}</div>+ <CharacterAvatar shape="squircle" color="orange" size={60} />+ <CharacterAvatar shape="teardrop" color="violet" size={60} mood="working" />+ </HStack>+ <Text as="div" size="title2" weight="semibold">{connecting ? 'Connecting to your computers…' : 'Your coding agents, as teammates.'}</Text>+ <Text as="div" tone="secondary" className="empty-detail-message">{connecting ? 'Your bots will appear once connected. Manage computers to see connection progress.' : 'Pick a bot, or create one for each kind of work and point it at a project.'}</Text><Button onClick={() => compose()} disabled={!onlineStores.length}>New Bot</Button>@@ -344,30 +343,30 @@ function ChatSplitView() {const width = compact ? 76 : sidebarWidthreturn (- <div className="split" style={{ pointerEvents: showAccount || contextBot ? 'none' : undefined }}>+ <div className={`split ${showAccount || contextBot ? 'covered' : ''}`}><aside className={`sidebar ${compact ? 'compact' : ''} ${resizing ? 'resizing' : ''}`} style={{ width }}>- <div className="sidebar-header drag" style={{ paddingLeft: compact ? 0 : isMac ? 80 : 18, opacity: compact ? 0 : 1 }} inert={compact}>- <span style={{ flex: 1 }} />- <div className="no-drag" style={{ display: 'flex', alignItems: 'center', gap: 6 }}>+ <div className="sidebar-header drag" inert={compact}>+ <Spacer />+ <HStack gap={6} className="no-drag"><ComputerFilterHeader hidden={hidden} setHidden={setHidden} manage={() => setSettings('computers')} compact /><IconButton title="Search" icon="magnifyingglass" size={32} className="sidebar-header-action" onClick={() => setSearching(true)} /><IconButton title="New" icon="plus" size={32} className="sidebar-header-action" buttonRef={newButton} menuOpen={newMenu} onClick={() => setNewMenu((o) => !o)} disabled={!onlineStores.length} />- </div>+ </HStack><AnchoredMenu open={newMenu} onClose={() => setNewMenu(false)} anchor={newButton} items={newItems} /></div>{compact ? (- <div style={{ width: 70, alignSelf: 'center' }} className="drag">- <div className="no-drag" style={{ display: 'flex', justifyContent: 'center' }}>+ <div className="rail-header drag">+ <HStack align="stretch" justify="center" className="no-drag"><ComputerFilterHeader hidden={hidden} setHidden={setHidden} manage={() => setSettings('computers')} compact />- </div>+ </HStack></div>) : null}<div className="roster" ref={listRef} tabIndex={0} onKeyDown={onListKey}><BotRoster roster={roster} compact={compact} onContext={(bot, store, x, y) => setContextBot({ target: { bot, store }, x, y })} />{visibleRoster.length === 0 && !roster.grouped && !compact && mismatchStores.length === 0 ? (<div className="roster-empty">- <div style={font(13, 'medium')}>{onlineStores.length ? 'No bots yet' : 'Waiting for a computer'}</div>- {onlineStores.length ? <div style={{ ...font(12), color: 'var(--secondary)' }}>Use + to start a new chat.</div> : null}+ <Text as="div" size="body" weight="medium">{onlineStores.length ? 'No bots yet' : 'Waiting for a computer'}</Text>+ {onlineStores.length ? <Text as="div" size="callout" tone="secondary">Use + to start a new chat.</Text> : null}</div>) : null}</div>@@ -378,7 +377,7 @@ function ChatSplitView() {<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)}>+ <button className={`rail-profile ${showAccount ? 'open' : ''}`} aria-label="Open account menu for Account" title="Account" onClick={() => setShowAccount((s) => !s)}><ProfileAvatar /></button></div>@@ -458,9 +457,9 @@ function ChatSplitView() {function ComputerPicker({ stores, value, onChange }: { stores: BotStore[]; value: string; onChange: (id: string) => void }) {const options = useMemo(() => stores.map((s) => ({ id: s.computer.id, label: s.hostName })), [stores])return (- <div style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '12px 22px 0', ...font('callout') }}>- <span style={{ color: 'var(--secondary)' }}>On</span>+ <HStack gap={8} className="compose-computer">+ <Text tone="secondary">On</Text><ChoicePicker selection={value} options={options} onChange={onChange} />- </div>+ </HStack>)}diff --git a/apps/desktop/src/renderer/views/ComputerBadge.tsx b/apps/desktop/src/renderer/views/ComputerBadge.tsxindex 4516a673..13ef9fe5 100644--- a/apps/desktop/src/renderer/views/ComputerBadge.tsx+++ b/apps/desktop/src/renderer/views/ComputerBadge.tsx@@ -2,6 +2,7 @@ import type { Computer } from '@shared/models'import { Icon } from '../components/Icon'import { avatarColor } from '../lib/theme'import linux from '../assets/computer-linux.svg'+import './computer-badge.css'const symbol = (device?: string | null) =>({ laptop: 'laptopcomputer', macmini: 'macmini', macstudio: 'macstudio', imac: 'desktopcomputer', macpro: 'macpro.gen3' })[device ?? ''] ?? 'desktopcomputer'@@ -10,10 +11,10 @@ const symbol = (device?: string | null) =>export function ComputerBadge({ computer, size = 36 }: { computer: Computer | null; size?: number }) {const color = computer?.color ? avatarColor(computer.color) : 'var(--text)'return (- <span aria-hidden style={{ width: size, height: size, display: 'grid', placeItems: 'center', flex: 'none', color }}>+ <span aria-hidden className="computer-badge" style={{ width: size, height: size, color }}>{computer?.device === 'linux' ? (// SF Symbols has no penguin.- <span style={{ width: size * 0.55, height: size * 0.55, backgroundColor: color, WebkitMaskImage: `url("${linux}")`, WebkitMaskSize: 'contain', WebkitMaskRepeat: 'no-repeat', WebkitMaskPosition: 'center' }} />+ <span className="computer-badge-linux" style={{ width: size * 0.55, height: size * 0.55, backgroundColor: color, WebkitMaskImage: `url("${linux}")` }} />) : (<Icon name={symbol(computer?.device)} size={size * 0.5} weight="medium" />)}diff --git a/apps/desktop/src/renderer/views/ComputerFilterHeader.tsx b/apps/desktop/src/renderer/views/ComputerFilterHeader.tsxindex 274a563a..21fa43ef 100644--- a/apps/desktop/src/renderer/views/ComputerFilterHeader.tsx+++ b/apps/desktop/src/renderer/views/ComputerFilterHeader.tsx@@ -3,7 +3,7 @@ import { sshSummary, sshStatusDetail } from '@shared/ssh-startup'import { DropdownMenu } from '../components/Controls'import { Icon } from '../components/Icon'import type { MenuItem } from '../components/Overlay'-import { font } from '../lib/fonts'+import { Text } from '../components/Text'import { useApp } from '../store/context'import { useSSH } from './settings/ssh-model'import type { Connection } from '../store/bot-store'@@ -71,8 +71,8 @@ export function ComputerFilterHeader({ hidden, setHidden, manage, compact = falsreturn list}return (- <DropdownMenu items={items} title={text} className={compact ? 'computer-filter-action' : undefined} style={{ display: 'flex', alignItems: 'center', gap: 4, minWidth: 0, padding: compact ? '0 9px' : '6px 0', ...font(12, 'medium'), color: 'var(--secondary)' }}>- {compact ? <Icon name="desktopcomputer" size={12} weight="medium" /> : <span style={{ whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }} aria-label={`Computers, ${text}. Filter conversations`}>{text}</span>}+ <DropdownMenu items={items} title={text} className={`computer-filter ${compact ? 'computer-filter-action' : ''}`}>+ {compact ? <Icon name="desktopcomputer" size={12} weight="medium" /> : <Text truncate aria-label={`Computers, ${text}. Filter conversations`}>{text}</Text>}<Icon name="chevron.down" size={8} weight="semibold" /></DropdownMenu>)diff --git a/apps/desktop/src/renderer/views/HostStateView.tsx b/apps/desktop/src/renderer/views/HostStateView.tsxindex a0c6cf2d..2ead0bea 100644--- a/apps/desktop/src/renderer/views/HostStateView.tsx+++ b/apps/desktop/src/renderer/views/HostStateView.tsx@@ -1,6 +1,6 @@import { Button } from '../components/Controls'import { Icon } from '../components/Icon'-import { font } from '../lib/fonts'+import { Text } from '../components/Text'import { useApp } from '../store/context'const isMac = window.codync.platform === 'darwin'@@ -26,10 +26,10 @@ export function EmptyState({ icon, title, message, action, compact = false }: {return (<div className={`empty-state ${compact ? 'local-recovery' : ''}`}><Icon name={icon} size={compact ? 22 : 36} weight="light" color="var(--tertiary)" />- <div style={{ ...font(compact ? 'callout' : 'title3', 'semibold'), color: 'var(--text)' }}>{title}</div>- <div style={{ ...font('callout'), color: 'var(--secondary)', textAlign: compact ? 'left' : 'center', maxWidth: 360 }}>{message}</div>+ <Text as="div" size={compact ? 'callout' : 'title3'} weight="semibold" tone="text">{title}</Text>+ <Text as="div" size="callout" tone="secondary" className="empty-state-message">{message}</Text>{action ? (- <Button kind={compact ? 'secondary' : 'primary'} onClick={action[1]} style={{ marginTop: 4 }}>+ <Button kind={compact ? 'secondary' : 'primary'} onClick={action[1]} className="empty-state-action">{action[0]}</Button>) : null}diff --git a/apps/desktop/src/renderer/views/PairingWindow.tsx b/apps/desktop/src/renderer/views/PairingWindow.tsxindex 5527220a..b911e2cf 100644--- a/apps/desktop/src/renderer/views/PairingWindow.tsx+++ b/apps/desktop/src/renderer/views/PairingWindow.tsx@@ -2,9 +2,11 @@ import { useCallback, useEffect, useState } from 'react'import QRCode from 'qrcode'import type { CloudStatus, PairingInfo } from '@shared/models'import { IconButton, Spinner } from '../components/Controls'-import { font } from '../lib/fonts'+import { HStack, VStack } from '../components/Stack'+import { Text } from '../components/Text'import { LoopbackTransport } from '../client/host-client'import { useApp } from '../store/context'+import './pairing-window.css'/** A one-time pairing QR (v3) from this computer: its keys, a code, and how to reach it. */export function PairingWindow() {@@ -49,40 +51,40 @@ export function PairingWindow() {}, [info?.expiresAt, load])return (- <div style={{ width: 340, padding: 16, display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 12 }}>+ <VStack align="center" gap={12} className="pairing">{info && qr ? (<>- <div style={{ padding: 10, background: '#fff', borderRadius: 12 }}>- <img src={qr} alt={`Pairing code for ${name}`} width={200} height={200} style={{ display: 'block', imageRendering: 'pixelated' }} />+ <div className="pairing-qr">+ <img src={qr} alt={`Pairing code for ${name}`} width={200} height={200} /></div>- <div style={{ ...font('caption'), color: 'var(--secondary)', textAlign: 'center' }}>+ <Text as="div" size="caption" tone="secondary" className="pairing-note">Scan with the Codync app or the iPhone Camera. No Tailscale or open ports needed: your iPhone connects directly on the same Wi-Fi, and through the encrypted relay anywhere else.- </div>+ </Text>{cloud?.enabled !== true ? (- <div style={{ ...font('caption'), color: 'var(--attention)', textAlign: 'center' }}>+ <Text as="div" size="caption" tone="attention" className="pairing-note">{info.urls.length === 0? 'No network address found and “Reach from anywhere” is off. Connect to Wi-Fi or turn it on.': `“Reach from anywhere” is off, so the iPhone only reaches ${name} on the same network.`}- </div>+ </Text>) : null}- <div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>+ <HStack gap={4}>{info.expiresAt ? (- <span style={{ ...font('caption2'), color: 'var(--tertiary)' }}>+ <Text size="caption2" tone="tertiary">Works once, until {new Date(info.expiresAt).toLocaleTimeString(undefined, { hour: 'numeric', minute: '2-digit' })}- </span>+ </Text>) : null}<IconButton title="New code" icon="arrow.clockwise" onClick={() => void load()} /><IconButton title="Copy pairing link" icon="doc.on.doc" onClick={() => window.codync.app.copy(info.pairingUrl)} />- </div>+ </HStack></>) : error ? (<>- <div style={{ ...font('caption'), color: 'var(--danger)', textAlign: 'center' }}>{error}</div>+ <Text as="div" size="caption" tone="danger" className="pairing-note">{error}</Text><IconButton title="Try again" icon="arrow.clockwise" onClick={() => void load()} /></>) : (<Spinner size={20} />)}- </div>+ </VStack>)}diff --git a/apps/desktop/src/renderer/views/PanelMenus.tsx b/apps/desktop/src/renderer/views/PanelMenus.tsxindex 16848910..119ec79a 100644--- a/apps/desktop/src/renderer/views/PanelMenus.tsx+++ b/apps/desktop/src/renderer/views/PanelMenus.tsx@@ -2,7 +2,8 @@ import { useEffect, useState, type ReactNode } from 'react'import { Spinner } from '../components/Controls'import { Icon } from '../components/Icon'import type { MenuItem } from '../components/Overlay'-import { font } from '../lib/fonts'+import { HStack, IconSlot, VStack } from '../components/Stack'+import { Text } from '../components/Text'import { account, useAccount } from '../store/account'import googleLogo from '../assets/google.svg'@@ -12,16 +13,16 @@ import googleLogo from '../assets/google.svg'export function ProfileAvatar() {const { user, isBusy } = useAccount()return (- <span className="profile-avatar" aria-hidden style={{ position: 'relative', overflow: 'hidden' }}>+ <span className="profile-avatar" aria-hidden>{user?.avatarURL ? (- <img src={user.avatarURL} alt="" style={{ width: '100%', height: '100%', objectFit: 'cover' }} />+ <img src={user.avatarURL} alt="" className="profile-avatar-image" />) : (<Icon name="person.fill" size={15} weight="medium" color="var(--secondary)" />)}{isBusy ? (- <span style={{ position: 'absolute', inset: 0, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>+ <HStack as="span" justify="center" className="profile-avatar-busy"><Spinner size={14} />- </span>+ </HStack>) : null}</span>)@@ -76,7 +77,7 @@ export function AccountPanelLayer({ compact, approvals, onDismiss, onUsage, onSe]return (<div className="context-layer" onMouseDown={(e) => e.target === e.currentTarget && onDismiss()}>- <div className="account-panel" style={{ width: Math.min(260, window.innerWidth - 32), left: 16, bottom: compact ? 68 : 64 }}>+ <div className={`account-panel ${compact ? 'compact' : ''}`} style={{ width: Math.min(260, window.innerWidth - 32) }}><PanelRowsitems={items}onDismiss={onDismiss}@@ -86,8 +87,8 @@ export function AccountPanelLayer({ compact, approvals, onDismiss, onUsage, onSe<div className="panel-divider" /><div className="panel-identity"><Icon name="person.crop.circle" size={15} />- <span style={{ ...font(12), flex: 1, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{user?.email ?? 'Account'}</span>- {signedIn ? null : <span style={font(11)}>Not signed in</span>}+ <Text size="callout" truncate grow>{user?.email ?? 'Account'}</Text>+ {signedIn ? null : <Text size="caption">Not signed in</Text>}</div></>) : page === 'support' && i === 0 ? (@@ -96,7 +97,7 @@ export function AccountPanelLayer({ compact, approvals, onDismiss, onUsage, onSe}/>{page === 'main' && errorMessage ? (- <div style={{ ...font(12), color: 'var(--attention)', padding: '8px 10px' }}>{errorMessage}</div>+ <Text as="div" size="callout" tone="attention" className="panel-error">{errorMessage}</Text>) : null}</div></div>@@ -129,12 +130,11 @@ function PanelRows({ items, onDismiss, after, dismissOnActivate = false }: { itereturn () => window.removeEventListener('keydown', onKey)}, [items, highlighted, onDismiss, dismissOnActivate])return (- <div style={{ display: 'flex', flexDirection: 'column', gap: 2 }}>+ <VStack gap={2}>{items.map((item, i) => (<div key={item.title}><button- className={`panel-row ${highlighted === i ? 'highlight' : ''}`}- style={{ color: item.destructive ? 'var(--danger)' : 'var(--text)' }}+ className={`panel-row ${highlighted === i ? 'highlight' : ''} ${item.destructive ? 'destructive' : ''}`}disabled={item.disabled}onMouseEnter={() => setHighlighted(i)}onClick={() => {@@ -142,17 +142,17 @@ function PanelRows({ items, onDismiss, after, dismissOnActivate = false }: { iteitem.action()}}>- <span style={{ width: 20, display: 'flex', justifyContent: 'center' }}>+ <IconSlot width={20}>{item.image ? <img src={item.image} alt="" width={14} height={14} /> : <Icon name={item.icon} size={14} />}- </span>- <span style={{ ...font(12), flex: 1, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{item.title}</span>- {item.detail ? <span style={{ ...font(13), color: 'var(--secondary)' }}>{item.detail}</span> : null}+ </IconSlot>+ <Text size="callout" truncate grow>{item.title}</Text>+ {item.detail ? <Text size="body" tone="secondary">{item.detail}</Text> : null}{item.chevron ? <Icon name="chevron.right" size={11} color="var(--secondary)" /> : null}</button>{after?.(i)}</div>))}- </div>+ </VStack>)}diff --git a/apps/desktop/src/renderer/views/SearchPalette.tsx b/apps/desktop/src/renderer/views/SearchPalette.tsxindex 789e1538..432b3538 100644--- a/apps/desktop/src/renderer/views/SearchPalette.tsx+++ b/apps/desktop/src/renderer/views/SearchPalette.tsx@@ -3,7 +3,8 @@ import { isGroup, type Bot } from '@shared/models'import { AvatarWithStatus } from '../components/Avatar'import { Icon } from '../components/Icon'import { Sheet } from '../components/Overlay'-import { font } from '../lib/fonts'+import { VStack } from '../components/Stack'+import { Text } from '../components/Text'import { refKey, type BotRef, type RosterItem } from '../store/app-model'import './search-palette.css'@@ -75,10 +76,10 @@ function PaletteBody({ items, onPick, onClose }: { items: RosterItem[]; onPick:onClick={() => pick(item)}><AvatarWithStatus bot={item.bot} members={isGroup(item.bot) ? item.store.members(item.bot) : []} size={32} />- <span style={{ flex: 1, minWidth: 0, display: 'flex', flexDirection: 'column', gap: 2 }}>- <span className="palette-line" style={{ ...font('body'), color: 'var(--text)' }}>{item.bot.name}</span>- {subtitle(item) ? <span className="palette-line" style={{ ...font('subheadline'), color: 'var(--secondary)' }}>{subtitle(item)}</span> : null}- </span>+ <VStack as="span" gap={2} grow>+ <Text size="body" tone="text" truncate>{item.bot.name}</Text>+ {subtitle(item) ? <Text size="subheadline" tone="secondary" truncate>{subtitle(item)}</Text> : null}+ </VStack>{i < 9 ? <span className="key-cap palette-key">{`${modifier}${i + 1}`}</span> : null}</button>))}diff --git a/apps/desktop/src/renderer/views/StarPrompt.tsx b/apps/desktop/src/renderer/views/StarPrompt.tsxindex f547766e..057e4fba 100644--- a/apps/desktop/src/renderer/views/StarPrompt.tsx+++ b/apps/desktop/src/renderer/views/StarPrompt.tsx@@ -2,7 +2,8 @@ import { useState } from 'react'import { Button } from '../components/Controls'import { Icon } from '../components/Icon'import { ModalHeader, Sheet } from '../components/Overlay'-import { font } from '../lib/fonts'+import { HStack, VStack } from '../components/Stack'+import { Text } from '../components/Text'import { useModel } from '../lib/observable'import { prefs, usePref } from '../lib/prefs'import { afterStarAsk, dueStarAsk } from '../lib/star-ask'@@ -44,19 +45,19 @@ export function StarPrompt() {const text = copy[due ?? 'first']return (<Sheet open={open} onClose={() => finish(false)}>- <div style={{ width: 420, display: 'flex', flexDirection: 'column' }}>+ <VStack className="star-prompt"><ModalHeader title={text.title} />- <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 16, padding: '0 24px 24px' }}>+ <VStack align="center" gap={16} className="star-prompt-body"><Icon name="star" size={36} weight="light" color="var(--secondary)" />- <div style={{ ...font('callout'), color: 'var(--secondary)', textAlign: 'center' }}>{text.message}</div>- <div style={{ display: 'flex', gap: 12 }}>+ <Text as="div" size="callout" tone="secondary" className="star-prompt-message">{text.message}</Text>+ <HStack align="stretch" gap={12}><Button kind="secondary" onClick={() => finish(false)}>Not now</Button><Button onClick={() => finish(true)}>Star on GitHub</Button>- </div>- </div>- </div>+ </HStack>+ </VStack>+ </VStack></Sheet>)}diff --git a/apps/desktop/src/renderer/views/StartupRecovery.tsx b/apps/desktop/src/renderer/views/StartupRecovery.tsxindex 95ecebe4..9ad34b8b 100644--- a/apps/desktop/src/renderer/views/StartupRecovery.tsx+++ b/apps/desktop/src/renderer/views/StartupRecovery.tsx@@ -1,7 +1,7 @@import { isSSHConnecting } from '@shared/ssh-startup'import { Button, Spinner } from '../components/Controls'import { Icon } from '../components/Icon'-import { font } from '../lib/fonts'+import { Text } from '../components/Text'import { useApp } from '../store/context'import { HostStateView } from './HostStateView'import { SSHRow } from './settings/SSHRow'@@ -19,9 +19,9 @@ export function StartupRecovery({ manage }: { manage: () => void }) {<div className="startup-recovery-content"><div className="startup-recovery-title" role="status">{connecting ? <Spinner size={22} /> : <Icon name="desktopcomputer" size={22} color="var(--secondary)" />}- <span style={font('title2', 'semibold')}>{connecting ? 'Connecting to your computers…' : 'Your remote computers'}</span>+ <Text size="title2" weight="semibold">{connecting ? 'Connecting to your computers…' : 'Your remote computers'}</Text></div>- <div style={{ color: 'var(--secondary)' }}>Your bots will appear once a computer is connected.</div>+ <Text as="div" tone="secondary">Your bots will appear once a computer is connected.</Text><div className="startup-recovery-profiles">{ssh.state.profiles.map((p) => (<SSHRow key={p.id} profile={p} status={ssh.status(p.id)} attached={ssh.state.attachments.some((a) => a.profileId === p.id)} edit={manage} />diff --git a/apps/desktop/src/renderer/views/UpdateNeededCard.tsx b/apps/desktop/src/renderer/views/UpdateNeededCard.tsxindex 89207f13..0715f27b 100644--- a/apps/desktop/src/renderer/views/UpdateNeededCard.tsx+++ b/apps/desktop/src/renderer/views/UpdateNeededCard.tsx@@ -1,7 +1,8 @@import type { VersionMismatch } from '@shared/compat'import { Button } from '../components/Controls'import { Icon } from '../components/Icon'-import { font } from '../lib/fonts'+import { HStack, VStack } from '../components/Stack'+import { Text } from '../components/Text'import { useApp, useStore } from '../store/context'import { UpdateButton, useUpdates } from './UpdateButton'@@ -43,15 +44,15 @@ export function UpdateNeededCard() {? updates && <UpdateButton updates={updates} kind="primary" />: restartsHost && <Button onClick={() => window.codync.host.restart()}>{`Update ${store.hostName}`}</Button>return (- <div style={{ display: 'flex', alignItems: 'flex-start', gap: 12, padding: 14, background: 'var(--surface)', borderRadius: 16 }}>+ <HStack align="flex-start" gap={12} className="update-needed"><Icon name="arrow.down.circle" size={15} color="var(--warning)" />- <div style={{ display: 'flex', flexDirection: 'column', gap: 6, flex: 1, minWidth: 0 }}>- <div style={{ ...font('subheadline', 'semibold'), color: 'var(--text)' }}>{updateNeededText.title(mismatch, store.hostName)}</div>- <div style={{ ...font('footnote'), color: 'var(--secondary)' }}>+ <VStack gap={6} grow>+ <Text as="div" size="subheadline" weight="semibold" tone="text">{updateNeededText.title(mismatch, store.hostName)}</Text>+ <Text as="div" size="footnote" tone="secondary">{updateNeededText.detail(mismatch, store.hostName, store.hostVersion?.version, store.hello?.os, !updatesApp && !restartsHost)}- </div>- {button ? <div style={{ marginTop: 4, alignSelf: 'flex-start' }}>{button}</div> : null}- </div>- </div>+ </Text>+ {button ? <div className="update-needed-action">{button}</div> : null}+ </VStack>+ </HStack>)}diff --git a/apps/desktop/src/renderer/views/account-welcome.css b/apps/desktop/src/renderer/views/account-welcome.cssnew file mode 100644index 00000000..27f82992--- /dev/null+++ b/apps/desktop/src/renderer/views/account-welcome.css@@ -0,0 +1,65 @@+/* First-run welcome (AccountWelcomeView). Its entrance beats stay inline: they follow state. */+.welcome-restoring {+ height: 100%;+}+.welcome-skip {+ color: var(--secondary);+}++.welcome {+ height: 100%;+ overflow-y: auto;+ background: var(--background);+}+.welcome-column {+ min-height: 100%;+ max-width: 480px;+ margin: 0 auto;+ padding: 0 24px 12px;+}+.welcome-glimpse {+ padding-bottom: 24px;+}+/* A fixed display size: it doesn't follow the text size preference. */+.welcome-title {+ font-size: 34px;+ font-weight: 600;+ letter-spacing: -0.6px;+ line-height: 1.15;+ color: var(--text);+}+.styled-button.welcome-button {+ width: 100%;+ min-height: 50px;+ font-size: var(--text-body);+ font-weight: 700;+}++.welcome-crew {+ position: relative;+ height: 170px;+}+.welcome-crew-member {+ position: absolute;+ left: 50%;+ top: 50%;+}++.welcome-bubble {+ padding: 9px 14px;+ border-radius: 18px;+}+.welcome-bubble.user {+ background: var(--bubble-user);+}+.welcome-bubble.agent {+ background: var(--bubble-agent);+ transform-origin: bottom left;+ animation: welcome-bubble-in 0.45s var(--ease-out) both;+}+@keyframes welcome-bubble-in {+ from {+ opacity: 0;+ transform: scale(0.92);+ }+}diff --git a/apps/desktop/src/renderer/views/bots/AgentModelPicker.tsx b/apps/desktop/src/renderer/views/bots/AgentModelPicker.tsxindex b13bbe17..93951ddd 100644--- a/apps/desktop/src/renderer/views/bots/AgentModelPicker.tsx+++ b/apps/desktop/src/renderer/views/bots/AgentModelPicker.tsx@@ -1,6 +1,7 @@import { useEffect, useRef } from 'react'import { ChoicePicker, IconButton, Pill, Spinner } from '../../components/Controls'-import { font } from '../../lib/fonts'+import { HStack, Spacer, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import type { AgentModelsState } from './agent-models'/** The bot's model and its options, from the list `useAgentModels` loaded for its agent. */@@ -40,52 +41,52 @@ export function AgentModelPicker({ backend, models, selection, onChange, options}return (- <div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>- <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>- <span style={{ color: 'var(--text)', whiteSpace: 'nowrap' }}>Model</span>- <span style={{ flex: 1 }} />- <div style={{ display: 'flex', alignItems: 'center', gap: 4, minWidth: 0 }}>+ <VStack gap={6}>+ <HStack gap={8}>+ <Text tone="text" className="model-picker-label">Model</Text>+ <Spacer />+ <HStack gap={4} shrink>{custom ? null : (// Loading and refresh share one fixed slot, so the row never grows for loading.- <div style={{ width: 28, height: 28, display: 'grid', placeItems: 'center', flex: 'none' }}>- <div style={{ gridArea: '1 / 1', opacity: loading ? 0 : 1, transition: 'opacity var(--fade)', pointerEvents: loading ? 'none' : undefined }}>+ <div className="model-picker-slot">+ <div className={`model-picker-refresh ${loading ? 'hidden' : ''}`}><IconButton title={failure ? 'Retry model list' : 'Refresh model list'} icon="arrow.clockwise" disabled={loading} onClick={models.reload} /></div>{loading ? (- <div className="fade-in" style={{ gridArea: '1 / 1', display: 'flex' }} aria-label="Loading available models">+ <HStack align="stretch" className="fade-in" aria-label="Loading available models"><Spinner size={12} />- </div>+ </HStack>) : null}</div>)}{custom || (!loading && (!catalog || empty)) ? (- <Pill outlined style={{ minWidth: 0, maxWidth: 160 }}>- <input value={value} placeholder="Default" spellCheck={false} onChange={(e) => set(e.target.value)} style={{ textAlign: 'right', width: 142, maxWidth: '100%', minWidth: 0, color: 'var(--text)', userSelect: 'text' }} />+ <Pill outlined className="model-picker-pill">+ <input className="model-picker-input" value={value} placeholder="Default" spellCheck={false} onChange={(e) => set(e.target.value)} /></Pill>) : (- <div style={{ display: 'flex', minWidth: 0 }}>+ <HStack align="stretch" shrink><ChoicePicker selection={value} options={options} onChange={set} />- </div>+ </HStack>)}- </div>- </div>+ </HStack>+ </HStack>{modelOptions.map((o) => {const fallback = o.values.find((v) => v.id === o.default)?.nameconst choices = [{ id: '', label: fallback ? `Default · ${fallback}` : 'Default' }, ...o.values.map((v) => ({ id: v.id, label: v.name }))]return (- <div key={o.id} className="fade-in" style={{ display: 'flex', alignItems: 'center', gap: 8 }}>- <span style={{ color: 'var(--text)', whiteSpace: 'nowrap' }}>{o.name}</span>- <span style={{ flex: 1 }} />+ <HStack key={o.id} gap={8} className="fade-in">+ <Text tone="text" className="model-picker-label">{o.name}</Text>+ <Spacer /><ChoicePicker selection={chosen[o.id] ?? ''} options={choices} onChange={(v) => setOption(o.id, v)} />- </div>+ </HStack>)})}{!custom && !loading && failure ? (- <span style={{ ...font('caption'), color: 'var(--attention)' }}>{failure}</span>+ <Text size="caption" tone="attention">{failure}</Text>) : !custom && !loading && empty ? (- <span style={{ ...font('caption'), color: 'var(--secondary)' }}>This agent doesn't advertise a model list. Leave Default or enter a model ID.</span>+ <Text size="caption" tone="secondary">This agent doesn't advertise a model list. Leave Default or enter a model ID.</Text>) : null}- <span style={{ ...font('caption'), color: 'var(--secondary)' }}>Changing the model starts a new agent session. Chat history is kept.</span>- </div>+ <Text size="caption" tone="secondary">Changing the model starts a new agent session. Chat history is kept.</Text>+ </VStack>)}diff --git a/apps/desktop/src/renderer/views/bots/BotEditorView.tsx b/apps/desktop/src/renderer/views/bots/BotEditorView.tsxindex 17990481..b22a1f44 100644--- a/apps/desktop/src/renderer/views/bots/BotEditorView.tsx+++ b/apps/desktop/src/renderer/views/bots/BotEditorView.tsx@@ -5,8 +5,9 @@ import { AgentIcon } from '../../components/AgentIcon'import { CharacterAvatar } from '../../components/Avatar'import { CardSection, ChoicePicker, DropdownMenu, IconButton, Pill, SearchField, Spinner, ValueRow } from '../../components/Controls'import { Icon } from '../../components/Icon'-import { ModalHeader, Sheet, useDismiss } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { ModalHeader, Sheet, SheetPage, useDismiss } from '../../components/Overlay'+import { HStack, IconSlot, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { AVATAR_COLORS, AVATAR_SHAPES } from '../../lib/theme'import { useStore } from '../../store/context'import { useAgentModels } from './agent-models'@@ -48,15 +49,15 @@ export function BotEditorView({ draft: initial }: { draft: BotDraft }) {}return (- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' }}>+ <SheetPage><ModalHeadertitle={isNew ? 'New bot' : 'Settings'}trailing={saving ? <Spinner /> : <IconButton title={isNew ? 'Create' : 'Save'} icon="checkmark" disabled={!isValid(draft) || saving || !online} onClick={save} />}/>- <div style={{ flex: 1, minHeight: 0 }}>+ <div className="bot-editor-body"><BotSettingsForm draft={draft} onChange={setDraft} error={error} plugins={plugins} /></div>- </div>+ </SheetPage>)}@@ -142,7 +143,7 @@ function BotSettingsForm({ draft, onChange, error, plugins, part = 'all' }: {]const agent = (- <div key="agent" style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>+ <VStack key="agent" gap={8}><ValueRow label="Agent"><ChoicePickerselection={draft.backend}@@ -153,18 +154,17 @@ function BotSettingsForm({ draft, onChange, error, plugins, part = 'all' }: {onChange={(id) => set('backend', id)}/></ValueRow>- {backend && !backend.available ? <span style={{ ...font('caption'), color: 'var(--attention)' }}>{backend.installHint}</span> : null}+ {backend && !backend.available ? <Text size="caption" tone="attention">{backend.installHint}</Text> : null}{draft.backend === 'custom' ? (<input- className="field-box fade-in"- style={font('callout', undefined, 'monospaced')}+ className="field-box fade-in bot-command"value={draft.command ?? ''}placeholder="ACP command, e.g. my-agent --acp"spellCheck={false}onChange={(e) => set('command', e.target.value || null)}/>) : null}- </div>+ </VStack>)if (part === 'often') {@@ -176,7 +176,7 @@ function BotSettingsForm({ draft, onChange, error, plugins, part = 'all' }: {{agent}{model}</CardSection>- {error ? <span className="fade-in" style={{ ...font('footnote'), color: 'var(--danger)' }}>{error}</span> : null}+ {error ? <Text size="footnote" tone="danger" className="fade-in">{error}</Text> : null}</div></div>)@@ -191,7 +191,7 @@ function BotSettingsForm({ draft, onChange, error, plugins, part = 'all' }: {<CharacterAvatar shape={draft.avatarShape} color={draft.avatarColor} size={24} /></button><AnchoredPanel open={pickingAvatar} onClose={() => setPickingAvatar(false)} anchor={avatarRef}>- <div style={{ padding: 14, width: 300 }}>+ <div className="avatar-picker-panel"><AvatarPicker shape={draft.avatarShape} color={draft.avatarColor} onShape={(s) => set('avatarShape', s)} onColor={(c) => set('avatarColor', c)} /></div></AnchoredPanel>@@ -208,7 +208,7 @@ function BotSettingsForm({ draft, onChange, error, plugins, part = 'all' }: {{/* In the inspector the agent and its model are on the Details tab; what's left is where it works. */}<CardSection title={part === 'all' ? 'Agent' : 'Workspace'}><ValueRow label="Computer">- <span style={{ whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{store.hostName}</span>+ <Text truncate>{store.hostName}</Text></ValueRow>{part === 'all' ? agent : null}{part === 'all' ? model : null}@@ -227,8 +227,8 @@ function BotSettingsForm({ draft, onChange, error, plugins, part = 'all' }: {{ title: 'Choose project folder…', selected: !!draft.cwd, action: () => setPickingFolder(true) },]}>- <Pill outlined style={{ gap: 6, color: 'var(--text)' }}>- <span style={{ whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', maxWidth: 160 }}>{draft.cwd ? lastPathComponent(draft.cwd) : 'Personal'}</span>+ <Pill outlined className="workspace-pill">+ <Text truncate className="workspace-pill-label">{draft.cwd ? lastPathComponent(draft.cwd) : 'Personal'}</Text><Icon name="chevron.down" size={10} weight="semibold" color="var(--secondary)" /></Pill></DropdownMenu>@@ -287,7 +287,7 @@ function BotSettingsForm({ draft, onChange, error, plugins, part = 'all' }: {onChange={(ids) => set('skills', ids)}onInfo={(s) => setViewingSkill({ id: s.id, name: s.name, description: s.detail })}/>- {error ? <span className="fade-in" style={{ ...font('footnote'), color: 'var(--danger)' }}>{error}</span> : null}+ {error ? <Text size="footnote" tone="danger" className="fade-in">{error}</Text> : null}</div><FormSheet open={viewingSkill !== null} onClose={() => setViewingSkill(null)}>{viewingSkill ? <SkillSheet key={viewingSkill.name} skill={viewingSkill} /> : null}@@ -317,7 +317,7 @@ function PluginToggles({ title, empty, items, selection, onChange, onInfo }: {}) {return (<CardSection title={title}>- {items.length ? null : <span style={{ color: 'var(--secondary)' }}>{empty}</span>}+ {items.length ? null : <Text tone="secondary">{empty}</Text>}{items.map((item) => {const row = (<SwitchRow@@ -329,10 +329,10 @@ function PluginToggles({ title, empty, items, selection, onChange, onInfo }: {/>)return onInfo ? (- <div key={item.id} style={{ display: 'flex', alignItems: 'center', gap: 4 }}>- <div style={{ flex: 1, minWidth: 0 }}>{row}</div>+ <HStack key={item.id} gap={4}>+ <div className="plugin-toggle">{row}</div><IconButton title={`About ${item.name}`} icon="info.circle" onClick={() => onInfo(item)} />- </div>+ </HStack>) : row})}</CardSection>@@ -341,7 +341,7 @@ function PluginToggles({ title, empty, items, selection, onChange, onInfo }: {function AvatarPicker({ shape, color, onShape, onColor }: { shape: string; color: string; onShape: (s: string) => void; onColor: (c: string) => void }) {return (- <div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>+ <VStack gap={12}><div className="swatch-row">{AVATAR_SHAPES.map((s) => (<button key={s} className={`swatch ${s === shape ? 'on' : ''}`} aria-label={`${s} shape`} aria-pressed={s === shape} onClick={() => onShape(s)}>@@ -352,11 +352,11 @@ function AvatarPicker({ shape, color, onShape, onColor }: { shape: string; color<div className="swatch-row">{AVATAR_COLORS.map((c) => (<button key={c.id} className={`swatch ${c.id === color ? 'on' : ''}`} aria-label={c.label} aria-pressed={c.id === color} onClick={() => onColor(c.id)}>- <span style={{ width: 26, height: 26, borderRadius: '50%', background: c.hex, display: 'block' }} />+ <span className="swatch-color" style={{ background: c.hex }} /></button>))}</div>- </div>+ </VStack>)}@@ -367,10 +367,10 @@ function FolderPicker({ start, onPick }: { start: string | null; onPick: (path:const [forward, setForward] = useState(true)const current = stack[stack.length - 1] ?? nullreturn (- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' }}>- <div style={{ display: 'flex', alignItems: 'center' }}>+ <SheetPage>+ <HStack>{stack.length > 1 ? (- <div className="fade-in" style={{ paddingLeft: 10, display: 'flex' }}>+ <HStack align="stretch" className="fade-in folder-back"><IconButtontitle="Back"icon="chevron.left"@@ -379,13 +379,13 @@ function FolderPicker({ start, onPick }: { start: string | null; onPick: (path:setStack((s) => s.slice(0, -1))}}/>- </div>+ </HStack>) : null}- <div style={{ flex: 1, minWidth: 0 }}>+ <div className="folder-title"><ModalHeader title={current ? lastPathComponent(current) : 'Folders'} /></div>- </div>- <div style={{ flex: 1, minHeight: 0, overflow: 'hidden' }}>+ </HStack>+ <div className="folder-levels"><FolderLevelkey={stack.length}path={current}@@ -397,7 +397,7 @@ function FolderPicker({ start, onPick }: { start: string | null; onPick: (path:}}/></div>- </div>+ </SheetPage>)}@@ -423,24 +423,24 @@ function FolderLevel({ path, forward, onPick, onOpen }: { path: string | null; freturn (<div className={`bot-form level-slide ${forward ? 'from-trailing' : 'from-leading'}`}>- <div className="bot-form-content" style={{ gap: 14 }}>+ <div className="bot-form-content folder-level-content"><SearchField value={filter} onChange={setFilter} />{listing ? (<><CardSection footer={listing.path}>- <button className="press" style={{ display: 'flex', alignItems: 'center', gap: 8, ...font('headline'), color: 'var(--accent)' }} onClick={() => onPick(listing.path)}>+ <button className="press folder-use" onClick={() => onPick(listing.path)}><Icon name="checkmark.circle.fill" size={13} />- <span style={{ whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{`Use “${lastPathComponent(listing.path)}”`}</span>+ <Text truncate>{`Use “${lastPathComponent(listing.path)}”`}</Text></button></CardSection>{dirs.length ? (<CardSection>{dirs.map((dir) => (- <button key={dir.path} className="press" style={{ display: 'flex', alignItems: 'center', gap: 10 }} onClick={() => onOpen(dir.path)}>- <span style={{ width: 20, display: 'flex', justifyContent: 'center' }}>+ <button key={dir.path} className="press folder-row" onClick={() => onOpen(dir.path)}>+ <IconSlot width={20}><Icon name={dir.isGit ? 'arrow.triangle.branch' : 'folder'} size={12} color={dir.isGit ? 'var(--accent)' : 'var(--secondary)'} />- </span>- <span style={{ flex: 1, minWidth: 0, color: 'var(--text)', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{dir.name}</span>+ </IconSlot>+ <Text tone="text" truncate grow>{dir.name}</Text><Icon name="chevron.right" size={10} weight="semibold" color="var(--tertiary)" /></button>))}@@ -448,11 +448,11 @@ function FolderLevel({ path, forward, onPick, onOpen }: { path: string | null; f) : null}</>) : error ? (- <span style={{ color: 'var(--danger)' }}>{error}</span>+ <Text tone="danger">{error}</Text>) : (- <div style={{ display: 'flex', justifyContent: 'center' }}>+ <HStack align="stretch" justify="center"><Spinner size={20} />- </div>+ </HStack>)}</div></div>diff --git a/apps/desktop/src/renderer/views/bots/BotTemplateView.tsx b/apps/desktop/src/renderer/views/bots/BotTemplateView.tsxindex 16e6bf6b..7d02f84a 100644--- a/apps/desktop/src/renderer/views/bots/BotTemplateView.tsx+++ b/apps/desktop/src/renderer/views/bots/BotTemplateView.tsx@@ -2,7 +2,8 @@ import { useEffect, useMemo, useState } from 'react'import type { BotDraft } from '@shared/models'import { Icon } from '../../components/Icon'import { ModalHeader } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { HStack, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import './bots.css'/** Swift's `JSONEncoder` with `.prettyPrinted, .sortedKeys, .withoutEscapingSlashes`; nil fields are left out. */@@ -38,28 +39,24 @@ export function BotTemplateView({ draft }: { draft: BotDraft }) {})return (- <div style={{ width: 560, height: 540, display: 'flex', flexDirection: 'column', background: 'var(--background)' }}>+ <VStack className="bot-template"><ModalHeader title="Create template" />- <div style={{ flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column', gap: 20, padding: '0 24px 24px' }}>- <span style={{ ...font('subheadline'), color: 'var(--secondary)' }}>{draft.name}</span>- <span style={{ ...font('callout'), color: 'var(--secondary)' }}>Copy this bot’s settings to reuse as a template. Conversation history and conversation ID are excluded.</span>- <div style={{ flex: 1, minHeight: 0, overflowY: 'auto', background: 'var(--surface)', borderRadius: 12 }}>- <pre className="selectable" style={{ ...font(12, 'regular', 'monospaced'), margin: 0, padding: 16, whiteSpace: 'pre-wrap', wordBreak: 'break-word' }}>+ <VStack gap={20} className="bot-template-body">+ <Text size="subheadline" tone="secondary">{draft.name}</Text>+ <Text size="callout" tone="secondary">Copy this bot’s settings to reuse as a template. Conversation history and conversation ID are excluded.</Text>+ <div className="bot-template-code">+ <pre className="selectable">{encoded}</pre></div>- <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>- <span style={{ ...font('caption'), color: 'var(--secondary)', flex: 1 }}>Includes workspace preferences and agent configuration.</span>- <button- className="press"- style={{ ...font(13, 'semibold'), display: 'flex', alignItems: 'center', gap: 6, padding: '9px 14px', color: 'var(--on-accent)', background: 'var(--accent-fill)', borderRadius: 9 }}- onClick={copy}- >+ <HStack gap={8}>+ <Text size="caption" tone="secondary" grow>Includes workspace preferences and agent configuration.</Text>+ <button className="press bot-template-copy" onClick={copy}><Icon key={copied ? 'checkmark' : 'square.on.square'} name={copied ? 'checkmark' : 'square.on.square'} size={13} weight="semibold" className="fade-in" />{copied ? 'Copied' : 'Copy template'}</button>- </div>- </div>- </div>+ </HStack>+ </VStack>+ </VStack>)}diff --git a/apps/desktop/src/renderer/views/bots/GroupEditorView.tsx b/apps/desktop/src/renderer/views/bots/GroupEditorView.tsxindex 5113ccd5..2138443d 100644--- a/apps/desktop/src/renderer/views/bots/GroupEditorView.tsx+++ b/apps/desktop/src/renderer/views/bots/GroupEditorView.tsx@@ -3,8 +3,9 @@ import { isGroup, type Bot } from '@shared/models'import { BotAvatar, GroupAvatar } from '../../components/Avatar'import { IconButton, Spinner } from '../../components/Controls'import { Icon } from '../../components/Icon'-import { Dialog, ModalHeader, useDismiss } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { Dialog, ModalHeader, SheetPage, useDismiss } from '../../components/Overlay'+import { VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { useStore } from '../../store/context'import { errorText } from './drafts'import { AutoTextArea } from './parts'@@ -60,16 +61,16 @@ export function GroupEditorView({ group, members: initialMembers = [] }: { group}return (- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' }}>+ <SheetPage><ModalHeader title={isNew ? 'New group chat' : 'Group chat'} trailing={saving ? <Spinner /> : <IconButton title={isNew ? 'Create' : 'Save'} icon="checkmark" disabled={!canSave} onClick={save} />} />- <div style={{ flex: 1, minHeight: 0, overflowY: 'auto' }}>+ <div className="group-scroll"><div className="group-form"><div className="group-identity"><GroupAvatar members={picked} size={84} /><input className="group-name" value={name} placeholder={defaultName} aria-label="Name" onChange={(e) => setName(e.target.value)} /><AutoTextArea className="group-about" value={about} placeholder="What this group works on" minRows={1} maxRows={4} onChange={setAbout} /></div>- <div style={{ display: 'flex', flexDirection: 'column' }}>+ <VStack><div className="group-section-title">Members</div>{picked.map((bot) => (<div key={bot.id} className="member-row fade-in">@@ -81,8 +82,7 @@ export function GroupEditorView({ group, members: initialMembers = [] }: { group{adding ? (<><input- className="field-box fade-in"- style={{ margin: '6px 0', background: 'var(--surface)' }}+ className="field-box fade-in group-search"autoFocusvalue={query}placeholder="Search bots"@@ -95,31 +95,31 @@ export function GroupEditorView({ group, members: initialMembers = [] }: { group{candidates.map((bot) => (<button key={bot.id} className="member-row press fade-in" aria-label={`Add ${bot.name}`} onClick={() => toggle(bot.id)}><BotAvatar bot={bot} size={32} animated={false} />- <span className="member-name" style={{ color: 'var(--secondary)' }}>{bot.name}</span>+ <Text tone="secondary" className="member-name">{bot.name}</Text><Icon name="plus.circle" size={18} color="var(--secondary)" /></button>))}</>) : candidates.length ? (<button className="member-row press" onClick={() => setAdding(true)}>- <span style={{ width: 32, display: 'grid', placeItems: 'center' }}>+ <span className="member-add-icon"><Icon name="plus" size={16} color="var(--secondary)" /></span>- <span className="member-name" style={{ color: 'var(--secondary)' }}>Add Member</span>+ <Text tone="secondary" className="member-name">Add Member</Text></button>) : null}- <div style={{ ...font('caption'), color: 'var(--tertiary)', padding: '10px 0 0' }}>Everyone answers in turn unless you @mention someone.</div>- </div>- {error ? <span className="fade-in" style={{ ...font('footnote'), color: 'var(--danger)' }}>{error}</span> : null}+ <Text as="div" size="caption" tone="tertiary" className="group-note">Everyone answers in turn unless you @mention someone.</Text>+ </VStack>+ {error ? <Text size="footnote" tone="danger" className="fade-in">{error}</Text> : null}{current ? (- <button className="press" style={{ ...font('body'), color: 'var(--danger)', alignSelf: 'flex-start' }} onClick={() => setConfirmDelete(current)}>+ <button className="press group-delete" onClick={() => setConfirmDelete(current)}>Delete group chat</button>) : null}</div></div><DeleteBotDialog bot={confirmDelete} onClose={() => setConfirmDelete(null)} onDeleted={dismiss} />- </div>+ </SheetPage>)}diff --git a/apps/desktop/src/renderer/views/bots/NewChatView.tsx b/apps/desktop/src/renderer/views/bots/NewChatView.tsxindex 4369c829..073aa053 100644--- a/apps/desktop/src/renderer/views/bots/NewChatView.tsx+++ b/apps/desktop/src/renderer/views/bots/NewChatView.tsx@@ -1,9 +1,11 @@import { useEffect, useLayoutEffect, useRef, useState, type ReactNode } from 'react'import { draftOf, isGroup, type Bot } from '@shared/models'import { BotAvatar, GroupAvatar } from '../../components/Avatar'-import { IconButton } from '../../components/Controls'+import { Hairline, IconButton } from '../../components/Controls'import { Icon } from '../../components/Icon'-import { font } from '../../lib/fonts'+import { SheetPage } from '../../components/Overlay'+import { HStack, Spacer } from '../../components/Stack'+import { Text } from '../../components/Text'import { useStore } from '../../store/context'import { createDefaultBot, errorText } from './drafts'import { AutoTextArea, BotChip } from './parts'@@ -137,10 +139,10 @@ export function NewChatView({ group, onClose }: { group: boolean; onClose: () =>}, [])return (- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' }}>- <div className="drag" style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '12px 22px', ...font('title3') }}>- <span style={{ color: 'var(--secondary)', flex: 'none' }}>To:</span>- <div ref={chips} className="chip-row no-drag" style={{ flex: 1 }}>+ <SheetPage>+ <HStack gap={8} className="drag compose-to">+ <Text tone="secondary" className="compose-to-label">To:</Text>+ <div ref={chips} className="chip-row no-drag">{picked.map((bot) => (<BotChip key={bot.id} bot={bot} onRemove={() => remove(bot.id)} />))}@@ -148,7 +150,7 @@ export function NewChatView({ group, onClose }: { group: boolean; onClose: () =>ref={toField}value={query}placeholder={toPrompt}- style={{ minWidth: 200, flex: 1, color: 'var(--text)', userSelect: 'text' }}+ className="compose-to-input"onChange={(e) => setQuery(e.target.value)}onKeyDown={(e) => {if (e.nativeEvent.isComposing || e.keyCode === 229) return@@ -164,12 +166,12 @@ export function NewChatView({ group, onClose }: { group: boolean; onClose: () =>/></div><IconButton title="Close" icon="xmark" className="no-drag" onClick={onClose} />- </div>- <div className="hairline" />+ </HStack>+ <Hairline /><div className="compose-list"><PickRow shortcut={1} onClick={create} icon={- <span style={{ width: 26, height: 26, borderRadius: '50%', background: 'var(--bubble-agent)', display: 'grid', placeItems: 'center' }}>+ <span className="compose-create-icon"><Icon key={creating ? 'hourglass' : 'plus'} name={creating ? 'hourglass' : 'plus'} size={13} weight="medium" className="fade-in" /></span>}>@@ -182,7 +184,7 @@ export function NewChatView({ group, onClose }: { group: boolean; onClose: () =>))}</div>- <div style={{ flex: 1 }} />+ <Spacer /><div className="compose-box"><AutoTextArea@@ -200,7 +202,7 @@ export function NewChatView({ group, onClose }: { group: boolean; onClose: () =>}}/></div>- </div>+ </SheetPage>)}@@ -208,12 +210,12 @@ function PickRow({ shortcut, onClick, icon, children }: { shortcut: number | nulreturn (<button className="press pick-row hover fade-in" onClick={onClick}>{icon}- <span style={{ flex: 1, minWidth: 0, color: 'var(--text)', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{children}</span>+ <Text tone="text" truncate grow>{children}</Text>{shortcut !== null ? (- <span style={{ display: 'flex', gap: 3 }}>+ <HStack as="span" align="stretch" gap={3}><span className="key-cap">⌘</span><span className="key-cap">{shortcut}</span>- </span>+ </HStack>) : null}</button>)diff --git a/apps/desktop/src/renderer/views/bots/bots.css b/apps/desktop/src/renderer/views/bots/bots.cssindex 888817d1..6664bcc9 100644--- a/apps/desktop/src/renderer/views/bots/bots.css+++ b/apps/desktop/src/renderer/views/bots/bots.css@@ -18,6 +18,12 @@ textarea.field-box {.field-box:focus {outline: 2px solid var(--secondary);}+/* A custom agent's command. */+.bot-command {+ font-size: var(--text-callout);+ font-weight: 400;+ font-family: var(--mono);+}.bot-form {height: 100%;@@ -29,7 +35,80 @@ textarea.field-box {flex-direction: column;gap: 24px;padding: 14px;- font-size: calc(12px * var(--scale));+ font-size: var(--text-callout);+}+.bot-editor-body {+ flex: 1;+ min-height: 0;+}+.workspace-pill-label {+ max-width: 160px;+}+/* A plugin's switch beside its info button. */+.plugin-toggle {+ flex: 1;+ min-width: 0;+}++/* The model row and its options (AgentModelPicker). */+.model-picker-label {+ white-space: nowrap;+}+/* Loading and refresh share one fixed slot. */+.model-picker-slot {+ display: grid;+ place-items: center;+ flex: none;+ width: 28px;+ height: 28px;+}+.model-picker-slot > * {+ grid-area: 1 / 1;+}+.model-picker-refresh {+ transition: opacity var(--fade);+}+.model-picker-refresh.hidden {+ opacity: 0;+ pointer-events: none;+}+.model-picker-input {+ width: 142px;+ max-width: 100%;+ min-width: 0;+ text-align: right;+ color: var(--text);+ user-select: text;+}++/* Folder picker (FolderPicker). */+.folder-back {+ padding-left: 10px;+}+.folder-title {+ flex: 1;+ min-width: 0;+}+.folder-levels {+ flex: 1;+ min-height: 0;+ overflow: hidden;+}+.folder-level-content {+ gap: 14px;+}+.folder-use {+ display: flex;+ align-items: center;+ gap: 8px;+ font-size: var(--text-body);+ font-weight: 700;+ color: var(--accent);+}+.folder-row {+ display: flex;+ align-items: center;+ gap: 10px;}.avatar-button {@@ -42,6 +121,10 @@ textarea.field-box {padding: 5px;border-radius: var(--radius-s);}+.avatar-picker-panel {+ width: 300px;+ padding: 14px;+}/* A selectable avatar shape or color, ringed when chosen. */.swatch {@@ -61,6 +144,12 @@ textarea.field-box {padding: 4px;overflow-x: auto;}+.swatch-color {+ display: block;+ width: 26px;+ height: 26px;+ border-radius: 50%;+}/* A picked bot: To: field and group editor. */.bot-chip {@@ -73,6 +162,15 @@ textarea.field-box {flex: none;animation: chip-in var(--layout) both;}+.bot-chip-name {+ max-width: 220px;+}+.bot-chip-remove {+ display: grid;+ place-items: center;+ width: 18px;+ height: 18px;+}@keyframes chip-in {from {opacity: 0;@@ -81,6 +179,7 @@ textarea.field-box {}.chip-row {display: flex;+ flex: 1;align-items: center;gap: 6px;overflow-x: auto;@@ -109,7 +208,31 @@ textarea.field-box {background: var(--background);color: var(--secondary);font-family: var(--mono);- font-size: calc(11px * var(--scale));+ font-size: var(--text-caption);+}++/* The new message page's To: row (NewChatView). */+.compose-to {+ padding: 12px 22px;+ font-size: var(--text-title3);+ font-weight: 400;+}+.compose-to-label {+ flex: none;+}+.compose-to-input {+ flex: 1;+ min-width: 200px;+ color: var(--text);+ user-select: text;+}+.compose-create-icon {+ display: grid;+ place-items: center;+ width: 26px;+ height: 26px;+ border-radius: 50%;+ background: var(--bubble-agent);}.compose-list {@@ -161,7 +284,51 @@ textarea.field-box {}}+/* Create template (BotTemplateView). */+.bot-template {+ width: 560px;+ height: 540px;+ background: var(--background);+}+.bot-template-body {+ flex: 1;+ min-height: 0;+ padding: 0 24px 24px;+}+.bot-template-code {+ flex: 1;+ min-height: 0;+ overflow-y: auto;+ background: var(--surface);+ border-radius: var(--radius-m);+}+.bot-template-code pre {+ margin: 0;+ padding: 16px;+ font-family: var(--mono);+ font-size: var(--text-callout);+ font-weight: 400;+ white-space: pre-wrap;+ word-break: break-word;+}+.bot-template-copy {+ display: flex;+ align-items: center;+ gap: 6px;+ padding: 9px 14px;+ border-radius: 9px;+ background: var(--accent-fill);+ color: var(--on-accent);+ font-size: var(--text-body);+ font-weight: 600;+}+/* Group editor (Grok Bot's group details): identity on top, then a plain member list. */+.group-scroll {+ flex: 1;+ min-height: 0;+ overflow-y: auto;+}.group-form {display: flex;flex-direction: column;@@ -183,12 +350,12 @@ textarea.field-box {resize: none;}.group-name {- font-size: calc(22px * var(--scale));+ font-size: var(--text-title);font-weight: 600;margin-top: 6px;}.group-about {- font-size: calc(13px * var(--scale));+ font-size: var(--text-body);color: var(--secondary);line-height: 1.35;}@@ -196,8 +363,21 @@ textarea.field-box {.group-about::placeholder {color: var(--tertiary);}+.group-search {+ margin: 6px 0;+ background: var(--surface);+}+.group-note {+ padding: 10px 0 0;+}+.group-delete {+ align-self: flex-start;+ font-size: var(--text-body);+ font-weight: 400;+ color: var(--danger);+}.group-section-title {- font-size: calc(13px * var(--scale));+ font-size: var(--text-body);font-weight: 600;color: var(--secondary);padding-bottom: 4px;@@ -225,6 +405,11 @@ button.member-row:hover {overflow: hidden;text-overflow: ellipsis;}+.member-add-icon {+ display: grid;+ place-items: center;+ width: 32px;+}/* A member row that opens the bot's chat, with a remove button shown on hover. */.member-row.removable:hover {@@ -247,3 +432,11 @@ button.member-row:hover {.member-row.removable:focus-within > :last-child {opacity: 1;}+.model-picker-pill {+ min-width: 0;+ max-width: 160px;+}+.workspace-pill {+ gap: 6px;+ color: var(--text);+}diff --git a/apps/desktop/src/renderer/views/bots/memory.css b/apps/desktop/src/renderer/views/bots/memory.cssindex 69d17d25..8707f8bd 100644--- a/apps/desktop/src/renderer/views/bots/memory.css+++ b/apps/desktop/src/renderer/views/bots/memory.css@@ -16,7 +16,7 @@.memory-editor textarea { padding: 10px; background: var(--surface); color: var(--text); border: 0; border-radius: var(--radius-s); font: inherit; resize: vertical; }.memory-history { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; user-select: text; margin: 0; }.memory-error { color: var(--danger); white-space: pre-wrap; }-.memory-notes-header { display: flex; align-items: center; justify-content: space-between; color: var(--secondary); font-size: calc(12px * var(--scale)); font-weight: 600; }+.memory-notes-header { display: flex; align-items: center; justify-content: space-between; color: var(--secondary); font-size: var(--text-callout); font-weight: 600; }.memory-attention { color: var(--attention); }.memory-file-sheet { display: flex; flex-direction: column; height: 100%; background: var(--background); }-.memory-file-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; font: calc(12px * var(--scale))/1.5 var(--mono); }+.memory-file-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; font: var(--text-callout)/1.5 var(--mono); }diff --git a/apps/desktop/src/renderer/views/bots/parts.tsx b/apps/desktop/src/renderer/views/bots/parts.tsxindex 82e54a55..ff4d19a0 100644--- a/apps/desktop/src/renderer/views/bots/parts.tsx+++ b/apps/desktop/src/renderer/views/bots/parts.tsx@@ -1,24 +1,22 @@-import { useEffect, useId, useLayoutEffect, useRef, useState, type ReactNode, type RefObject } from 'react'+import { useId, useLayoutEffect, useRef, useState, type ReactNode, type RefObject } from 'react'import { createPortal } from 'react-dom'import type { Bot } from '@shared/models'import { BotAvatar } from '../../components/Avatar'-import { Switch } from '../../components/Controls'+import { RowLabel, Switch } from '../../components/Controls'import { Icon } from '../../components/Icon'-import { usePresence } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { anchorPlacement, useEscape, usePresence } from '../../components/Overlay'+import { VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import './bots.css'/** A labeled input inside a section row: label (and an optional note) over the field, which they name. */export function Field({ label, detail, children }: { label: string; detail?: string | null; children: ReactNode }) {const id = useId()return (- <div role="group" aria-labelledby={`${id}-label`} aria-describedby={detail ? `${id}-detail` : undefined} style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>- <div style={{ display: 'flex', flexDirection: 'column', gap: 3 }}>- <span id={`${id}-label`} style={{ color: 'var(--text)' }}>{label}</span>- {detail ? <span id={`${id}-detail`} className="detail-note" title={detail} style={{ ...font('caption'), color: 'var(--secondary)', lineHeight: 1.35 }}>{detail}</span> : null}- </div>+ <VStack gap={8} role="group" aria-labelledby={`${id}-label`} aria-describedby={detail ? `${id}-detail` : undefined}>+ <RowLabel label={label} detail={detail} labelId={`${id}-label`} detailId={`${id}-detail`} />{children}- </div>+ </VStack>)}@@ -26,10 +24,7 @@ export function Field({ label, detail, children }: { label: string; detail?: strexport function SwitchRow({ title, detail, on, onChange }: { title: string; detail?: string | null; on: boolean; onChange: (on: boolean) => void }) {return (<Switch on={on} onChange={onChange}>- <span style={{ display: 'flex', flexDirection: 'column', gap: 3 }}>- <span style={{ color: 'var(--text)' }}>{title}</span>- {detail ? <span className="detail-note" title={detail} style={{ ...font('caption'), color: 'var(--secondary)', lineHeight: 1.35 }}>{detail}</span> : null}- </span>+ <RowLabel label={title} detail={detail} /></Switch>)}@@ -62,8 +57,8 @@ export function BotChip({ bot, onRemove }: { bot: Bot; onRemove: () => void }) {return (<span className="bot-chip"><BotAvatar bot={bot} size={20} animated={false} />- <span style={{ ...font('body'), color: 'var(--text)', maxWidth: 220, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{bot.name}</span>- <button style={{ width: 18, height: 18, display: 'grid', placeItems: 'center' }} aria-label={`Remove ${bot.name}`} title={`Remove ${bot.name}`} onClick={onRemove}>+ <Text size="body" tone="text" truncate className="bot-chip-name">{bot.name}</Text>+ <button className="bot-chip-remove" aria-label={`Remove ${bot.name}`} title={`Remove ${bot.name}`} onClick={onRemove}><Icon name="xmark" size={10} weight="semibold" color="var(--secondary)" /></button></span>@@ -77,34 +72,11 @@ export function AnchoredPanel({ open, onClose, anchor, children }: { open: booleuseLayoutEffect(() => {if (open && anchor.current) setRect(anchor.current.getBoundingClientRect())}, [open, anchor])- useEffect(() => {- if (!open) return- const onKey = (e: KeyboardEvent) => {- if (e.key !== 'Escape') return- e.preventDefault()- e.stopPropagation()- onClose()- }- window.addEventListener('keydown', onKey, true)- return () => window.removeEventListener('keydown', onKey, true)- }, [open, onClose])+ useEscape(open, onClose)if (!mounted || !rect) return null- const W = window.innerWidth- const H = window.innerHeight- const below = H - rect.bottom >= rect.top- const leading = rect.left + rect.width / 2 < W * 0.6- const inset = Math.max(8, W - Math.min(320, W - 16) - 8)return createPortal(<div className={`anchored ${shown ? 'shown' : ''}`} onMouseDown={(e) => e.target === e.currentTarget && onClose()}>- <div- className="anchored-panel"- style={{- position: 'absolute',- [below ? 'top' : 'bottom']: below ? rect.bottom + 6 : H - rect.top + 6,- ...(leading ? { left: Math.min(Math.max(8, rect.left), inset) } : { right: Math.min(Math.max(8, W - rect.right), inset) }),- transformOrigin: `${below ? 'top' : 'bottom'} ${leading ? 'left' : 'right'}`,- }}- >+ <div className="anchored-panel" style={anchorPlacement(rect).style}>{children}</div></div>,diff --git a/apps/desktop/src/renderer/views/call/CallView.tsx b/apps/desktop/src/renderer/views/call/CallView.tsxindex a8f2275e..562ad3ee 100644--- a/apps/desktop/src/renderer/views/call/CallView.tsx+++ b/apps/desktop/src/renderer/views/call/CallView.tsx@@ -3,7 +3,7 @@ import { createContext, useContext, useEffect, useRef, useState } from 'react'import { BotAvatar } from '../../components/Avatar'import { Icon } from '../../components/Icon'import { Sheet } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { Text } from '../../components/Text'import { useModel } from '../../lib/observable'import { avatarColor, useDark, useReduceMotion, withAlpha } from '../../lib/theme'import { useStore } from '../../store/context'@@ -186,14 +186,14 @@ export function CallView({ botId, onSpeaking, interrupt, onEnd }: {title={speaking ? 'Interrupt' : undefined}onClick={() => session?.interrupt()}>- {bot ? <BotAvatar bot={bot} size={34} /> : <span style={{ width: 34, height: 34 }} />}+ {bot ? <BotAvatar bot={bot} size={34} /> : <span className="call-avatar-empty" />}</button><CallLevelDots engine={session} working={working} color={color} label={statusText} />{/* Audio leaves the computer: say where. */}{session?.provider ? (- <span style={{ ...font('caption2', 'semibold'), color: 'var(--secondary)' }} aria-label={`Voice by ${providerName(session.provider)}`}>+ <Text size="caption2" weight="semibold" tone="secondary" aria-label={`Voice by ${providerName(session.provider)}`}>{providerName(session.provider)}- </span>+ </Text>) : null}<button className="call-round" title="Call settings" aria-label="Call settings" onClick={() => (openVoiceSettings ? openVoiceSettings() : setSettings(true))}><Icon name="gearshape" size={16} weight="medium" scaled={false} />@@ -211,13 +211,13 @@ export function CallView({ botId, onSpeaking, interrupt, onEnd }: {</button></div>{failure ? (- <div key="failure" className="call-line" style={{ color: 'var(--danger)' }}>+ <Text as="div" key="failure" tone="danger" className="call-line">{failure}- </div>+ </Text>) : notice ? (- <div key={notice} className="call-line" style={{ color: 'var(--secondary)' }}>+ <Text as="div" key={notice} tone="secondary" className="call-line">{notice}- </div>+ </Text>) : null}<Sheet open={settings} onClose={() => setSettings(false)}><VoiceChatSettingsView />@@ -275,5 +275,5 @@ function CallLevelDots({ engine, working, color, label }: { engine: VoiceEnginereturn () => cancelAnimationFrame(frame)}, [])- return <canvas ref={canvas} role="img" aria-label={label} style={{ width: DOTS_WIDTH, height: DOTS_HEIGHT, flex: 'none' }} />+ return <canvas ref={canvas} role="img" aria-label={label} className="call-dots" style={{ width: DOTS_WIDTH, height: DOTS_HEIGHT }} />}diff --git a/apps/desktop/src/renderer/views/call/call.css b/apps/desktop/src/renderer/views/call/call.cssindex f305b521..920c47ae 100644--- a/apps/desktop/src/renderer/views/call/call.css+++ b/apps/desktop/src/renderer/views/call/call.css@@ -26,6 +26,10 @@display: flex;transition: transform var(--layout);}+.call-avatar-empty {+ width: 34px;+ height: 34px;+}.call-avatar.speaking {animation: call-pulse 0.6s ease-in-out infinite alternate;}@@ -35,6 +39,11 @@}}+/* Sized in CallView, where the drawing uses the same numbers. */+.call-dots {+ flex: none;+}+.call-round {width: 40px;height: 40px;@@ -60,7 +69,7 @@/* One line under the bar: why the call fell back, or why it can't listen. */.call-line {- font-size: calc(11px * var(--scale));+ font-size: var(--text-caption);text-align: center;padding: 8px 12px;border-radius: var(--radius-pill);diff --git a/apps/desktop/src/renderer/views/chat-window.css b/apps/desktop/src/renderer/views/chat-window.cssindex 06ce5890..970b98cd 100644--- a/apps/desktop/src/renderer/views/chat-window.css+++ b/apps/desktop/src/renderer/views/chat-window.css@@ -15,11 +15,47 @@justify-content: center;gap: 10px;}+.empty-state-message {+ max-width: 360px;+ text-align: center;+}+.empty-state.local-recovery .empty-state-message {+ text-align: left;+}+.empty-state-action {+ margin-top: 4px;+}++/* The version mismatch notice above a computer's bots (UpdateNeededCard). */+.update-needed {+ padding: 14px;+ background: var(--surface);+ border-radius: var(--radius-l);+}+.update-needed-action {+ margin-top: 4px;+ align-self: flex-start;+}++/* The GitHub star ask (StarPrompt). */+.star-prompt {+ width: 420px;+}+.star-prompt-body {+ padding: 0 24px 24px;+}+.star-prompt-message {+ text-align: center;+}.split {display: flex;height: 100%;}+/* An open account panel or action menu takes the clicks. */+.split.covered {+ pointer-events: none;+}.sidebar {position: relative;@@ -39,10 +75,24 @@align-items: center;gap: 6px;height: 54px;+ padding-left: 18px;padding-right: 14px;flex: none;transition: opacity var(--layout), padding var(--layout);}+/* Clears the traffic lights. */+html[data-platform="darwin"] .sidebar-header {+ padding-left: 80px;+}+.sidebar.compact .sidebar-header {+ padding-left: 0;+ opacity: 0;+}+/* The rail's computer filter. */+.rail-header {+ width: 70px;+ align-self: center;+}.roster {flex: 1;@@ -63,11 +113,51 @@}.roster-row {width: 100%;+ padding: 0 8px;border-radius: var(--radius-m);display: flex;transition: background-color var(--hover);flex: none;}+.roster-row.compact {+ padding: 0;+}+/* Hover is tracked in JS: a held row stays highlighted while it's dragged. */+.roster-row.hovered {+ background: var(--bubble-agent);+}+.roster-row.selected {+ background: var(--roster-selected);+}+.bot-row {+ padding: 9px 0;+ width: 100%;+}+.bot-row-text {+ flex: 1;+ min-width: 0;+ overflow: hidden;+ line-height: calc(16px * var(--scale));+ transition: opacity var(--layout);+}+.bot-row-text.collapsed {+ flex: none;+ width: 0;+ opacity: 0;+}+.unread-badge {+ display: grid;+ place-items: center;+ flex: none;+ min-width: 18px;+ height: 18px;+ padding: 0 6px;+ border-radius: var(--radius-pill);+ background: var(--accent-fill);+ color: var(--on-accent);+ font-size: var(--text-caption);+ font-weight: 600;+}/* A selected row's fill doesn't touch its hovered neighbour's. */.roster-row + .roster-row {margin-top: 4px;@@ -84,6 +174,7 @@}.profile-avatar {+ position: relative;width: 28px;height: 28px;border-radius: 50%;@@ -91,6 +182,16 @@display: grid;place-items: center;flex: none;+ overflow: hidden;+}+.profile-avatar-image {+ width: 100%;+ height: 100%;+ object-fit: cover;+}+.profile-avatar-busy {+ position: absolute;+ inset: 0;}.rail-actions {@@ -109,6 +210,9 @@place-items: center;margin-top: 4px;}+.rail-profile.open {+ background: var(--bubble-agent);+}.detail {@@ -123,6 +227,12 @@flex-direction: column;height: 100%;}+/* Which computer a new chat goes to (ComputerPicker). */+.compose-computer {+ padding: 12px 22px 0;+ font-size: var(--text-callout);+ font-weight: 400;+}/* The title bar strip of detail views that draw no top chrome of their own, so the windowstill moves from there. */.detail-drag {@@ -141,6 +251,13 @@justify-content: center;gap: 14px;}+.empty-detail-crew > :not(:first-child) {+ margin-left: -10px;+}+.empty-detail-message {+ max-width: 420px;+ text-align: center;+}.context-layer {position: fixed;@@ -158,9 +275,15 @@animation: panel-in var(--fade) both;}.account-panel {+ left: 16px;+ bottom: 64px;border-radius: var(--radius-l);transform-origin: bottom left;}+/* Above the rail's profile button. */+.account-panel.compact {+ bottom: 68px;+}.action-menu {width: 260px;border-radius: var(--radius-l);@@ -179,6 +302,10 @@height: 30px;padding: 0 10px;border-radius: var(--radius-s);+ color: var(--text);+}+.panel-row.destructive {+ color: var(--danger);}.panel-row.highlight {background: rgba(var(--text-rgb), 0.08);@@ -199,6 +326,9 @@padding: 0 10px;color: var(--secondary);}+.panel-error {+ padding: 8px 10px;+}/* Welcome, computer access and host state fill the window with no chrome: their top edge moves it. */.window-drag {diff --git a/apps/desktop/src/renderer/views/computer-access/computer-access.css b/apps/desktop/src/renderer/views/computer-access/computer-access.cssindex 90868041..c62c2c14 100644--- a/apps/desktop/src/renderer/views/computer-access/computer-access.css+++ b/apps/desktop/src/renderer/views/computer-access/computer-access.css@@ -8,12 +8,12 @@.computer-access-identity { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }.computer-access-identity img { flex: none; }.computer-access-identity div { display: grid; gap: 3px; min-width: 0; }-.computer-access-identity span { color: var(--secondary); font-size: calc(11px * var(--scale)); }-.computer-access-identity strong { font-size: calc(12px * var(--scale)); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }-.computer-access h1 { font-size: calc(26px * var(--scale)); letter-spacing: -.65px; line-height: 1.2; font-weight: 600; margin: 0 0 10px; text-wrap: balance; }-.computer-access p { color: var(--secondary); font-size: calc(12px * var(--scale)); line-height: 1.6; margin: 0; text-wrap: pretty; }-.computer-access-header > p { font-size: calc(13px * var(--scale)); max-width: 480px; }-.computer-access-section-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: calc(11px * var(--scale)); color: var(--secondary); }+.computer-access-identity span { color: var(--secondary); font-size: var(--text-caption); }+.computer-access-identity strong { font-size: var(--text-callout); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+.computer-access h1 { font-size: var(--text-large-title); letter-spacing: -.65px; line-height: 1.2; font-weight: 600; margin: 0 0 10px; text-wrap: balance; }+.computer-access p { color: var(--secondary); font-size: var(--text-callout); line-height: 1.6; margin: 0; text-wrap: pretty; }+.computer-access-header > p { font-size: var(--text-body); max-width: 480px; }+.computer-access-section-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: var(--text-caption); color: var(--secondary); }.computer-access-section-label > :first-child { color: var(--text); font-weight: 500; }.computer-access-section-label > :last-child { display: inline-flex; align-items: center; gap: 4px; margin-right: -4px; }/* The requested outline matches the desktop toolbar/composer treatment; outlined, so no fill. */@@ -25,27 +25,27 @@.computer-access-row.current .computer-access-badge { background: rgba(var(--text-rgb), .12); color: var(--text); }.computer-access-row.granted .computer-access-badge { background: var(--accent-fill); color: var(--on-accent); }.computer-access-row-body { flex: 1; min-width: 0; }-.computer-access h2 { font-size: calc(13px * var(--scale)); line-height: 28px; font-weight: 600; margin: 0; transition: color var(--fade); }+.computer-access h2 { font-size: var(--text-body); line-height: 28px; font-weight: 600; margin: 0; transition: color var(--fade); }/* A step that can't be acted on yet recedes. */.computer-access-row.waiting:not(:has(button)) h2 { color: var(--secondary); }.computer-access-row.waiting:not(:has(button)) p { color: var(--tertiary); }.computer-access-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }.computer-access-actions:not(:empty) { margin-top: 12px; }-.computer-access .styled-button { min-height: 30px; font-size: calc(11px * var(--scale)); padding: 6px 12px; }+.computer-access .styled-button { min-height: 30px; font-size: var(--text-caption); padding: 6px 12px; }.computer-access .styled-button.secondary { background: transparent; border: 1px solid var(--stroke-strong); }.computer-access .styled-button.secondary:hover:not(:disabled) { background: var(--chrome-fill); }.computer-access .styled-button:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }-.computer-access .computer-access-inline-note { flex-basis: 100%; font-size: calc(11px * var(--scale)); margin-bottom: 2px; }+.computer-access .computer-access-inline-note { flex-basis: 100%; font-size: var(--text-caption); margin-bottom: 2px; }.computer-access-inline-note strong { font-weight: 500; color: var(--text); }.computer-access-notes { display: grid; gap: 8px; list-style: none; margin: 24px 0 0; padding: 0; color: var(--tertiary); }.computer-access-notes li { display: flex; align-items: flex-start; gap: 8px; }.computer-access-notes li > :first-child { margin-top: 2px; flex: none; }-.computer-access .computer-access-notes p { font-size: calc(11px * var(--scale)); color: var(--tertiary); }+.computer-access .computer-access-notes p { font-size: var(--text-caption); color: var(--tertiary); }.computer-access-footer { display: flex; justify-content: flex-end; margin-top: 24px; }.computer-access-notice { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--stroke-strong); border-radius: var(--radius-m); padding: 12px 14px; margin-bottom: 20px; }.computer-access-notice > :first-child { margin-top: 2px; color: var(--secondary); }-.computer-access-notice strong { font-size: calc(12px * var(--scale)); font-weight: 500; }-.computer-access-notice p { font-size: calc(11px * var(--scale)); margin-top: 3px; }+.computer-access-notice strong { font-size: var(--text-callout); font-weight: 500; }+.computer-access-notice p { font-size: var(--text-caption); margin-top: 3px; }.computer-access-notice.error { border-color: var(--danger); }.computer-access-notice.error strong, .computer-access-notice.error > :first-child { color: var(--danger); }@media (max-width: 440px) {diff --git a/apps/desktop/src/renderer/views/computer-badge.css b/apps/desktop/src/renderer/views/computer-badge.cssnew file mode 100644index 00000000..7f7390d4--- /dev/null+++ b/apps/desktop/src/renderer/views/computer-badge.css@@ -0,0 +1,11 @@+/* A computer's icon (ComputerBadge); its size and color come from the computer. */+.computer-badge {+ display: grid;+ place-items: center;+ flex: none;+}+.computer-badge-linux {+ -webkit-mask-size: contain;+ -webkit-mask-repeat: no-repeat;+ -webkit-mask-position: center;+}diff --git a/apps/desktop/src/renderer/views/computer-roster.css b/apps/desktop/src/renderer/views/computer-roster.cssindex e7c8e0f6..2c6854b9 100644--- a/apps/desktop/src/renderer/views/computer-roster.css+++ b/apps/desktop/src/renderer/views/computer-roster.css@@ -37,7 +37,7 @@min-width: 0;align-items: baseline;gap: 6px;- font-size: calc(11px * var(--scale));+ font-size: var(--text-caption);text-align: left;}@@ -49,7 +49,7 @@.computer-roster-label > span {color: var(--tertiary);- font-size: calc(11px * var(--scale));+ font-size: var(--text-caption);white-space: nowrap;}@@ -87,7 +87,7 @@.computer-roster-empty {padding: 8px 10px 12px;color: var(--tertiary);- font-size: calc(11px * var(--scale));+ font-size: var(--text-caption);}.sidebar.compact .computer-roster-toggle {diff --git a/apps/desktop/src/renderer/views/island/IslandUsage.tsx b/apps/desktop/src/renderer/views/island/IslandUsage.tsxindex b86b6316..0a6baeab 100644--- a/apps/desktop/src/renderer/views/island/IslandUsage.tsx+++ b/apps/desktop/src/renderer/views/island/IslandUsage.tsx@@ -1,6 +1,6 @@import type { UsageProvider, UsageWindow } from '@shared/models'import { prefs, usePref } from '../../lib/prefs'-import { UsageBar } from '../settings/UsageLimits'+import { UsageBar } from '../usage/UsageBar'import { mascotDataURL } from '../usage/ProviderMascot'import { providerTintCSS, resetDescription, tightest, windowTitle } from '../usage/usage-model'import type { IslandModel } from './island-model'@@ -12,7 +12,7 @@ import type { IslandModel } from './island-model'function Mascot({ provider, size }: { provider: UsageProvider; size: number }) {const [style] = usePref(prefs.usageIconStyle)const src = mascotDataURL(provider, size, style, true)- return src ? <img src={src} alt="" width={size} height={size} style={{ flex: 'none' }} /> : null+ return src ? <img src={src} alt="" width={size} height={size} className="island-mascot" /> : null}/** The limit closest to running out, across providers. */diff --git a/apps/desktop/src/renderer/views/island/IslandViews.tsx b/apps/desktop/src/renderer/views/island/IslandViews.tsxindex b4a0da54..b6b9c077 100644--- a/apps/desktop/src/renderer/views/island/IslandViews.tsx+++ b/apps/desktop/src/renderer/views/island/IslandViews.tsx@@ -45,7 +45,7 @@ export function Wings({ model, peek }: { model: IslandModel; peek: boolean }) {))}</span>) : focus.status === 'needsInput' ? (- <span className="island-dot" style={{ background: AMBER }} />+ <span className="island-dot needs-you" />) : (<ThinkingOrb size={14} color="#F5F6F8" />)}@@ -67,7 +67,7 @@ export function Overview({ model }: { model: IslandModel }) {const steps = focus.steps.length ? focus.steps : [{ title: focus.detail, kind: 'other' }]return (<div className="island-row-cards">- <button className="island-card island-focus" style={others.length ? { width: 322 } : { flex: 1 }} onClick={() => model.openBot(focus.ref)} title="Open conversation">+ <button className={`island-card island-focus ${others.length ? '' : 'alone'}`} onClick={() => model.openBot(focus.ref)} title="Open conversation"><span key={focus.ref} className={`island-swap-slot ${swap}`}><BigCharacter bot={focus} size={70} mood={moodOf(focus)} badge={badgeOf(focus)} /><span className="island-focus-text">@@ -75,7 +75,7 @@ export function Overview({ model }: { model: IslandModel }) {{steps.map((step, i) => (<span key={`${i}-${step.title}`} className={`island-step ${i === steps.length - 1 ? 'current' : ''}`}><Icon name={stepIcon(step.kind)} size={i === steps.length - 1 ? 13 : 12} scaled={false} />- <span className="island-ellipsis">{step.title}</span>+ <span className="truncate">{step.title}</span></span>))}</span>@@ -96,7 +96,7 @@ export function Overview({ model }: { model: IslandModel }) {<CharacterAvatar shape={b.shape} color={b.color} size={24} mood={moodOf(b)} dark /><StatusDot bot={b} /></span>- <span className="island-ellipsis">{b.name}</span>+ <span className="truncate">{b.name}</span></button>))}</div>@@ -166,7 +166,7 @@ export function Notice({ model, bot, failed }: { model: IslandModel; bot: Island<div className="island-error">{bot.error ?? bot.detail}</div></>) : (- <div className="island-title island-ellipsis">{bot.detail}</div>+ <div className="island-title truncate">{bot.detail}</div>)}<div className="island-buttons start"><Button onClick={() => model.openBot(bot.ref)}>Open conversation</Button>diff --git a/apps/desktop/src/renderer/views/island/island-views.css b/apps/desktop/src/renderer/views/island/island-views.cssindex e7dae4b8..06d140bf 100644--- a/apps/desktop/src/renderer/views/island/island-views.css+++ b/apps/desktop/src/renderer/views/island/island-views.css@@ -85,6 +85,9 @@border-radius: 50%;flex: none;}+.island-dot.needs-you {+ background: var(--warning);+}.island-agent-name {font-size: 14px;font-weight: 600;@@ -98,15 +101,10 @@text-overflow: ellipsis;min-width: 0;}-.island-ellipsis {- white-space: nowrap;- overflow: hidden;- text-overflow: ellipsis;- min-width: 0;-}/* Overview: the bot in focus and its steps, the others as pills. */.island-focus {+ width: 322px;display: flex;align-items: center;gap: 13px;@@ -114,6 +112,11 @@text-align: left;font: inherit;}+/* No other bots beside it: it takes the whole row. */+.island-focus.alone {+ width: auto;+ flex: 1;+}.island-focus-text {flex: 1;min-width: 0;@@ -281,6 +284,9 @@background: var(--island-fill);color: var(--text);}+.island-mascot {+ flex: none;+}.island-meter-bar {width: 28px;display: flex;diff --git a/apps/desktop/src/renderer/views/island/island.css b/apps/desktop/src/renderer/views/island/island.cssindex d21a859d..25c9bdb8 100644--- a/apps/desktop/src/renderer/views/island/island.css+++ b/apps/desktop/src/renderer/views/island/island.css@@ -23,8 +23,8 @@ html[data-window='island'] #root {--island-fill: rgba(255, 255, 255, 0.08);--island-quiet: #6b7079;/* A spring with a little overshoot to open, a plain ease to fold. */- --island-spring: var(--island-spring);- --island-fold: var(--island-fold);+ --island-spring: cubic-bezier(0.32, 1.22, 0.42, 1);+ --island-fold: cubic-bezier(0.45, 0, 0.2, 1);--scale: 1;position: absolute;top: 0;diff --git a/apps/desktop/src/renderer/views/marketplace/AgentSheet.tsx b/apps/desktop/src/renderer/views/marketplace/AgentSheet.tsxindex 86dbea0d..d95547f6 100644--- a/apps/desktop/src/renderer/views/marketplace/AgentSheet.tsx+++ b/apps/desktop/src/renderer/views/marketplace/AgentSheet.tsx@@ -3,12 +3,13 @@ import type { Backend } from '@shared/models'import { agentIconURL } from '../../components/AgentIcon'import { Button, CardForm, CardSection, IconButton, Spinner } from '../../components/Controls'import { Icon } from '../../components/Icon'-import { ModalHeader } from '../../components/Overlay'+import { ModalHeader, SheetPage } from '../../components/Overlay'+import { HStack, IconSlot, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { ThinkingOrb } from '../../components/ThinkingOrb'-import { font } from '../../lib/fonts'import { useStore } from '../../store/context'import { errorText, market, type AgentAuth, type AuthMethod } from './market-models'-import { ErrorText, Field, ScreenHeader, SlideStack, WebLink, filled, lineClamp } from './pieces'+import { ErrorText, Field, ScreenHeader, SlideStack, WebLink, filled } from './pieces'import { SetupTerminalView } from './SetupTerminal'type SetupRoute = { kind: 'install' } | { kind: 'node' } | { kind: 'terminal'; method: AuthMethod | null } | { kind: 'keys'; method: AuthMethod }@@ -32,7 +33,7 @@ export function agentTint(registry: string | null | undefined) {/** An agent's registry logo on a rounded tile. */export function AgentTile({ registry, icon, tile, radius }: { registry?: string | null; icon: number; tile: number; radius: number }) {return (- <div style={{ width: tile, height: tile, flex: 'none', borderRadius: radius, background: 'var(--bubble-agent)', display: 'grid', placeItems: 'center', color: 'var(--text)' }}>+ <div className="agent-tile" style={{ width: tile, height: tile, borderRadius: radius }}><TintedAgentIcon registry={registry} size={icon} /></div>)@@ -45,10 +46,8 @@ function TintedAgentIcon({ registry, size }: { registry?: string | null; size: nreturn (<spanaria-hidden- style={{- display: 'inline-block', width: size, height: size, flex: 'none', background: agentTint(registry),- WebkitMaskImage: `url("${url}")`, WebkitMaskSize: 'contain', WebkitMaskRepeat: 'no-repeat', WebkitMaskPosition: 'center',- }}+ className="agent-icon"+ style={{ width: size, height: size, background: agentTint(registry), WebkitMaskImage: `url("${url}")` }}/>)}@@ -62,10 +61,10 @@ export function NodeNotice({ onAdd }: { onAdd: () => void }) {return (<div className="node-notice fade-in"><Icon name="shippingbox" size={15} color="var(--secondary)" />- <span style={{ display: 'flex', flexDirection: 'column', gap: 2, flex: 1, minWidth: 0 }}>- <span style={{ ...font('subheadline', 'semibold'), color: 'var(--text)' }}>Node.js isn't on {store.hostName}</span>- <span style={{ ...font('caption'), color: 'var(--secondary)' }}>Some agents need it to run. Codync can add a copy just for them.</span>- </span>+ <VStack as="span" gap={2} grow>+ <Text size="subheadline" weight="semibold" tone="text">Node.js isn't on {store.hostName}</Text>+ <Text size="caption" tone="secondary">Some agents need it to run. Codync can add a copy just for them.</Text>+ </VStack><Button onClick={onAdd}>Add Node.js</Button></div>)@@ -155,14 +154,14 @@ export function AgentSheet({ initial, recheck = false }: { initial: Backend; recconst optionRow = (key: string, title: string, detail: string, icon: string, action: () => void, busy = false) => (<button key={key} className="option-row" disabled={authenticating !== null} onClick={action}>- <span aria-hidden style={{ width: 26, display: 'flex', justifyContent: 'center', color: 'var(--secondary)', flex: 'none' }}>+ <IconSlot width={26} tone="secondary" aria-hidden><Icon name={icon} size={13} />- </span>- <span style={{ display: 'flex', flexDirection: 'column', gap: 2, flex: 1, minWidth: 0 }}>- <span style={{ ...font('body', 'medium'), color: 'var(--text)' }}>{title}</span>- <span style={{ ...font('subheadline'), color: 'var(--secondary)', ...lineClamp(3) }}>{detail}</span>- </span>- <span style={{ minWidth: 8 }} />+ </IconSlot>+ <VStack as="span" gap={2} grow>+ <Text size="body" weight="medium" tone="text">{title}</Text>+ <Text size="subheadline" tone="secondary" lines={3}>{detail}</Text>+ </VStack>+ <span className="agent-row-gap" />{busy ? <ThinkingOrb size={16} color="var(--secondary)" /> : <Icon name="chevron.right" size={10} weight="semibold" color="var(--tertiary)" />}</button>)@@ -188,17 +187,17 @@ export function AgentSheet({ initial, recheck = false }: { initial: Backend; rec}const overview = (- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' }}>+ <SheetPage><ModalHeader title={backend.name} /><CardForm><CardSection>- <div style={{ display: 'flex', alignItems: 'center', gap: 14, padding: '4px 0' }}>+ <HStack gap={14} className="market-card-header"><AgentTile registry={backend.registry ?? backend.id} icon={30} tile={52} radius={14} />- <div style={{ display: 'flex', flexDirection: 'column', gap: 2, minWidth: 0 }}>- <span style={font('title3', 'semibold')}>{backend.name}</span>- {backend.description ? <span style={{ ...font('subheadline'), color: 'var(--secondary)', ...lineClamp(3) }}>{backend.description}</span> : null}- </div>- </div>+ <VStack gap={2} shrink>+ <Text size="title3" weight="semibold">{backend.name}</Text>+ {backend.description ? <Text size="subheadline" tone="secondary" lines={3}>{backend.description}</Text> : null}+ </VStack>+ </HStack></CardSection>{curated ? (<CardSection>@@ -227,24 +226,24 @@ export function AgentSheet({ initial, recheck = false }: { initial: Backend; rec? `Browser sign-ins open on ${host} itself. Away from it? Use Remote screen to finish there.`: null}>- <div style={{ display: 'flex', alignItems: 'center' }}>- <div style={{ flex: 1, minWidth: 0 }}>+ <HStack>+ <VStack grow><SetupStepRow number={1 + Number(curated) + Number(backend.node !== undefined)} title="Sign in" detail={statusText} done={signedIn === true} action={null} />- </div>+ </VStack>{checking ? (<ThinkingOrb state="connecting" size={16} color="var(--secondary)" />) : (- <button title="Check again" aria-label="Check again" style={{ display: 'flex', color: 'var(--secondary)' }} onClick={() => void check()}>+ <button title="Check again" aria-label="Check again" className="agent-check-again" onClick={() => void check()}><Icon name="arrow.clockwise" size={13} /></button>)}- </div>- {signedIn !== true && auth?.detail ? <span className="selectable" style={{ ...font('footnote'), color: 'var(--secondary)', whiteSpace: 'pre-wrap' }}>{auth.detail}</span> : null}+ </HStack>+ {signedIn !== true && auth?.detail ? <Text size="footnote" tone="secondary" className="selectable agent-auth-detail">{auth.detail}</Text> : null}{options}</CardSection>{error ? <CardSection><ErrorText text={error} /></CardSection> : null}</CardForm>- </div>+ </SheetPage>)return <SlideStack base={overview} top={routed} />@@ -279,17 +278,17 @@ function AgentKeysForm({ backend, method, saved, back, done }: {const missing = vars.some((v) => !v.optional && !values[v.name] && !saved.includes(v.name))return (- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' }}>+ <SheetPage><ScreenHeadertitle={method.name}onBack={back}trailing={saving ? <Spinner /> : <IconButton title="Save" icon="checkmark" disabled={missing} onClick={() => void save(filled(values))} />}/><CardForm>- <div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>+ <VStack gap={6}><CardSection title={method.name}>{vars.map((v) => (- <div key={v.name} style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>+ <VStack key={v.name} gap={4}><Fieldlabel={v.label}value={values[v.name] ?? ''}@@ -297,26 +296,26 @@ function AgentKeysForm({ backend, method, saved, back, done }: {placeholder={saved.includes(v.name) ? 'Saved (type to replace)' : v.name}onChange={(x) => setValues((old) => ({ ...old, [v.name]: x }))}/>- <span style={{ ...font('caption'), color: 'var(--secondary)' }}>{v.label + (v.optional ? ' (optional)' : '')}</span>- </div>+ <Text size="caption" tone="secondary">{v.label + (v.optional ? ' (optional)' : '')}</Text>+ </VStack>))}</CardSection>- <div style={{ display: 'flex', flexDirection: 'column', gap: 6, padding: '0 4px', ...font('caption'), color: 'var(--tertiary)' }}>+ <VStack gap={6} className="agent-keys-notes">{method.description ? <span>{method.description}</span> : null}<span>Saved on {store.hostName} only and given to {backend.name} when it starts.</span>{method.link && URL.canParse(method.link) ? <WebLink title="Get a key" url={method.link} /> : null}- </div>- </div>+ </VStack>+ </VStack>{saved.length ? (<CardSection>- <button style={{ color: 'var(--danger)' }} onClick={() => void save(Object.fromEntries(vars.map((v) => [v.name, ''])))}>+ <button className="market-danger-button" onClick={() => void save(Object.fromEntries(vars.map((v) => [v.name, ''])))}>Remove saved keys</button></CardSection>) : null}{error ? <CardSection><ErrorText text={error} /></CardSection> : null}</CardForm>- </div>+ </SheetPage>)}@@ -328,22 +327,22 @@ function SetupStepRow({ number, title, detail, done, action }: {action: { label: string; run: () => void } | null}) {return (- <div style={{ display: 'flex', alignItems: 'center', gap: 12, padding: '4px 0' }} aria-label={`${title}. ${detail}${done ? '. Done' : ''}`}>- <span aria-hidden style={{ width: 26, height: 26, borderRadius: '50%', flex: 'none', display: 'grid', placeItems: 'center', background: done ? 'var(--accent-fill)' : 'var(--bubble-agent)', transition: 'background-color var(--fade)' }}>+ <HStack gap={12} className="agent-step-row" aria-label={`${title}. ${detail}${done ? '. Done' : ''}`}>+ <span aria-hidden className={`agent-step-number${done ? ' done' : ''}`}>{done? <Icon name="checkmark" size={10} weight="bold" color="var(--on-accent)" />- : <span style={{ ...font('caption', 'semibold'), color: 'var(--secondary)' }}>{number}</span>}- </span>- <span style={{ display: 'flex', flexDirection: 'column', gap: 2, flex: 1, minWidth: 0 }}>- <span style={{ ...font('body', 'medium'), color: 'var(--text)' }}>{title}</span>- <span className="selectable" style={{ ...font('subheadline'), color: 'var(--secondary)' }}>{detail}</span>+ : <Text size="caption" weight="semibold" tone="secondary">{number}</Text>}</span>- <span style={{ minWidth: 8 }} />+ <VStack as="span" gap={2} grow>+ <Text size="body" weight="medium" tone="text">{title}</Text>+ <Text size="subheadline" tone="secondary" className="selectable">{detail}</Text>+ </VStack>+ <span className="agent-row-gap" />{action ? (- <button className="capsule-action" style={{ ...font('subheadline', 'semibold'), padding: '7px 14px' }} onClick={action.run}>+ <button className="capsule-action agent-step-action" onClick={action.run}>{action.label}</button>) : null}- </div>+ </HStack>)}diff --git a/apps/desktop/src/renderer/views/marketplace/ComposioViews.tsx b/apps/desktop/src/renderer/views/marketplace/ComposioViews.tsxindex 63b78ec8..2f25830a 100644--- a/apps/desktop/src/renderer/views/marketplace/ComposioViews.tsx+++ b/apps/desktop/src/renderer/views/marketplace/ComposioViews.tsx@@ -1,14 +1,15 @@import { useEffect, useRef, useState } from 'react'import { Button, CardForm, CardSection, IconButton, Spinner } from '../../components/Controls'import { Icon } from '../../components/Icon'-import { ModalHeader, useDismiss } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { ModalHeader, SheetPage, useDismiss } from '../../components/Overlay'+import { HStack, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { useStore } from '../../store/context'import {appConnected, emptyPage, errorText, hasHiddenItems, market, replacePage, revealMore, sleep, visible,type ComposioApp, type ComposioConnect, type ComposioStatus,} from './market-models'-import { AppLogo, ErrorText, Field, FormSheet, ItemGrid, MarketRow, MarketSection, SkeletonGrid, TileIcon, WebLink, filled, lineClamp } from './pieces'+import { AppLogo, ErrorText, Field, FormSheet, ItemGrid, MarketRow, MarketSection, SkeletonGrid, TileIcon, WebLink, filled } from './pieces'import { pluginsFor } from './plugins'// Apps through Composio (host/src/market/composio.rs): set up a key once, connect@@ -62,7 +63,7 @@ export function ComposioSection({ query, searchToken }: {const configured = status?.configured === truereturn (<MarketSection title="Apps">- <div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>+ <VStack gap={10}>{!configured ? (<ItemGrid><MarketRow@@ -78,7 +79,7 @@ export function ComposioSection({ query, searchToken }: {) : loading ? (<SkeletonGrid />) : apps.items.length === 0 ? (- <span style={{ color: 'var(--secondary)' }}>{query ? `No apps match “${query}”.` : "Couldn't load apps."}</span>+ <Text tone="secondary">{query ? `No apps match “${query}”.` : "Couldn't load apps."}</Text>) : (<ItemGrid>{visible(apps).map((app) => (@@ -95,18 +96,18 @@ export function ComposioSection({ query, searchToken }: {</ItemGrid>)}{!loading && hasHiddenItems(apps) && configured ? (- <div style={{ display: 'flex', justifyContent: 'center' }}>+ <HStack align="stretch" justify="center"><Button kind="secondary" onClick={() => setApps(revealMore)}>Load more apps</Button>- </div>+ </HStack>) : null}- {error ? <span style={{ ...font('footnote'), color: 'var(--danger)' }}>{error}</span> : null}+ {error ? <Text size="footnote" tone="danger">{error}</Text> : null}{configured ? (- <button style={{ display: 'flex', alignItems: 'center', gap: 4, alignSelf: 'flex-start', ...font('footnote'), color: 'var(--tertiary)' }} onClick={() => setSettingUp(true)}>+ <button className="composio-settings" onClick={() => setSettingUp(true)}><Icon name="key" size={10} />Composio settings</button>) : null}- </div>+ </VStack><FormSheet open={settingUp} onClose={() => setSettingUp(false)}><ComposioKeySheetstatus={status}@@ -155,7 +156,7 @@ export function ComposioKeySheet({ status, done }: { status: ComposioStatus | nuconst keyUrl = status?.keyUrl ?? 'https://platform.composio.dev'return (- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' }}>+ <SheetPage><ModalHeader title="Composio" trailing={saving ? <Spinner /> : <IconButton title="Save" icon="checkmark" disabled={!key.trim()} onClick={() => void save(key)} />} /><CardForm><CardSection@@ -163,16 +164,16 @@ export function ComposioKeySheet({ status, done }: { status: ComposioStatus | nufooter={`Composio signs you in to apps like Gmail and Slack and runs their tools for your bots. The key stays on ${store.hostName}.`}><Field label="API key" value={key} onChange={setKey} secret placeholder={status?.configured ? 'Saved (paste to replace)' : 'ak_…'} />- {URL.canParse(keyUrl) ? <WebLink title="Get a key from Composio" url={keyUrl} style={font('footnote')} /> : null}+ {URL.canParse(keyUrl) ? <WebLink title="Get a key from Composio" url={keyUrl} className="small" /> : null}</CardSection>{status?.configured ? (<CardSection footer="Bots lose the apps you connected until you add a key again.">- <button style={{ color: 'var(--danger)' }} onClick={() => void save('')}>Remove key</button>+ <button className="market-danger-button" onClick={() => void save('')}>Remove key</button></CardSection>) : null}{error ? <CardSection><ErrorText text={error} /></CardSection> : null}</CardForm>- </div>+ </SheetPage>)}@@ -273,39 +274,39 @@ export function ComposioConnectSheet({ app, requestId, done }: { app: ComposioAp: nullconst waitingRow = (text: string) => (- <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>+ <HStack gap={8}><Spinner />- <span style={{ color: 'var(--secondary)' }}>{text}</span>- </div>+ <Text tone="secondary">{text}</Text>+ </HStack>)return (- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' }}>+ <SheetPage><ModalHeader title={`Connect ${app.name}`} trailing={trailing} /><CardForm><CardSection>- <div style={{ display: 'flex', alignItems: 'center', gap: 14, padding: '4px 0' }}>+ <HStack gap={14} className="market-card-header"><AppLogo url={app.logo} name={app.name} size={52} />- <div style={{ display: 'flex', flexDirection: 'column', gap: 2, minWidth: 0 }}>- <span style={font('title3', 'semibold')}>{app.name}</span>- {app.description ? <span style={{ ...font('subheadline'), color: 'var(--secondary)', ...lineClamp(3) }}>{app.description}</span> : null}- </div>- </div>+ <VStack gap={2} shrink>+ <Text size="title3" weight="semibold">{app.name}</Text>+ {app.description ? <Text size="subheadline" tone="secondary" lines={3}>{app.description}</Text> : null}+ </VStack>+ </HStack></CardSection>{connected ? (<CardSection footer={`Turn ${app.name} on for a bot in the bot's settings, under Connectors.`}>- <span style={{ display: 'flex', alignItems: 'center', gap: 6, color: 'var(--added)' }}>+ <HStack as="span" gap={6} className="composio-connected"><Icon name="checkmark.circle.fill" size={12} />Connected- </span>+ </HStack></CardSection>) : needsFields ? (<CardSection footer={`Sent to Composio, which keeps it for ${app.name}.`}>{(plan?.fields ?? []).map((f) => (- <div key={f.name} style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>+ <VStack key={f.name} gap={4}><Field label={f.label} value={values[f.name] ?? ''} secret={f.secret} placeholder={f.label} onChange={(v) => setValues((old) => ({ ...old, [f.name]: v }))} />- {f.description ? <span style={{ ...font('caption'), color: 'var(--secondary)' }}>{f.description + (f.required ? '' : ' (optional)')}</span> : null}- </div>+ {f.description ? <Text size="caption" tone="secondary">{f.description + (f.required ? '' : ' (optional)')}</Text> : null}+ </VStack>))}</CardSection>) : plan?.status === 'redirect' ? (@@ -325,6 +326,6 @@ export function ComposioConnectSheet({ app, requestId, done }: { app: ComposioAp) : null}{error ? <CardSection><ErrorText text={error} /></CardSection> : null}</CardForm>- </div>+ </SheetPage>)}diff --git a/apps/desktop/src/renderer/views/marketplace/ConnectionRequestCard.tsx b/apps/desktop/src/renderer/views/marketplace/ConnectionRequestCard.tsxindex a2dc5256..edb768c1 100644--- a/apps/desktop/src/renderer/views/marketplace/ConnectionRequestCard.tsx+++ b/apps/desktop/src/renderer/views/marketplace/ConnectionRequestCard.tsx@@ -2,7 +2,8 @@ import { useState } from 'react'import type { Backend, Entry } from '@shared/models'import { Button, Spinner } from '../../components/Controls'import { Icon } from '../../components/Icon'-import { font } from '../../lib/fonts'+import { HStack, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { useStore } from '../../store/context'import { AgentSheet, AgentTile } from './AgentSheet'import { ComposioConnectSheet } from './ComposioViews'@@ -11,11 +12,9 @@ import {errorText, market, needsSignIn,type ComposioApp, type ConnectionRequest, type MarketConnector,} from './market-models'-import { AppLogo, Field, FormSheet, ServiceLogo, lineClamp } from './pieces'+import { AppLogo, Field, FormSheet, ServiceLogo } from './pieces'import { pluginsFor } from './plugins'-const caption = { ...font('caption'), color: 'var(--secondary)' }-/** Credentials go through the setup API; only the request's state is a chat entry. */export function ConnectionRequestCard({ entry }: { entry: Entry }) {const store = useStore()@@ -66,41 +65,41 @@ export function ConnectionRequestCard({ entry }: { entry: Entry }) {const pending = request.status === 'pending'return (- <div className="request-card" style={{ display: 'flex', flexDirection: 'column', gap: 12, width: '100%', maxWidth: 400, boxSizing: 'border-box', alignSelf: 'flex-start', padding: '14px 16px', border: '1px solid var(--border)', borderRadius: 20 }}>- <div style={{ display: 'flex', alignItems: 'center', gap: 14 }}>+ <VStack gap={12} className="request-card">+ <HStack gap={14}><RequestLogo request={request} />- <div style={{ display: 'flex', flexDirection: 'column', gap: 2, flex: 1, minWidth: 0 }}>- <span style={{ ...font('body', 'semibold'), color: 'var(--text)', ...lineClamp(1) }}>{request.title}</span>- {entry.data.text ? <span style={{ ...font('subheadline'), color: 'var(--secondary)', ...lineClamp(2) }} title={entry.data.text}>{entry.data.text}</span> : null}- </div>+ <VStack gap={2} grow>+ <Text size="body" weight="semibold" tone="text" truncate>{request.title}</Text>+ {entry.data.text ? <Text size="subheadline" tone="secondary" lines={2} title={entry.data.text}>{entry.data.text}</Text> : null}+ </VStack>{pending ? (- <div style={{ display: 'flex', alignItems: 'center', gap: 6, flex: 'none' }}>+ <HStack gap={6} className="request-card-trailing">{busy ? <Spinner /> : null}<Button disabled={busy || ((isSecret || isLogin) && !value)} onClick={() => void connect()}>{isAgent ? 'Sign in' : isLogin ? 'Save' : 'Connect'}</Button>- </div>+ </HStack>) : (- <span style={{ display: 'flex', alignItems: 'center', gap: 6, flex: 'none', ...font('subheadline'), color: 'var(--secondary)' }}>+ <HStack as="span" gap={6} className="request-card-trailing request-card-status">{request.status === 'ready' ? <Icon name="checkmark" size={11} weight="semibold" /> : null}{request.status === 'ready' ? (isAgent ? 'Signed in' : isLogin ? 'Saved' : 'Connected') : 'Cancelled'}- </span>+ </HStack>)}- </div>+ </HStack>{pending && isLogin ? (<><Field value={username} onChange={setUsername} placeholder="Username or email" /><Field value={value} onChange={setValue} placeholder="Password or op:// reference" secret />- <span style={caption}>Saved securely on this computer. The bot types it into the sign-in page but never sees it.</span>+ <Text size="caption" tone="secondary">Saved securely on this computer. The bot types it into the sign-in page but never sees it.</Text></>) : pending && isSecret ? (<>- <span style={caption}>{`${request.field ?? 'Credential'} · ${request.location ?? ''}`}</span>+ <Text size="caption" tone="secondary">{`${request.field ?? 'Credential'} · ${request.location ?? ''}`}</Text><Field value={value} onChange={setValue} placeholder="Credential or op:// reference" secret />- <span style={caption}>Saved securely on this computer. Never added to the conversation.</span>+ <Text size="caption" tone="secondary">Saved securely on this computer. Never added to the conversation.</Text></>) : null}- {error ? <span style={{ ...font('footnote'), color: 'var(--danger)' }}>{error}</span> : null}+ {error ? <Text size="footnote" tone="danger">{error}</Text> : null}<FormSheet open={item !== null} onClose={() => setItem(null)}>{item ? <InstallConnectorSheet item={item} requestId={entry.id} done={() => setItem(null)} /> : null}</FormSheet>@@ -110,7 +109,7 @@ export function ConnectionRequestCard({ entry }: { entry: Entry }) {<FormSheet open={agent !== null} onClose={() => setAgent(null)} width={560} height={560}>{agent ? <AgentSheet key={agent.id} initial={agent} recheck /> : null}</FormSheet>- </div>+ </VStack>)}diff --git a/apps/desktop/src/renderer/views/marketplace/ConnectorSheets.tsx b/apps/desktop/src/renderer/views/marketplace/ConnectorSheets.tsxindex 41a255fb..f40bf809 100644--- a/apps/desktop/src/renderer/views/marketplace/ConnectorSheets.tsx+++ b/apps/desktop/src/renderer/views/marketplace/ConnectorSheets.tsx@@ -1,14 +1,13 @@import { useEffect, useRef, useState } from 'react'import { CardForm, CardSection, ChoiceList, IconButton, SegmentedChoice, Spinner } from '../../components/Controls'-import { ModalHeader, useDismiss } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { ModalHeader, SheetPage, useDismiss } from '../../components/Overlay'+import { VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { useStore } from '../../store/context'import { errorText, market, needsSignIn, type InstalledConnector, type MarketConnector, type MarketInput } from './market-models'import { ErrorText, Field, WebLink } from './pieces'import { usePlugins } from './plugins'-const sheetBody = { display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' } as const-export function InstallConnectorSheet({ item, requestId, done }: { item: MarketConnector; requestId?: string; done: () => void }) {const store = useStore()const plugins = usePlugins(store)@@ -55,20 +54,20 @@ export function InstallConnectorSheet({ item, requestId, done }: { item: MarketCconst missing = !option || option.inputs.some((i) => i.required && !(values[i.name] ?? i.default ?? ''))return (- <div style={sheetBody}>+ <SheetPage><ModalHeadertitle="Add connector"trailing={saving ? <Spinner /> : <IconButton title="Add" icon="plus" disabled={installed === null && missing} onClick={() => void install()} />}/><CardForm><CardSection>- <div style={{ display: 'flex', flexDirection: 'column', gap: 6, padding: '4px 0' }}>- <span style={font('title3', 'semibold')}>{item.title}</span>- {item.description ? <span style={{ color: 'var(--secondary)' }}>{item.description}</span> : null}+ <VStack gap={6} className="market-card-header">+ <Text size="title3" weight="semibold">{item.title}</Text>+ {item.description ? <Text tone="secondary">{item.description}</Text> : null}{item.website && URL.canParse(item.website) ? (- <WebLink title={item.website} url={item.website} style={{ ...font('footnote'), whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }} />+ <WebLink title={item.website} url={item.website} className="small truncate" />) : null}- </div>+ </VStack></CardSection>{item.options.length > 1 ? (<CardSection title="Runs">@@ -82,12 +81,12 @@ export function InstallConnectorSheet({ item, requestId, done }: { item: MarketC{option ? (<CardSection title="Setup" footer={`Keys are saved on ${store.hostName} only.`}>{option.inputs.length === 0 ? (- <span style={{ color: 'var(--secondary)' }}>+ <Text tone="secondary">{option.kind === 'remote' ? `No keys needed here. If ${item.title} wants you to sign in, its sign-in page opens next.` : 'No setup needed.'}- </span>+ </Text>) : null}{option.inputs.map((input) => (- <div key={input.name} style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>+ <VStack key={input.name} gap={4}><Fieldlabel={input.name}value={value(input)}@@ -96,15 +95,15 @@ export function InstallConnectorSheet({ item, requestId, done }: { item: MarketConChange={(v) => setValues((old) => ({ ...old, [input.name]: v }))}/>{input.description ? (- <span style={{ ...font('caption'), color: 'var(--secondary)' }}>{input.description + (input.required ? '' : ' (optional)')}</span>+ <Text size="caption" tone="secondary">{input.description + (input.required ? '' : ' (optional)')}</Text>) : null}- </div>+ </VStack>))}</CardSection>) : null}{error ? <CardSection><ErrorText text={error} /></CardSection> : null}</CardForm>- </div>+ </SheetPage>)}@@ -153,7 +152,7 @@ export function CustomConnectorSheet() {}return (- <div style={sheetBody}>+ <SheetPage><ModalHeader title="Custom connector" trailing={saving ? <Spinner /> : <IconButton title="Add" icon="plus" disabled={!ready} onClick={() => void save()} />} /><CardForm><CardSection footer={footer}>@@ -173,7 +172,7 @@ export function CustomConnectorSheet() {) : null}{error ? <CardSection><ErrorText text={error} /></CardSection> : null}</CardForm>- </div>+ </SheetPage>)}@@ -199,7 +198,7 @@ export function NewSkillSheet() {}return (- <div style={sheetBody}>+ <SheetPage><ModalHeadertitle="New skill"trailing={saving ? <Spinner /> : <IconButton title="Save" icon="checkmark" disabled={!name.trim() || !instructions.trim()} onClick={() => void save()} />}@@ -214,6 +213,6 @@ export function NewSkillSheet() {</CardSection>{error ? <CardSection><ErrorText text={error} /></CardSection> : null}</CardForm>- </div>+ </SheetPage>)}diff --git a/apps/desktop/src/renderer/views/marketplace/CredentialsView.tsx b/apps/desktop/src/renderer/views/marketplace/CredentialsView.tsxindex f51f6d5d..4fbf80cd 100644--- a/apps/desktop/src/renderer/views/marketplace/CredentialsView.tsx+++ b/apps/desktop/src/renderer/views/marketplace/CredentialsView.tsx@@ -1,16 +1,15 @@import { useEffect, useState } from 'react'import { Button, CardForm, CardSection, IconButton, Spinner } from '../../components/Controls'import { Icon } from '../../components/Icon'-import { ModalHeader, useDismiss } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { ModalHeader, SheetPage, useDismiss } from '../../components/Overlay'+import { HStack, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { useStore } from '../../store/context'import { errorText, market, type CredentialStatus, type InstalledConnector, type SavedLogin } from './market-models'import { ErrorText, Field, FormSheet, ScreenHeader, filled } from './pieces'import { usePlugins } from './plugins'import './credentials.css'-const caption = { ...font('caption'), color: 'var(--secondary)' }-export function CredentialsView({ onBack }: { onBack: () => void }) {const dismiss = useDismiss()const store = useStore()@@ -49,7 +48,7 @@ export function CredentialsView({ onBack }: { onBack: () => void }) {}return (- <div className="credentials-page">+ <SheetPage className="credentials-page"><ScreenHeader title="Credentials" onBack={onBack} trailing={<IconButton title="Close" icon="xmark" onClick={dismiss} />} /><CardForm><CardSection title="Storage">@@ -58,12 +57,12 @@ export function CredentialsView({ onBack }: { onBack: () => void }) {<CardSection title="Saved connections">{plugins.installedConnectors.filter((c) => c.keys.length > 0).map((c) => (<button key={c.id} className="plain-row-button" onClick={() => setSelected(c)}>- <span style={{ flex: 1 }}>{c.name}</span>+ <span className="credential-row-title">{c.name}</span><Icon name="chevron.right" size={10} /></button>))}- {!plugins.installedConnectors.some((c) => c.keys.length > 0) ? <span style={caption}>No saved connection credentials yet.</span> : null}- <span style={caption}>Values stay hidden. Select a connection to replace its credentials.</span>+ {!plugins.installedConnectors.some((c) => c.keys.length > 0) ? <Text size="caption" tone="secondary">No saved connection credentials yet.</Text> : null}+ <Text size="caption" tone="secondary">Values stay hidden. Select a connection to replace its credentials.</Text></CardSection><LoginsSection /><CardSection title="1Password" footer="Use a service account with read access only to a dedicated shared vault. The 1Password CLI must be installed on the computer.">@@ -71,7 +70,7 @@ export function CredentialsView({ onBack }: { onBack: () => void }) {<CredentialField label="Service account token" value={token} onChange={setToken} placeholder="Paste your token" secret /><div><Button disabled={busy || !token} onClick={() => void save(token)}>Connect</Button></div>{status?.onePasswordConnected ? <div><Button kind="secondary" disabled={busy} onClick={() => void save('')}>Disconnect</Button></div> : null}- <span style={{ ...font('footnote'), color: 'var(--secondary)' }}>Use op://vault/item/field in a connector's credential field. Codync retrieves the value when the connector runs.</span>+ <Text size="footnote" tone="secondary">Use op://vault/item/field in a connector's credential field. Codync retrieves the value when the connector runs.</Text></CardSection>{busy ? <Spinner /> : null}{error ? <ErrorText text={error} /> : null}@@ -79,7 +78,7 @@ export function CredentialsView({ onBack }: { onBack: () => void }) {<FormSheet open={selected !== null} onClose={() => setSelected(null)}>{selected ? <ConnectorCredentialEditor key={selected.id} connector={selected} /> : null}</FormSheet>- </div>+ </SheetPage>)}@@ -137,19 +136,19 @@ function LoginsSection() {return (<CardSection title="Sign-ins" footer="Bots type these into the matching website or app and never see the password. You can use an op:// reference.">{logins.map((login) => (- <div key={login.id} style={{ display: 'flex', alignItems: 'center' }}>- <div style={{ display: 'flex', flexDirection: 'column', gap: 2, flex: 1, minWidth: 0 }}>+ <HStack key={login.id}>+ <VStack gap={2} grow><span>{login.site}</span>- {login.username ? <span style={caption}>{login.username}</span> : null}- </div>+ {login.username ? <Text size="caption" tone="secondary">{login.username}</Text> : null}+ </VStack><IconButton title="Remove" icon="trash" onClick={() => void remove(login)} />- </div>+ </HStack>))}<CredentialField label="Website or app" value={site} onChange={setSite} placeholder="github.com" /><CredentialField label="Username or email" value={username} onChange={setUsername} placeholder="[email protected]" /><CredentialField label="Password" value={password} onChange={setPassword} placeholder="Password or op:// reference" secret /><div><Button disabled={busy || !site || !password} onClick={() => void save()}>Save sign-in</Button></div>- {error ? <span style={{ ...font('footnote'), color: 'var(--danger)' }}>{error}</span> : null}+ {error ? <Text size="footnote" tone="danger">{error}</Text> : null}</CardSection>)}@@ -177,7 +176,7 @@ function ConnectorCredentialEditor({ connector }: { connector: InstalledConnecto}return (- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' }}>+ <SheetPage><ModalHeadertitle={connector.name}trailing={saving ? <Spinner /> : <IconButton title="Save credentials" icon="checkmark" disabled={Object.values(fields).every((v) => !v)} onClick={() => void save()} />}@@ -190,7 +189,7 @@ function ConnectorCredentialEditor({ connector }: { connector: InstalledConnecto</CardSection>{error ? <ErrorText text={error} /> : null}</CardForm>- </div>+ </SheetPage>)}diff --git a/apps/desktop/src/renderer/views/marketplace/MarketplaceView.tsx b/apps/desktop/src/renderer/views/marketplace/MarketplaceView.tsxindex 2b8e7c4c..46708b2a 100644--- a/apps/desktop/src/renderer/views/marketplace/MarketplaceView.tsx+++ b/apps/desktop/src/renderer/views/marketplace/MarketplaceView.tsx@@ -2,8 +2,9 @@ import { useEffect, useRef, useState, type ReactNode } from 'react'import type { Backend } from '@shared/models'import { Button, DropdownMenu, IconButton, Spinner } from '../../components/Controls'import { Icon } from '../../components/Icon'-import { Dialog, useDismiss } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { Dialog, SheetPage, useDismiss } from '../../components/Overlay'+import { HStack, Spacer, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { useStore } from '../../store/context'import { ComputerBadge } from '../ComputerBadge'import { AgentSheet, AgentTile, NodeNotice } from './AgentSheet'@@ -141,39 +142,39 @@ export function MarketplaceView({ computers, computer, onComputer, appsFirst = fconst header = (<div className="market-heading">{/* Everything here lives on one computer; say which. */}- <div style={{ display: 'flex', alignItems: 'center', gap: 10, minWidth: 0 }}>+ <HStack gap={10} shrink><ComputerBadge computer={store.computer} size={32} />- <div style={{ display: 'flex', flexDirection: 'column', minWidth: 0, whiteSpace: 'nowrap' }}>- <span style={{ ...font('title', 'semibold'), color: 'var(--text)' }}>Extensions</span>+ <VStack shrink className="market-heading-titles">+ <Text size="title" weight="semibold" tone="text">Extensions</Text>{computers.length > 1 ? (<DropdownMenutitle="Switch computer"- style={{ display: 'flex', alignItems: 'center', gap: 4, ...font('subheadline'), color: 'var(--secondary)', minWidth: 0 }}+ className="market-computer-switch"items={() => computers.map((c) => ({ title: c.name, selected: c.id === computer, action: () => onComputer(c.id) }))}>- <span aria-label={`Computer: ${store.hostName}`} style={{ overflow: 'hidden', textOverflow: 'ellipsis' }}>{store.hostName}</span>+ <Text truncate aria-label={`Computer: ${store.hostName}`}>{store.hostName}</Text><Icon name="chevron.down" size={10} weight="semibold" /></DropdownMenu>) : (- <span style={{ ...font('subheadline'), color: 'var(--secondary)', overflow: 'hidden', textOverflow: 'ellipsis' }}>{store.hostName}</span>+ <Text size="subheadline" tone="secondary" truncate>{store.hostName}</Text>)}- </div>- </div>- <span style={{ flex: 1 }} />+ </VStack>+ </HStack>+ <Spacer /><Button kind="secondary" onClick={() => setShowCredentials(true)}><Icon name="lock.shield" size={12} />Credentials</Button>{installedCount > 0 ? (- <button className="press" style={{ display: 'flex', alignItems: 'center', gap: 8, flex: 'none' }} onClick={() => setShowInstalled(true)}>- <span style={{ display: 'flex' }}>- {plugins.installedConnectors.slice(0, 3).map((c, i) => (- <span key={c.id} style={{ marginLeft: i ? -8 : 0, display: 'flex' }}>+ <button className="press market-installed" onClick={() => setShowInstalled(true)}>+ <HStack as="span" align="stretch" className="market-installed-logos">+ {plugins.installedConnectors.slice(0, 3).map((c) => (+ <HStack as="span" align="stretch" key={c.id}><ServiceLogo name={c.name} registryName={c.registryName} size={26} />- </span>+ </HStack>))}- </span>- <span style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-start', color: 'var(--secondary)', whiteSpace: 'nowrap' }}>- <span>{installedCount} installed</span>- <span style={font('caption')}>Connectors & skills</span>- </span>+ </HStack>+ <VStack as="span" align="flex-start" className="market-installed-text">+ <Text tone="secondary">{installedCount} installed</Text>+ <Text size="caption" tone="secondary">Connectors & skills</Text>+ </VStack><Icon name="chevron.right" size={10} weight="semibold" color="var(--tertiary)" /></button>) : null}@@ -200,7 +201,7 @@ export function MarketplaceView({ computers, computer, onComputer, appsFirst = f<buttonaria-label="Clear search"title="Clear search"- style={{ display: 'flex', color: 'var(--tertiary)' }}+ className="market-search-clear"onClick={() => {setSearch('')setAgentLimit(10)@@ -213,7 +214,7 @@ export function MarketplaceView({ computers, computer, onComputer, appsFirst = f</div>)- const centered = (node: ReactNode) => <div style={{ display: 'flex', justifyContent: 'center' }}>{node}</div>+ const centered = (node: ReactNode) => <HStack align="stretch" justify="center">{node}</HStack>const page = (<div className="market-page">@@ -235,7 +236,7 @@ export function MarketplaceView({ computers, computer, onComputer, appsFirst = f{loadingConnectors ? (<SkeletonGrid />) : connectors.items.length === 0 ? (- <span style={{ color: 'var(--secondary)' }}>{query ? `No connectors match “${query}”.` : "Couldn't load connectors."}</span>+ <Text tone="secondary">{query ? `No connectors match “${query}”.` : "Couldn't load connectors."}</Text>) : (<><ItemGrid>@@ -301,10 +302,10 @@ export function MarketplaceView({ computers, computer, onComputer, appsFirst = f/></ItemGrid></MarketSection>- {error ? <span style={{ ...font('footnote'), color: 'var(--danger)' }}>{error}</span> : null}- <span style={{ ...font('footnote'), color: 'var(--tertiary)' }}>+ {error ? <Text size="footnote" tone="danger">{error}</Text> : null}+ <Text size="footnote" tone="tertiary">Connectors come from the official MCP Registry, apps through Composio, skills from Anthropic, agents from the ACP registry. Everything installs on {store.hostName}.- </span>+ </Text></div></div>{/* Dismissing slides the sheet away; clearing the caller's state would cut it off. */}@@ -348,16 +349,14 @@ function AgentCard({ backend, onClick }: { backend: Backend; onClick: () => voidreturn (<button className="agent-card" title={backend.name} onClick={onClick}><AgentTile registry={backend.registry ?? backend.id} icon={24} tile={40} radius={11} />- <span style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-start', gap: 3, minWidth: 0 }}>- <span style={{ ...font('subheadline', 'semibold'), color: 'var(--text)', ...ellipsis }}>{backend.name}</span>- <span style={{ ...font('caption'), color: 'var(--secondary)', ...ellipsis }}>{status}</span>- </span>+ <VStack as="span" align="flex-start" gap={3} shrink>+ <Text size="subheadline" weight="semibold" tone="text" truncate className="agent-card-line">{backend.name}</Text>+ <Text size="caption" tone="secondary" truncate className="agent-card-line">{status}</Text>+ </VStack></button>)}-const ellipsis = { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', maxWidth: '100%' } as const-// MARK: - Installedfunction InstalledView({ back }: { back: () => void }) {@@ -388,9 +387,9 @@ function InstalledView({ back }: { back: () => void }) {}return (- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' }}>+ <SheetPage><ScreenHeader title="Connectors & skills" onBack={back} />- <div style={{ flex: 1, minHeight: 0 }}>+ <div className="market-installed-body"><div className="market-scroll"><div className="market-page-content">{empty ? <EmptyState icon="shippingbox" title="Nothing installed" detail="Connectors and skills you add show up here." /> : null}@@ -443,18 +442,18 @@ function InstalledView({ back }: { back: () => void }) {<FormSheet open={viewingSkill !== null} onClose={() => setViewingSkill(null)}>{viewingSkill ? <SkillSheet key={viewingSkill.name} skill={viewingSkill} /> : null}</FormSheet>- </div>+ </SheetPage>)}/** A quiet "nothing here" message (replaces `ContentUnavailableView`). */function EmptyState({ icon, title, detail }: { icon: string; title: string; detail: string }) {return (- <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 8, padding: '40px 0', textAlign: 'center' }}>+ <VStack align="center" gap={8} className="market-empty"><Icon name={icon} size={28} color="var(--tertiary)" />- <span style={{ ...font('compactBody', 'semibold'), color: 'var(--text)' }}>{title}</span>- <span style={{ ...font('compactSecondary'), color: 'var(--secondary)' }}>{detail}</span>- </div>+ <Text size="compactBody" weight="semibold" tone="text">{title}</Text>+ <Text size="compactSecondary" tone="secondary">{detail}</Text>+ </VStack>)}@@ -463,7 +462,7 @@ function RemoveButton({ title, onClick }: { title: string; onClick: () => void }<buttontitle="Remove"aria-label={`Remove ${title}`}- style={{ minWidth: 44, minHeight: 44, display: 'grid', placeItems: 'center', flex: 'none', color: 'var(--secondary)' }}+ className="market-remove"onClick={(e) => {e.stopPropagation()onClick()diff --git a/apps/desktop/src/renderer/views/marketplace/SetupTerminal.tsx b/apps/desktop/src/renderer/views/marketplace/SetupTerminal.tsxindex 9a663d0d..3c4fa641 100644--- a/apps/desktop/src/renderer/views/marketplace/SetupTerminal.tsx+++ b/apps/desktop/src/renderer/views/marketplace/SetupTerminal.tsx@@ -6,8 +6,10 @@ import { useEffect, useRef, useState } from 'react'import { fromBase64, HostError, toBase64 } from '../../client/host-client'import { Button } from '../../components/Controls'import { Icon } from '../../components/Icon'+import { SheetPage } from '../../components/Overlay'+import { HStack, Spacer } from '../../components/Stack'+import { Text } from '../../components/Text'import { ThinkingOrb } from '../../components/ThinkingOrb'-import { font } from '../../lib/fonts'import { useStore } from '../../store/context'import type { Backend } from '@shared/models'import { errorText, market, type AuthMethod, type SetupStep } from './market-models'@@ -168,30 +170,28 @@ export function SetupTerminalView({ backend, step, method, back }: {const name = backend?.name ?? 'the agent'const title = step === 'node' ? 'Add Node.js' : step === 'install' ? `Install ${name}` : (method?.name ?? `Sign in to ${name}`)return (- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' }}>+ <SheetPage><ScreenHeader title={title} onBack={back} /><div className="setup-terminal">- <div ref={surface} style={{ width: '100%', height: '100%' }} />+ <div ref={surface} className="setup-terminal-surface" /></div>- <div style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '10px 16px', ...font('footnote') }}>+ <HStack gap={8} className="setup-terminal-status">{error ? (- <span style={{ color: 'var(--danger)', ...clamp2 }}>{error}</span>+ <Text tone="danger" lines={2}>{error}</Text>) : exitCode !== null ? (<><Icon name={exitCode === 0 ? 'checkmark.circle.fill' : 'exclamationmark.circle.fill'} size={10} color={exitCode === 0 ? 'var(--added)' : 'var(--warning)'} />- <span style={{ color: 'var(--secondary)', ...clamp2 }}>{exitCode === 0 ? 'Finished.' : `Ended with an error (${exitCode}).`}</span>+ <Text tone="secondary" lines={2}>{exitCode === 0 ? 'Finished.' : `Ended with an error (${exitCode}).`}</Text></>) : (<><ThinkingOrb size={14} color="var(--secondary)" />- <span style={{ color: 'var(--secondary)', ...clamp2 }}>Running on {store.hostName}. Links open on this device.</span>+ <Text tone="secondary" lines={2}>Running on {store.hostName}. Links open on this device.</Text></>)}- <span style={{ flex: 1 }} />+ <Spacer />{exitCode !== null ? <Button className="fade-in" onClick={back}>Done</Button> : null}- </div>- </div>+ </HStack>+ </SheetPage>)}--const clamp2 = { display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical', overflow: 'hidden' } as constdiff --git a/apps/desktop/src/renderer/views/marketplace/SkillSheet.tsx b/apps/desktop/src/renderer/views/marketplace/SkillSheet.tsxindex 3af5c9af..ebd21172 100644--- a/apps/desktop/src/renderer/views/marketplace/SkillSheet.tsx+++ b/apps/desktop/src/renderer/views/marketplace/SkillSheet.tsx@@ -2,8 +2,8 @@ import { useEffect, useState } from 'react'import { isBelow } from '@shared/compat'import { CardForm, CardSection, IconButton, Spinner } from '../../components/Controls'import { Icon } from '../../components/Icon'-import { ModalHeader } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { ModalHeader, SheetPage } from '../../components/Overlay'+import { Text } from '../../components/Text'import { useStore } from '../../store/context'import { MarkdownText } from '../thread/Markdown'import { SKILLS_HOST } from '../thread/slash-commands'@@ -52,27 +52,27 @@ export function SkillSheet({ skill }: { skill: SkillRef }) {}const trailing = added ? (- <span title="Added" aria-label="Added" style={{ width: 32, display: 'grid', placeItems: 'center', color: 'var(--secondary)' }}>+ <span title="Added" aria-label="Added" className="skill-added"><Icon name="checkmark" size={13} weight="semibold" /></span>) : adding ? <Spinner /> : <IconButton title="Add" icon="plus" onClick={() => void add()} />return (- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' }}>+ <SheetPage><ModalHeader title={skill.name} trailing={trailing} /><CardForm>{skill.description ? (<CardSection>- <span style={{ ...font('subheadline'), color: 'var(--secondary)' }}>{skill.description}</span>+ <Text size="subheadline" tone="secondary">{skill.description}</Text></CardSection>) : null}{readable ? (<CardSection title="Instructions" footer={added ? 'Bots read these before using the skill.' : 'Add it to let bots use these instructions.'}>- {markdown ? <MarkdownText text={markdown} /> : markdown === '' ? <span style={{ color: 'var(--secondary)' }}>No instructions.</span> : error ? null : <Spinner />}+ {markdown ? <MarkdownText text={markdown} /> : markdown === '' ? <Text tone="secondary">No instructions.</Text> : error ? null : <Spinner />}</CardSection>) : null}{error ? <CardSection><ErrorText text={error} /></CardSection> : null}</CardForm>- </div>+ </SheetPage>)}diff --git a/apps/desktop/src/renderer/views/marketplace/credentials.css b/apps/desktop/src/renderer/views/marketplace/credentials.cssindex 51d42b5a..4b9cdd3b 100644--- a/apps/desktop/src/renderer/views/marketplace/credentials.css+++ b/apps/desktop/src/renderer/views/marketplace/credentials.css@@ -1,9 +1,6 @@+/* The Credentials screen (a SheetPage). */.credentials-page {- display: flex;- flex-direction: column;- height: 100%;min-height: 0;- background: var(--background);}.credentials-page > .card-form { flex: 1; min-height: 0; }.credentials-page .card-form-content {@@ -12,13 +9,13 @@margin: 0 auto;padding: 20px 28px 32px;gap: 24px;- font-size: calc(13px * var(--scale));+ font-size: var(--text-body);}.credentials-page .card-section { gap: 10px; }.credentials-page .card-section-rows { background: none; border-radius: 0; gap: 10px; }.credentials-page .card-row { min-height: 0; padding: 0; }.credentials-page .card-section-rows > .hairline { display: none; }-.credentials-page .card-section-footer { font-size: calc(11px * var(--scale)); line-height: 1.5; }+.credentials-page .card-section-footer { font-size: var(--text-caption); line-height: 1.5; }.credentials-page .card-section + .card-section { padding-top: 22px; border-top: 1px solid var(--border); }.credential-storage {display: flex;@@ -29,9 +26,9 @@border-radius: var(--radius-m);}.credential-storage strong { font-weight: 500; }-.credential-storage p { margin: 4px 0 0; color: var(--secondary); font-size: calc(11px * var(--scale)); }+.credential-storage p { margin: 4px 0 0; color: var(--secondary); font-size: var(--text-caption); }.credential-field { display: flex; flex-direction: column; gap: 7px; }-.credential-field > span { font-size: calc(12px * var(--scale)); color: var(--secondary); }+.credential-field > span { font-size: var(--text-callout); color: var(--secondary); }.credential-field .market-field {min-height: 36px;padding: 9px 12px;@@ -43,6 +40,7 @@.credential-field .market-field:focus-visible { outline-offset: 2px; }.credentials-page .plain-row-button { min-height: 38px; padding: 8px 10px; border-radius: var(--radius-s); }.credentials-page .plain-row-button:hover { background: var(--surface); }+.credential-row-title { flex: 1; }@media (max-width: 600px) {.credentials-page .card-form-content { padding: 16px; }}diff --git a/apps/desktop/src/renderer/views/marketplace/marketplace.css b/apps/desktop/src/renderer/views/marketplace/marketplace.cssindex b34e36c7..f2c8f252 100644--- a/apps/desktop/src/renderer/views/marketplace/marketplace.css+++ b/apps/desktop/src/renderer/views/marketplace/marketplace.css@@ -20,6 +20,14 @@top: 8px;right: 8px;}+.market-installed-body {+ flex: 1;+ min-height: 0;+}+.market-empty {+ padding: 40px 0;+ text-align: center;+}/* Installed ⇄ page: slides like `.move(edge:)` + opacity. */.market-stack {@@ -59,12 +67,19 @@flex: 1;min-width: 0;}+.market-search-clear {+ display: flex;+ color: var(--tertiary);+}.market-section {display: flex;flex-direction: column;gap: 12px;}+.market-section-title {+ padding-left: 4px;+}.agent-grid {display: grid;@@ -106,6 +121,26 @@.agent-card:active {transform: scale(0.98);}+.agent-card-line {+ max-width: 100%;+}++/* An agent's registry logo on a rounded tile; size and radius come from the caller. */+.agent-tile {+ flex: none;+ display: grid;+ place-items: center;+ background: var(--bubble-agent);+ color: var(--text);+}+/* The logo as a mask over its tint (agentTint can be a gradient). */+.agent-icon {+ display: inline-block;+ flex: none;+ -webkit-mask-size: contain;+ -webkit-mask-repeat: no-repeat;+ -webkit-mask-position: center;+}.market-row {display: flex;@@ -119,9 +154,64 @@.market-row.openable:hover {background: color-mix(in srgb, var(--bubble-agent) 60%, transparent);}+.market-row-icon {+ width: 46px;+ height: 46px;+ flex: none;+ display: grid;+}+/* The trailing "adding…" orb or "added" check, as wide as the capsule they replace. */+.market-row-status {+ width: 60px;+ flex: none;+}+.market-row-added {+ color: var(--secondary);+}++/* Logo tiles (ServiceLogo, AppLogo); size and corner radius follow the size prop. */+.market-logo {+ position: relative;+ flex: none;+ display: grid;+ place-items: center;+ background: var(--bubble-agent);+}+.service-logo {+ overflow: hidden;+}+.service-logo-initial {+ font-family: ui-rounded, var(--font);+}+.market-logo-image {+ position: absolute;+ inset: 0;+ display: none;+ width: 100%;+ height: 100%;+ object-fit: contain;+ box-sizing: border-box;+}+.market-logo-image.loaded {+ display: block;+}+/* Favicons sit on white in both schemes. */+.service-logo-image {+ background: #fff;+}+.market-tile {+ width: 100%;+ height: 100%;+ border-radius: var(--radius-m);+ background: var(--bubble-agent);+ display: grid;+ place-items: center;+ color: var(--text);+}/* The quiet capsule action ("Add", "Install"). */.capsule-action {+ font-size: var(--text-caption);font-weight: 600;color: var(--text);padding: 7px 16px;@@ -135,10 +225,37 @@transform: scale(0.98);opacity: 0.85;}+.agent-step-action {+ padding: 7px 14px;+}.skeleton {animation: market-pulse 0.9s ease-in-out infinite alternate;}+.skeleton-row {+ padding: 10px 12px;+}+.skeleton-icon {+ width: 46px;+ height: 46px;+ flex: none;+ border-radius: var(--radius-m);+ background: var(--bubble-agent);+}+.skeleton-title,+.skeleton-subtitle {+ background: var(--bubble-agent);+}+.skeleton-title {+ width: 120px;+ height: 12px;+ border-radius: var(--radius-xs);+}+.skeleton-subtitle {+ width: 190px;+ height: 10px;+ border-radius: 5px;+}@keyframes market-pulse {to {opacity: 0.5;@@ -155,6 +272,25 @@text-decoration: underline;text-align: left;}+.plain-link.small {+ font-size: var(--text-caption);+ font-weight: 400;+}++/* A full screen's top bar (ScreenHeader), its title centered over the whole bar. */+.market-screen-header {+ position: relative;+ height: 44px;+ padding: 0 12px;+ flex: none;+ background: var(--background);+}+.market-screen-title {+ position: absolute;+ left: 60px;+ right: 60px;+ text-align: center;+}.option-row {display: flex;@@ -165,6 +301,68 @@.option-row:disabled {opacity: 0.5;}+/* At least 8 pt between a row's text and its trailing control, on top of the gaps. */+.agent-row-gap {+ min-width: 8px;+}++/* The logo and name at the top of a details sheet. */+.market-card-header {+ padding: 4px 0;+}+.agent-step-row {+ padding: 4px 0;+}+.agent-step-number {+ display: grid;+ place-items: center;+ flex: none;+ width: 26px;+ height: 26px;+ border-radius: 50%;+ background: var(--bubble-agent);+ transition: background-color var(--fade);+}+.agent-step-number.done {+ background: var(--accent-fill);+}+.agent-check-again {+ display: flex;+ color: var(--secondary);+}+.agent-auth-detail {+ white-space: pre-wrap;+}+.agent-keys-notes {+ padding: 0 4px;+ font-size: var(--text-caption);+ font-weight: 400;+ color: var(--tertiary);+}+.market-danger-button {+ color: var(--danger);+}++.composio-settings {+ display: flex;+ align-items: center;+ gap: 4px;+ align-self: flex-start;+ font-size: var(--text-caption);+ font-weight: 400;+ color: var(--tertiary);+}+.composio-connected {+ color: var(--added);+}++/* SkillSheet's "added" check, in the place of the Add button. */+.skill-added {+ width: 32px;+ display: grid;+ place-items: center;+ color: var(--secondary);+}.plain-row-button {display: flex;@@ -178,6 +376,30 @@}textarea.market-field {field-sizing: content;+ line-height: 1.3;+}+.market-field.mono {+ font-size: var(--text-callout);+ font-weight: 400;+ font-family: var(--mono);+}+/* A connector/sign-in request in the chat: an outlined card, no fill. */+.request-card {+ width: 100%;+ max-width: 400px;+ box-sizing: border-box;+ align-self: flex-start;+ padding: 14px 16px;+ border: 1px solid var(--border);+ border-radius: 20px;+}+.request-card-trailing {+ flex: none;+}+.request-card-status {+ font-size: var(--text-caption);+ font-weight: 400;+ color: var(--secondary);}/* A chat request card has no fill, so each of its fields gets one (fill, no border). */.request-card .market-field {@@ -198,8 +420,50 @@ textarea.market-field {.setup-terminal .xterm-viewport {background: transparent !important;}+.setup-terminal-surface {+ width: 100%;+ height: 100%;+}+.setup-terminal-status {+ padding: 10px 16px;+ font-size: var(--text-caption);+ font-weight: 400;+}.market-heading { display: flex; align-items: center; gap: 12px; padding-right: 10px; flex-wrap: wrap; }+.market-heading-titles {+ white-space: nowrap;+}+.market-computer-switch {+ display: flex;+ align-items: center;+ gap: 4px;+ min-width: 0;+ font-size: var(--text-caption);+ font-weight: 400;+ color: var(--secondary);+}+/* "N installed": the first connectors' logos, overlapping, then the count. */+.market-installed {+ display: flex;+ align-items: center;+ gap: 8px;+ flex: none;+}+.market-installed-logos > * + * {+ margin-left: -8px;+}+.market-installed-text {+ white-space: nowrap;+}+.market-remove {+ display: grid;+ place-items: center;+ flex: none;+ min-width: 44px;+ min-height: 44px;+ color: var(--secondary);+}@media (max-width: 640px) {.market-page-content { padding: 28px 18px; }.item-grid { grid-template-columns: minmax(0, 1fr); }diff --git a/apps/desktop/src/renderer/views/marketplace/pieces.tsx b/apps/desktop/src/renderer/views/marketplace/pieces.tsxindex 3a5e3c4b..aa2c6d47 100644--- a/apps/desktop/src/renderer/views/marketplace/pieces.tsx+++ b/apps/desktop/src/renderer/views/marketplace/pieces.tsx@@ -2,8 +2,9 @@ import { useEffect, useRef, useState, type CSSProperties, type ReactNode } fromimport { IconButton } from '../../components/Controls'import { Sheet, usePresence } from '../../components/Overlay'import { Icon } from '../../components/Icon'+import { HStack, Spacer, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { ThinkingOrb } from '../../components/ThinkingOrb'-import { font } from '../../lib/fonts'import './marketplace.css'// Building blocks the Marketplace's screens share (kit MarketplaceView.swift "Pieces").@@ -11,7 +12,7 @@ import './marketplace.css'export function MarketSection({ title, children }: { title: string; children: ReactNode }) {return (<section className="market-section">- <div style={{ ...font('headline'), color: 'var(--text)', paddingLeft: 4 }}>{title}</div>+ <Text as="div" size="headline" tone="text" className="market-section-title">{title}</Text>{children}</section>)@@ -22,9 +23,6 @@ export function ItemGrid({ children }: { children: ReactNode }) {return <div className="item-grid">{children}</div>}-const oneLine: CSSProperties = { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }-export const lineClamp = (n: number): CSSProperties => ({ display: '-webkit-box', WebkitLineClamp: n, WebkitBoxOrient: 'vertical', overflow: 'hidden' })-export function MarketRow({ title, subtitle, added, busy = false, addLabel = 'Add', icon, onAdd, onOpen }: {title: stringsubtitle: string@@ -43,17 +41,16 @@ export function MarketRow({ title, subtitle, added, busy = false, addLabel = 'Adicon={icon}onOpen={onOpen ?? (added || busy ? undefined : onAdd)}trailing={busy ? (- <span style={{ width: 60, display: 'flex', justifyContent: 'center', flex: 'none' }}>+ <HStack as="span" align="stretch" justify="center" className="market-row-status"><ThinkingOrb size={18} color="var(--secondary)" />- </span>+ </HStack>) : added ? (- <span style={{ width: 60, display: 'flex', justifyContent: 'center', flex: 'none', color: 'var(--secondary)' }} aria-label="Added" title="Added">+ <HStack as="span" align="stretch" justify="center" className="market-row-status market-row-added" aria-label="Added" title="Added"><Icon name="checkmark" size={11} weight="semibold" />- </span>+ </HStack>) : (<buttonclassName="capsule-action"- style={font('subheadline', 'semibold')}onClick={(e) => {e.stopPropagation()onAdd()@@ -88,11 +85,11 @@ export function ItemRow({ title, subtitle, icon, trailing, onOpen }: {}}}>- <div style={{ width: 46, height: 46, flex: 'none', display: 'grid' }}>{icon}</div>- <div style={{ display: 'flex', flexDirection: 'column', gap: 2, minWidth: 0, flex: 1 }}>- <span style={{ ...font('body', 'medium'), color: 'var(--text)', ...oneLine }} title={title}>{title}</span>- <span style={{ ...font('subheadline'), color: 'var(--secondary)', ...oneLine }} title={subtitle}>{subtitle}</span>- </div>+ <div className="market-row-icon">{icon}</div>+ <VStack gap={2} grow>+ <Text size="body" weight="medium" tone="text" truncate title={title}>{title}</Text>+ <Text size="subheadline" tone="secondary" truncate title={subtitle}>{subtitle}</Text>+ </VStack>{trailing}</div>)@@ -103,22 +100,22 @@ export function SkeletonGrid() {return (<div className="item-grid skeleton">{[0, 1, 2, 3].map((i) => (- <div key={i} style={{ display: 'flex', alignItems: 'center', gap: 14, padding: '10px 12px' }}>- <div style={{ width: 46, height: 46, borderRadius: 12, background: 'var(--bubble-agent)', flex: 'none' }} />- <div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>- <div style={{ width: 120, height: 12, borderRadius: 6, background: 'var(--bubble-agent)' }} />- <div style={{ width: 190, height: 10, borderRadius: 5, background: 'var(--bubble-agent)' }} />- </div>- </div>+ <HStack key={i} gap={14} className="skeleton-row">+ <div className="skeleton-icon" />+ <VStack gap={8}>+ <div className="skeleton-title" />+ <div className="skeleton-subtitle" />+ </VStack>+ </HStack>))}</div>)}/** A loaded image, or nothing until (and unless) it loads. */-function RemoteImage({ src, style }: { src: string; style: CSSProperties }) {+function RemoteImage({ src, className, style }: { src: string; className: string; style: CSSProperties }) {const [loaded, setLoaded] = useState(false)- return <img src={src} alt="" draggable={false} onLoad={() => setLoaded(true)} style={{ ...style, display: loaded ? 'block' : 'none' }} />+ return <img src={src} alt="" draggable={false} onLoad={() => setLoaded(true)} className={`${className}${loaded ? ' loaded' : ''}`} style={style} />}function serviceDomain(website: string | null | undefined, name: string, registryName: string | null | undefined) {@@ -141,12 +138,13 @@ export function ServiceLogo({ website, site, name, registryName, size = 46 }: {const domain = site ?? serviceDomain(website, name, registryName)const radius = size * 0.26return (- <div style={{ position: 'relative', width: size, height: size, borderRadius: radius, overflow: 'hidden', background: 'var(--bubble-agent)', display: 'grid', placeItems: 'center', flex: 'none' }}>- <span style={{ ...font(size * 0.4, 'semibold', 'rounded'), color: 'var(--text)' }}>{name.slice(0, 1).toUpperCase() || '?'}</span>+ <div className="market-logo service-logo" style={{ width: size, height: size, borderRadius: radius }}>+ <Text size={size * 0.4} weight="semibold" tone="text" className="service-logo-initial">{name.slice(0, 1).toUpperCase() || '?'}</Text>{domain ? (<RemoteImagesrc={`https://www.google.com/s2/favicons?domain=${encodeURIComponent(domain)}&sz=128`}- style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', objectFit: 'contain', padding: size * 0.2, boxSizing: 'border-box', background: '#fff' }}+ className="market-logo-image service-logo-image"+ style={{ padding: size * 0.2 }}/>) : null}</div>@@ -157,15 +155,16 @@ export function ServiceLogo({ website, site, name, registryName, size = 46 }: {export function AppLogo({ url, name, size = 46 }: { url?: string | null; name: string; size?: number }) {const [loaded, setLoaded] = useState(false)return (- <div aria-hidden style={{ position: 'relative', width: size, height: size, flex: 'none', borderRadius: size * 0.28, background: 'var(--bubble-agent)', display: 'grid', placeItems: 'center' }}>- {!loaded ? <span style={{ ...font(size * 0.4, 'semibold'), color: 'var(--secondary)' }}>{name.slice(0, 1).toUpperCase()}</span> : null}+ <div aria-hidden className="market-logo" style={{ width: size, height: size, borderRadius: size * 0.28 }}>+ {!loaded ? <Text size={size * 0.4} weight="semibold" tone="secondary">{name.slice(0, 1).toUpperCase()}</Text> : null}{url ? (<imgsrc={url}alt=""draggable={false}onLoad={() => setLoaded(true)}- style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', objectFit: 'contain', padding: size * 0.18, boxSizing: 'border-box', display: loaded ? 'block' : 'none' }}+ className={`market-logo-image${loaded ? ' loaded' : ''}`}+ style={{ padding: size * 0.18 }}/>) : null}</div>@@ -174,24 +173,24 @@ export function AppLogo({ url, name, size = 46 }: { url?: string | null; name: sexport function TileIcon({ name }: { name: string }) {return (- <div style={{ width: '100%', height: '100%', borderRadius: 12, background: 'var(--bubble-agent)', display: 'grid', placeItems: 'center', color: 'var(--text)' }}>+ <div className="market-tile"><Icon name={name} size={18} weight="medium" /></div>)}-export function SkillGlyph({ size }: { size?: number }) {+export function SkillGlyph() {return (- <div style={{ width: size ?? '100%', height: size ?? '100%', flex: 'none', borderRadius: 12, background: 'var(--bubble-agent)', display: 'grid', placeItems: 'center', color: 'var(--text)' }}>+ <div className="market-tile"><Icon name="book.pages" size={13} /></div>)}/** Text that opens a web page (replaces the system `Link`). */-export function WebLink({ title, url, style }: { title: string; url: string; style?: CSSProperties }) {+export function WebLink({ title, url, className }: { title: string; url: string; className?: string }) {return (- <button className="plain-link" style={style} title={url} onClick={() => window.codync.app.openExternal(url)}>+ <button className={`plain-link${className ? ` ${className}` : ''}`} title={url} onClick={() => window.codync.app.openExternal(url)}>{title}</button>)@@ -200,12 +199,12 @@ export function WebLink({ title, url, style }: { title: string; url: string; sty/** A full screen's top bar (kit `ScreenHeader`): back on the leading side, centered title, trailing. */export function ScreenHeader({ title, onBack, trailing }: { title: string; onBack: () => void; trailing?: ReactNode }) {return (- <div style={{ position: 'relative', height: 44, padding: '0 12px', display: 'flex', alignItems: 'center', gap: 6, flex: 'none', background: 'var(--background)' }}>- <div style={{ position: 'absolute', left: 60, right: 60, textAlign: 'center', ...font('compactBody', 'semibold'), color: 'var(--text)', ...oneLine }}>{title}</div>+ <HStack gap={6} className="market-screen-header">+ <Text as="div" size="compactBody" weight="semibold" tone="text" truncate className="market-screen-title">{title}</Text><IconButton title="Back" icon="chevron.left" onClick={onBack} />- <span style={{ flex: 1, minWidth: 8 }} />+ <Spacer min={8} />{trailing}- </div>+ </HStack>)}@@ -236,23 +235,23 @@ export function Field({ value, onChange, placeholder, secret = false, lines, monmono?: booleanlabel?: string}) {- const style: CSSProperties = mono ? font('callout', 'regular', 'monospaced') : {}+ const className = `market-field${mono ? ' mono' : ''}`if (lines) {return (<textarea- className="market-field"+ className={className}aria-label={label ?? placeholder}value={value}placeholder={placeholder}spellCheck={false}onChange={(e) => onChange(e.target.value)}- style={{ ...style, lineHeight: 1.3, minHeight: `${lines[0] * 1.3}em`, maxHeight: `${lines[1] * 1.3}em` }}+ style={{ minHeight: `${lines[0] * 1.3}em`, maxHeight: `${lines[1] * 1.3}em` }}/>)}return (<input- className="market-field"+ className={className}aria-label={label ?? placeholder}type={secret ? 'password' : 'text'}value={value}@@ -260,14 +259,13 @@ export function Field({ value, onChange, placeholder, secret = false, lines, monspellCheck={false}autoComplete="off"onChange={(e) => onChange(e.target.value)}- style={style}/>)}/** A danger-colored error line in its own card. */export function ErrorText({ text }: { text: string }) {- return <span className="selectable" style={{ color: 'var(--danger)' }}>{text}</span>+ return <Text tone="danger" className="selectable">{text}</Text>}/** Values with something typed in. */diff --git a/apps/desktop/src/renderer/views/pairing-window.css b/apps/desktop/src/renderer/views/pairing-window.cssnew file mode 100644index 00000000..23fbb9ef--- /dev/null+++ b/apps/desktop/src/renderer/views/pairing-window.css@@ -0,0 +1,18 @@+/* The pairing QR window (PairingWindow). */+.pairing {+ width: 340px;+ padding: 16px;+}+/* White in both schemes, so cameras read the code (also the Computers page's pairing panel). */+.pairing-qr {+ padding: 10px;+ background: #fff;+ border-radius: var(--radius-m);+}+.pairing-qr img {+ display: block;+ image-rendering: pixelated;+}+.pairing-note {+ text-align: center;+}diff --git a/apps/desktop/src/renderer/views/routines/RoutineEditorView.tsx b/apps/desktop/src/renderer/views/routines/RoutineEditorView.tsxindex 7bc2c047..f2599b1f 100644--- a/apps/desktop/src/renderer/views/routines/RoutineEditorView.tsx+++ b/apps/desktop/src/renderer/views/routines/RoutineEditorView.tsx@@ -2,15 +2,14 @@ import { useEffect, useRef, useState } from 'react'import { Button, ChoicePicker, IconButton, Spinner } from '../../components/Controls'import { Icon } from '../../components/Icon'import { Dialog, ModalHeader } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { HStack, Spacer, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { useStore } from '../../store/context'import { emptyDraft, errorText, sameDraft, type Routine, type RoutineScheduleDraft, type RoutineSchedulePreview } from './routine'import { Field } from '../bots/parts'import { RoutineWebhookPanel } from './RoutineWebhookPanel'import './routines.css'-const caption = { ...font('caption'), paddingLeft: 4, lineHeight: 1.4 } as const-export function RoutineEditorView({ botId, routine, saved }: {botId: stringroutine: Routine | null@@ -134,12 +133,11 @@ export function RoutineEditorView({ botId, routine, saved }: {switch (schedule.kind) {case 'cron':return (- <div className="routine-cron" style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>+ <VStack gap={8} className="routine-cron"><div className="routine-cron-fields"><Field label="Cron"><input- className="routine-input"- style={font('body', undefined, 'monospaced')}+ className="routine-input routine-cron-input"value={schedule.expression}placeholder="0 9 * * 1-5"spellCheck={false}@@ -151,114 +149,109 @@ export function RoutineEditorView({ botId, routine, saved }: {<input className="routine-input" value={schedule.zone} placeholder="Asia/Taipei" spellCheck={false} autoCorrect="off" onChange={(e) => update({ zone: e.target.value })} /></Field></div>- <div style={{ paddingLeft: 4 }}>+ <div className="routine-cron-preview">{previewError ? (- <span style={{ ...font('caption'), color: 'var(--danger)', lineHeight: 1.4 }}>{previewError}</span>+ <Text size="caption" tone="danger" className="routine-cron-error">{previewError}</Text>) : shownPreview ? (- <div style={{ display: 'flex', flexDirection: 'column', gap: 2 }}>- <span style={font('caption', 'medium')}>{shownPreview.summary}</span>+ <VStack gap={2}>+ <Text size="caption" weight="medium">{shownPreview.summary}</Text>{shownPreview.nextRunAt ? (- <span style={{ ...font('caption'), color: 'var(--secondary)' }}>+ <Text size="caption" tone="secondary">Next {new Date(shownPreview.nextRunAt).toLocaleString(undefined, { dateStyle: 'medium', timeStyle: 'short' })}- </span>+ </Text>) : null}- {shownPreview.warning ? <span style={{ ...font('caption'), color: 'var(--secondary)' }}>{shownPreview.warning}</span> : null}- </div>+ {shownPreview.warning ? <Text size="caption" tone="secondary">{shownPreview.warning}</Text> : null}+ </VStack>) : (- <span style={{ ...font('caption', undefined, 'monospaced'), color: 'var(--tertiary)', whiteSpace: 'pre' }}>minute hour day month weekday</span>+ <Text size="caption" mono tone="tertiary" className="routine-cron-hint">minute hour day month weekday</Text>)}</div>- </div>+ </VStack>)case 'webhook':return routine && routine.triggers.some((t) => t.type === 'webhook' || t.type === 'event') ? (<RoutineWebhookPanel botId={botId} routineId={routine.id} />) : (- <span style={{ ...caption, color: 'var(--secondary)' }}>Runs each time something is posted to its URL. Save to get the URL and key.</span>+ <Text size="caption" tone="secondary" className="routine-caption">Runs each time something is posted to its URL. Save to get the URL and key.</Text>)default:- return <span style={{ ...caption, color: 'var(--secondary)' }}>Set up by the bot. Pick Schedule or Webhook to replace it.</span>+ return <Text size="caption" tone="secondary" className="routine-caption">Set up by the bot. Pick Schedule or Webhook to replace it.</Text>}}return (- <div style={{ display: 'flex', flexDirection: 'column', maxHeight: 700, minHeight: 0, background: 'var(--background)', color: 'var(--text)', ...font(13) }}>+ <VStack className="routine-editor"><ModalHeader title={routine ? 'Edit routine' : 'Set up a routine'} />{/* The card fits the form; it scrolls only when taller than the window allows. */}- <fieldset className="routine-form" disabled={busy || !loaded} style={{ flex: '1 1 auto', minHeight: 0, overflowY: 'auto' }}>- <div style={{ display: 'flex', flexDirection: 'column', gap: 24, padding: 20 }}>- <div style={{ display: 'flex', flexDirection: 'column', gap: 14 }}>+ <fieldset className="routine-form" disabled={busy || !loaded}>+ <VStack gap={24} className="routine-form-body">+ <VStack gap={14}><Field label="Name"><input className="routine-input" value={name} placeholder="e.g. Morning summary" onChange={(e) => setName(e.target.value)} /></Field><Field label="Instruction"><textarea className="routine-input" value={instruction} placeholder="Describe what this bot should do each time it runs." onChange={(e) => setInstruction(e.target.value)} /></Field>- </div>- <div style={{ display: 'flex', flexDirection: 'column', gap: 14 }}>+ </VStack>+ <VStack gap={14}><Field label="When to run"><ChoicePicker selection={schedule.kind} options={options} onChange={(kind) => update({ kind })} fits /></Field>{loaded ? (triggerFields()) : (- <span style={{ display: 'inline-flex', alignItems: 'center', gap: 6, color: 'var(--secondary)' }}>+ <HStack as="span" gap={6} className="routine-loading"><Icon name="clock" size={12} />Loading schedule…- </span>+ </HStack>)}- </div>- <div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>- <button- className="press"- aria-expanded={advanced}- onClick={() => setAdvanced((a) => !a)}- style={{ display: 'flex', alignItems: 'center', gap: 6, paddingLeft: 4, ...font('compactSecondary'), color: 'var(--secondary)', width: '100%' }}- >+ </VStack>+ <VStack gap={12}>+ <button className="press routine-advanced" aria-expanded={advanced} onClick={() => setAdvanced((a) => !a)}>Run settings- <span style={{ display: 'flex', transform: `rotate(${advanced ? 180 : 0}deg)`, transition: 'transform var(--layout)' }}>+ <span className={`routine-chevron ${advanced ? 'open' : ''}`}><Icon name="chevron.down" size={10} weight="semibold" /></span>- <span style={{ flex: 1 }} />- {!advanced ? <span style={{ color: 'var(--tertiary)' }}>Timeout {timeout}s</span> : null}+ <Spacer />+ {!advanced ? <Text tone="tertiary">Timeout {timeout}s</Text> : null}</button>{advanced ? (- <div className="routine-fade" style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>+ <VStack gap={12} className="routine-fade"><Field label="Timeout (seconds)"><input className="routine-input" value={timeout} placeholder="3600" onChange={(e) => setTimeoutText(e.target.value)} /></Field>- <span style={{ ...caption, color: 'var(--secondary)' }}>A run is stopped after this long. 1 second to 24 hours.</span>- </div>+ <Text size="caption" tone="secondary" className="routine-caption">A run is stopped after this long. 1 second to 24 hours.</Text>+ </VStack>) : null}- </div>- </div>+ </VStack>+ </VStack></fieldset>- <div style={{ display: 'flex', flexDirection: 'column', gap: 12, padding: 20, flex: 'none' }}>+ <VStack gap={12} className="routine-editor-footer">{previewError !== null ? (- <button className="press" style={{ alignSelf: 'flex-start' }} disabled={store.isOffline} onClick={() => void checkSchedule()}>+ <button className="press routine-retry" disabled={store.isOffline} onClick={() => void checkSchedule()}>Check schedule again</button>) : null}{!loaded && error !== null ? (- <button className="press" style={{ alignSelf: 'flex-start' }} onClick={() => void loadSchedule()}>+ <button className="press routine-retry" onClick={() => void loadSchedule()}>Retry loading schedule</button>) : null}- {schedule.kind !== 'cron' && previewError ? <span style={{ ...font('caption'), color: 'var(--danger)' }}>{previewError}</span> : null}+ {schedule.kind !== 'cron' && previewError ? <Text size="caption" tone="danger">{previewError}</Text> : null}{error ? (- <span style={{ display: 'flex', gap: 6, alignItems: 'flex-start', ...font('callout'), color: 'var(--danger)', userSelect: 'text' }}>- <Icon name="exclamationmark.circle" size={12} style={{ marginTop: 1 }} />+ <HStack as="span" gap={6} align="flex-start" className="routine-error">+ <Icon name="exclamationmark.circle" size={12} className="routine-error-icon" />{error}- </span>+ </HStack>) : null}{store.isOffline ? (- <span style={{ display: 'flex', gap: 6, alignItems: 'center', ...font('caption'), color: 'var(--danger)' }}>+ <HStack as="span" gap={6} className="routine-offline"><Icon name="wifi.slash" size={10} />Connect to this computer to save your routine.- </span>+ </HStack>) : null}- <div style={{ display: 'flex', alignItems: 'center', gap: 16 }}>+ <HStack gap={16}>{routine ? (<><IconButton title="Delete routine" icon="trash" onClick={() => setConfirmDelete(true)} />@@ -277,13 +270,13 @@ export function RoutineEditorView({ botId, routine, saved }: {/></>) : null}- <span style={{ flex: 1 }} />+ <Spacer /><Button disabled={!canSave} onClick={() => void save()} title="Save (⌘S)">{busy ? <Spinner size={12} /> : null}{busy ? 'Saving…' : routine ? 'Save changes' : 'Create routine'}</Button>- </div>- </div>+ </HStack>+ </VStack><Dialogopen={confirmDelete}@@ -306,6 +299,6 @@ export function RoutineEditorView({ botId, routine, saved }: {]}onClose={() => setConfirmDelete(false)}/>- </div>+ </VStack>)}diff --git a/apps/desktop/src/renderer/views/routines/RoutineWebhookPanel.tsx b/apps/desktop/src/renderer/views/routines/RoutineWebhookPanel.tsxindex 06b3efaa..2dd3d55c 100644--- a/apps/desktop/src/renderer/views/routines/RoutineWebhookPanel.tsx+++ b/apps/desktop/src/renderer/views/routines/RoutineWebhookPanel.tsx@@ -1,10 +1,12 @@import { useEffect, useState, type ReactNode } from 'react'import { IconButton } from '../../components/Controls'import { Dialog } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { HStack, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { useStore } from '../../store/context'import { Field } from '../bots/parts'import { errorText, type RoutineWebhook } from './routine'+import './routines.css'/** A saved webhook routine's address and key: copy either, reveal or replace the key. */export function RoutineWebhookPanel({ botId, routineId }: { botId: string; routineId: string }) {@@ -38,22 +40,10 @@ export function RoutineWebhookPanel({ botId, routineId }: { botId: string; routi}, [routineId])const value = (text: string, copy: 'url' | 'key', extra?: ReactNode) => (- <div style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '8px 6px 8px 12px', background: 'var(--bubble-user)', borderRadius: 12 }}>- <span- style={{- ...font('callout', undefined, 'monospaced'),- flex: 1,- minWidth: 0,- userSelect: 'text',- wordBreak: 'break-all',- display: '-webkit-box',- WebkitLineClamp: 2,- WebkitBoxOrient: 'vertical',- overflow: 'hidden',- }}- >+ <HStack gap={8} className="routine-webhook-value">+ <Text size="callout" mono lines={2} grow className="routine-webhook-text">{text}- </span>+ </Text>{extra}<IconButtontitle={copied === copy ? 'Copied' : 'Copy'}@@ -64,12 +54,11 @@ export function RoutineWebhookPanel({ botId, routineId }: { botId: string; routisetCopied(copy)}}/>- </div>+ </HStack>)- const caption = { ...font('caption'), paddingLeft: 4, lineHeight: 1.4 }return (- <div style={{ display: 'flex', flexDirection: 'column', gap: 14 }}>+ <VStack gap={14}>{webhook ? (<><Field label={webhook.url ? 'URL' : 'Local URL'}>{value(webhook.url ?? webhook.localUrl, 'url')}</Field>@@ -83,17 +72,17 @@ export function RoutineWebhookPanel({ botId, routineId }: { botId: string; routi</>,)}</Field>- <span style={{ ...caption, color: 'var(--secondary)' }}>+ <Text size="caption" tone="secondary" className="routine-caption">{webhook.url? 'POST with Authorization: Bearer <key>. For GitHub, use content type application/json and the key as the secret. ' +'Deliveries wait up to 72 hours while this computer is off. They pass through the Codync cloud, which can read them.': 'The Codync cloud is off, so only this computer can send to it.'}- </span>+ </Text></>) : error ? (- <span style={{ ...caption, color: 'var(--danger)' }}>{error}</span>+ <Text size="caption" tone="danger" className="routine-caption">{error}</Text>) : (- <span style={{ ...caption, color: 'var(--secondary)' }}>Loading webhook…</span>+ <Text size="caption" tone="secondary" className="routine-caption">Loading webhook…</Text>)}<Dialogopen={confirmRotate}@@ -102,6 +91,6 @@ export function RoutineWebhookPanel({ botId, routineId }: { botId: string; routiactions={[{ title: 'Replace key', destructive: true, action: () => void load(true) }]}onClose={() => setConfirmRotate(false)}/>- </div>+ </VStack>)}diff --git a/apps/desktop/src/renderer/views/routines/RoutinesView.tsx b/apps/desktop/src/renderer/views/routines/RoutinesView.tsxindex 3929be32..81da77b7 100644--- a/apps/desktop/src/renderer/views/routines/RoutinesView.tsx+++ b/apps/desktop/src/renderer/views/routines/RoutinesView.tsx@@ -1,10 +1,12 @@import { useEffect, useRef, useState } from 'react'import { IconButton, Switch } from '../../components/Controls'import { Sheet } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { HStack, Spacer, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { useStore } from '../../store/context'import { errorText, isActiveRun, type Routine, type RoutineListing, type RoutineRun } from './routine'import { RoutineEditorView } from './RoutineEditorView'+import './routines.css'/** The open editor: on a routine, or (`routineId` null) setting up a new one. `id` is one per opening. */interface EditorTarget {@@ -118,37 +120,37 @@ export function RoutinesView({ botId, initialId, onClose }: { botId: string; iniconst editingRoutine = routines.find((r) => r.id === editing?.routineId) ?? nullreturn (- <div style={{ display: 'flex', flexDirection: 'column', gap: onClose ? 16 : 10, color: 'var(--text)', ...font(13) }}>- <div style={{ display: 'flex', alignItems: 'center' }}>- <span style={{ ...font(13, 'semibold'), paddingLeft: 2 }}>Routines</span>- <span style={{ flex: 1 }} />+ <VStack gap={onClose ? 16 : 10} className="routines">+ <HStack>+ <Text size="body" weight="semibold" className="routines-title">Routines</Text>+ <Spacer /><IconButton title="Ask the bot for a routine" icon="text.bubble" disabled={store.isOffline} onClick={() => {store.setRoutineDraft(botId, 'I want a routine that ')onClose?.()}} /><IconButton title="Set up a routine" icon="plus" disabled={store.isOffline} onClick={() => open(null)} />{onClose ? <IconButton title="Close routines" icon="xmark" onClick={onClose} /> : null}- </div>- {loadError ? <span style={{ ...font('caption'), color: 'var(--danger)' }}>{loadError}</span> : null}- {error ? <span style={{ ...font('caption'), color: 'var(--danger)', userSelect: 'text' }}>{error}</span> : null}+ </HStack>+ {loadError ? <Text size="caption" tone="danger">{loadError}</Text> : null}+ {error ? <Text size="caption" tone="danger" className="routines-error">{error}</Text> : null}{routines.length === 0 ? (- <div className="outlined-card" style={{ ...font(12), lineHeight: 1.45, color: 'var(--secondary)', padding: 14 }}>+ <Text as="div" size="callout" tone="secondary" className="outlined-card routines-empty">{loaded ? 'No routines yet. Ask the bot for one, or set it up yourself with +.' : 'Loading routines…'}- </div>+ </Text>) : (- <div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>+ <VStack gap={8}>{routines.map((routine) => (- <div key={routine.id} className="outlined-card" style={{ display: 'flex', alignItems: 'center', gap: 12, padding: '0 14px' }}>+ <HStack key={routine.id} gap={12} className="outlined-card routines-card"><button className="routine-row" onClick={() => open(routine.id)}>- <span style={{ color: 'var(--text)' }}>{routine.name}</span>- <span style={{ ...font('caption'), color: routine.lastError ? 'var(--danger)' : 'var(--secondary)' }}>{summary(routine)}</span>+ <Text tone="text">{routine.name}</Text>+ <Text size="caption" tone={routine.lastError ? 'danger' : 'secondary'}>{summary(routine)}</Text></button>- <span aria-label={routine.name} style={{ display: 'flex' }}>+ <HStack as="span" align="stretch" aria-label={routine.name}><Switch on={routine.enabled} disabled={busy || store.isOffline} onChange={(on) => void action('setRoutineEnabled', routine, on)} />- </span>- </div>+ </HStack>+ </HStack>))}- </div>+ </VStack>)}{/* A routine opened before the list arrived waits for it. */}<Sheet open={editing !== null && (editing.routineId === null || editingRoutine !== null)} onClose={() => setEditing(null)} width={540}>@@ -161,6 +163,6 @@ export function RoutinesView({ botId, initialId, onClose }: { botId: string; ini/>) : null}</Sheet>- </div>+ </VStack>)}diff --git a/apps/desktop/src/renderer/views/routines/routines.css b/apps/desktop/src/renderer/views/routines/routines.cssindex 1b120b04..2a2d5850 100644--- a/apps/desktop/src/renderer/views/routines/routines.css+++ b/apps/desktop/src/renderer/views/routines/routines.css@@ -22,13 +22,78 @@ textarea.routine-input {min-height: calc(3lh + 24px);max-height: calc(8lh + 24px);}+.routine-cron-input {+ font-size: var(--text-body);+ font-weight: 400;+ font-family: var(--mono);+}+/* A routine's editor (RoutineEditorView): the card fits the form. */+.routine-editor {+ max-height: 700px;+ min-height: 0;+ background: var(--background);+ color: var(--text);+ font-size: var(--text-body);+ font-weight: 400;+}.routine-form {+ flex: 1 1 auto;+ min-height: 0;+ overflow-y: auto;border: none;margin: 0;padding: 0;min-width: 0;}+.routine-form-body,+.routine-editor-footer {+ padding: 20px;+}+.routine-editor-footer {+ flex: none;+}+.routine-caption {+ padding-left: 4px;+ line-height: 1.4;+}+.routine-loading {+ color: var(--secondary);+}+.routine-advanced {+ display: flex;+ align-items: center;+ gap: 6px;+ width: 100%;+ padding-left: 4px;+ font-size: var(--text-caption);+ font-weight: 400;+ color: var(--secondary);+}+.routine-chevron {+ display: flex;+ transition: transform var(--layout);+}+.routine-chevron.open {+ transform: rotate(180deg);+}+.routine-retry {+ align-self: flex-start;+}+.routine-error {+ font-size: var(--text-callout);+ font-weight: 400;+ color: var(--danger);+ user-select: text;+}+.routine-error-icon {+ margin-top: 1px;+}+.routine-offline {+ font-size: var(--text-caption);+ font-weight: 400;+ color: var(--danger);+}.routine-form:disabled {opacity: 0.6;}@@ -50,6 +115,16 @@ textarea.routine-input {width: 170px;flex: none;}+/* The schedule check under the fields. */+.routine-cron-preview {+ padding-left: 4px;+}+.routine-cron-error {+ line-height: 1.4;+}+.routine-cron-hint {+ white-space: pre;+}@container (max-width: 400px) {.routine-cron-fields {flex-direction: column;@@ -63,6 +138,36 @@ textarea.routine-input {}}+/* A webhook's URL or key with its actions (RoutineWebhookPanel). */+.routine-webhook-value {+ padding: 8px 6px 8px 12px;+ background: var(--bubble-user);+ border-radius: var(--radius-m);+}+.routine-webhook-text {+ user-select: text;+ word-break: break-all;+}++/* The routine list (RoutinesView). */+.routines {+ color: var(--text);+ font-size: var(--text-body);+ font-weight: 400;+}+.routines-title {+ padding-left: 2px;+}+.routines-error {+ user-select: text;+}+.routines-empty {+ padding: 14px;+ line-height: 1.45;+}+.routines-card {+ padding: 0 14px;+}.routine-row {display: flex;flex-direction: column;diff --git a/apps/desktop/src/renderer/views/search-palette.css b/apps/desktop/src/renderer/views/search-palette.cssindex 3aa8d9e3..fe7ac454 100644--- a/apps/desktop/src/renderer/views/search-palette.css+++ b/apps/desktop/src/renderer/views/search-palette.css@@ -12,7 +12,7 @@height: 56px;padding: 0 20px;flex: none;- font-size: calc(15px * var(--scale));+ font-size: var(--text-title3);}.palette-field input {flex: 1;@@ -41,15 +41,10 @@.palette-row.active {background: var(--bubble-user);}-.palette-line {- white-space: nowrap;- overflow: hidden;- text-overflow: ellipsis;-}.palette-key {flex: none;font-family: inherit;- font-size: calc(12px * var(--scale));+ font-size: var(--text-callout);padding: 0 6px;height: 22px;border-radius: var(--radius-xs);@@ -58,5 +53,5 @@padding: 28px 0;text-align: center;color: var(--secondary);- font-size: calc(13px * var(--scale));+ font-size: var(--text-body);}diff --git a/apps/desktop/src/renderer/views/settings/AnalyticsSheet.tsx b/apps/desktop/src/renderer/views/settings/AnalyticsSheet.tsxindex 911877db..ed7c5755 100644--- a/apps/desktop/src/renderer/views/settings/AnalyticsSheet.tsx+++ b/apps/desktop/src/renderer/views/settings/AnalyticsSheet.tsx@@ -1,7 +1,8 @@import { CardForm, CardSection } from '../../components/Controls'import { Icon } from '../../components/Icon'-import { ModalHeader } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { ModalHeader, SheetPage } from '../../components/Overlay'+import { HStack, IconSlot, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'const PRIVACY_POLICY = 'https://codync.dev/privacy'@@ -19,14 +20,14 @@ const details = [/** Settings → Privacy's info button: everything Share usage analytics covers. */export function AnalyticsSheet() {return (- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' }}>+ <SheetPage><ModalHeader title="Usage analytics" /><CardForm><CardSectionfooter={<>See the{' '}- <button style={{ color: 'var(--text)', textDecoration: 'underline' }} onClick={() => window.codync.app.openExternal(PRIVACY_POLICY)}>+ <button className="settings-link" onClick={() => window.codync.app.openExternal(PRIVACY_POLICY)}>Privacy Policy</button>{' '}for details.@@ -34,18 +35,18 @@ export function AnalyticsSheet() {}>{details.map((d) => (- <div key={d.title} className="settings-row" style={{ alignItems: 'flex-start' }}>- <span style={{ width: 20, display: 'flex', justifyContent: 'center', paddingTop: 2 }}>+ <HStack key={d.title} align="flex-start" className="settings-row">+ <IconSlot width={20} className="settings-analytics-icon"><Icon name={d.icon} size={15} color="var(--secondary)" />- </span>- <div className="settings-stack" style={{ flex: 1, gap: 2 }}>+ </IconSlot>+ <VStack gap={2} grow className="settings-stack"><span>{d.title}</span>- <span style={{ ...font('footnote'), color: 'var(--secondary)' }}>{d.detail}</span>- </div>- </div>+ <Text size="footnote" tone="secondary">{d.detail}</Text>+ </VStack>+ </HStack>))}</CardSection></CardForm>- </div>+ </SheetPage>)}diff --git a/apps/desktop/src/renderer/views/settings/ApprovalSheet.tsx b/apps/desktop/src/renderer/views/settings/ApprovalSheet.tsxindex 9492e421..10064aaf 100644--- a/apps/desktop/src/renderer/views/settings/ApprovalSheet.tsx+++ b/apps/desktop/src/renderer/views/settings/ApprovalSheet.tsx@@ -2,7 +2,8 @@ import { useState } from 'react'import { Button, Spinner } from '../../components/Controls'import { Icon } from '../../components/Icon'import { ModalHeader } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { HStack, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import type { Approval } from '../../store/app-model'import { useApp } from '../../store/context'import { deviceIcon, errorText, Reveal, spacedCode } from './parts'@@ -31,45 +32,44 @@ export function ApprovalSheet({ approval }: { approval: Approval }) {}}- const center = { textAlign: 'center' as const }return (- <div style={{ width: 420, display: 'flex', flexDirection: 'column' }}>+ <VStack className="settings-approval"><ModalHeader title="Access request" />- <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 16, padding: '0 24px 24px' }}>+ <VStack align="center" gap={16} className="settings-approval-body"><Icon name={deviceIcon(request.platform)} size={40} weight="light" color="var(--secondary)" />- <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 4 }}>- <div style={{ ...font('title3', 'semibold'), ...center }}>+ <VStack align="center" gap={4}>+ <Text as="div" size="title3" weight="semibold" className="settings-centered">{request.deviceName} wants to use {approval.store.hostName}- </div>- {request.email ? <div style={{ ...font('callout'), color: 'var(--secondary)' }}>Signed in as {request.email}</div> : null}- </div>+ </Text>+ {request.email ? <Text as="div" size="callout" tone="secondary">Signed in as {request.email}</Text> : null}+ </VStack>{request.code ? (<>- <div className="selectable settings-appear" style={{ ...font(48, 'semibold', 'monospaced'), color: 'var(--text)' }} aria-label={`Code ${request.code.split('').join(' ')}`}>+ <Text as="div" size={48} weight="semibold" mono tone="text" className="selectable settings-appear" aria-label={`Code ${request.code.split('').join(' ')}`}>{spacedCode(request.code)}- </div>- <div style={{ ...font('callout'), color: 'var(--secondary)', ...center }}>+ </Text>+ <Text as="div" size="callout" tone="secondary" className="settings-centered">Approve only if {request.deviceName} shows exactly this code. If it doesn't, deny: someone may be trying to get in.- </div>+ </Text></>) : (<><Spinner />- <div style={{ ...font('callout'), color: 'var(--secondary)' }}>Waiting for {request.deviceName} to show its code…</div>+ <Text as="div" size="callout" tone="secondary">Waiting for {request.deviceName} to show its code…</Text></>)}<Reveal show={error !== null}>- <div style={{ ...font('caption'), color: 'var(--danger)', ...center }}>{error}</div>+ <Text as="div" size="caption" tone="danger" className="settings-centered">{error}</Text></Reveal>- <div style={{ display: 'flex', gap: 12 }}>+ <HStack align="stretch" gap={12}><Button kind="secondary" onClick={() => void decide(false)} disabled={busy}>Deny</Button><Button onClick={() => void decide(true)} disabled={busy || !request.code}>Approve</Button>- </div>- </div>- </div>+ </HStack>+ </VStack>+ </VStack>)}diff --git a/apps/desktop/src/renderer/views/settings/ComputersView.tsx b/apps/desktop/src/renderer/views/settings/ComputersView.tsxindex f46463a6..95d42af9 100644--- a/apps/desktop/src/renderer/views/settings/ComputersView.tsx+++ b/apps/desktop/src/renderer/views/settings/ComputersView.tsx@@ -5,7 +5,8 @@ import { newSSHProfile, type SSHProfile } from '@shared/ssh'import { Button, CardSection, IconButton, Spinner, Switch } from '../../components/Controls'import { Icon } from '../../components/Icon'import { Dialog, ModalHeader, Sheet, useDismiss } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { HStack, IconSlot, Spacer, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { useModel } from '../../lib/observable'import { useAccount } from '../../store/account'import type { BotStore } from '../../store/bot-store'@@ -15,6 +16,7 @@ import { deviceIcon, errorText, liveClient, relativeDay, Reveal, SectionHeader,import { useSSH } from './ssh-model'import { SSHRow } from './SSHRow'import { VoiceChatSettingsView } from './VoiceChatSettingsView'+import '../pairing-window.css'/*** Computers this app manages (itself and SSH), with their account, relay and authorized devices;@@ -32,8 +34,8 @@ export function ComputersView() {const others = cloud.computers.filter((c) => !managedIds.has(c.computerId) && !reached.some((r) => r.id === c.computerId))return (- <div style={{ height: '100%', overflowY: 'auto', background: 'var(--background)' }}>- <div style={{ display: 'flex', flexDirection: 'column', gap: 26, padding: '14px 14px 20px' }}>+ <div className="settings-computers">+ <VStack gap={26} className="settings-computers-content">{managed.map((store) => (<ManagedComputerCard key={store.computer.id} store={store} ssh={sshState.isSSH(store.computer.id)} />))}@@ -43,9 +45,9 @@ export function ComputersView() {<IconButton title="Add SSH computer" icon="plus" onClick={() => setEditing({ profile: newSSHProfile(window.codync.hostPort), isNew: true })} /></SectionHeader><Reveal show={sshState.state.profiles.length === 0}>- <div style={{ ...font('callout'), color: 'var(--secondary)' }}>+ <Text as="div" size="callout" tone="secondary">Run bots on another computer you reach with SSH. It needs codync-host installed; your SSH keys stay on {thisMac}.- </div>+ </Text></Reveal>{sshState.state.profiles.map((profile) => (<SSHRow key={profile.id} profile={profile} status={sshState.status(profile.id)} edit={() => setEditing({ profile, isNew: false })} />@@ -57,9 +59,9 @@ export function ComputersView() {{account.isSignedIn ? <IconButton title="Refresh" icon="arrow.clockwise" onClick={() => void cloud.refresh()} /> : null}</SectionHeader>{!account.isSignedIn ? (- <div style={{ ...font('callout'), color: 'var(--secondary)' }}>Sign in to reach the other computers in your account from {thisMac}.</div>+ <Text as="div" size="callout" tone="secondary">Sign in to reach the other computers in your account from {thisMac}.</Text>) : reached.length === 0 && others.length === 0 ? (- <div style={{ ...font('callout'), color: 'var(--secondary)' }}>No other computers in your account yet.</div>+ <Text as="div" size="callout" tone="secondary">No other computers in your account yet.</Text>) : null}{reached.map((computer) => {const store = app.store(computer.id)@@ -71,13 +73,13 @@ export function ComputersView() {<div className="settings-row"><ComputerBadge computer={store.computer} size={22} /><div className="settings-stack">- <span style={font('callout', 'medium')}>{store.hostName}</span>- <span style={{ ...font('caption'), color: stale ? 'var(--attention)' : 'var(--secondary)' }}>+ <Text size="callout" weight="medium">{store.hostName}</Text>+ <Text size="caption" tone={stale ? 'attention' : 'secondary'}>{stale ? `Older copy of this computer · ${statusText(store)}` : statusText(store)}- </span>+ </Text></div><RouteIcon store={store} />- <span style={{ flex: 1 }} />+ <Spacer /><IconButton title={`Remove from ${thisMac}`} icon="minus.circle" onClick={() => app.detach(computer.id)} /></div></div>@@ -89,14 +91,14 @@ export function ComputersView() {<div className="settings-row"><ComputerBadge computer={{ id: computer.computerId, name: computer.name, signKey: computer.signKey, urls: [], device: computer.device ?? null }} size={22} /><div className="settings-stack">- <span style={font('callout', 'medium')}>{computer.name}</span>- <span style={{ ...font('caption'), color: 'var(--secondary)' }}>{computer.online ? 'Online' : 'Offline'}</span>+ <Text size="callout" weight="medium">{computer.name}</Text>+ <Text size="caption" tone="secondary">{computer.online ? 'Online' : 'Offline'}</Text></div></div></div>))}</div>- </div>+ </VStack><Sheet open={editing !== null} onClose={() => setEditing(null)} width={460}>{editing ? <SSHProfileEditor key={editing.profile.id} profile={editing.profile} isNew={editing.isNew} /> : null}@@ -110,9 +112,9 @@ function RouteIcon({ store }: { store: BotStore }) {if (store.connection.kind !== 'online' || !store.hostRoute || store.hostRoute === 'loopback') return nullconst relay = store.hostRoute === 'relay'return (- <span title={relay ? 'Through Cloudflare (encrypted)' : 'Direct: Wi-Fi or Tailscale'} aria-label={relay ? 'Through Cloudflare' : 'Wi-Fi or Tailscale'} style={{ display: 'flex', color: 'var(--tertiary)' }}>+ <HStack as="span" align="stretch" title={relay ? 'Through Cloudflare (encrypted)' : 'Direct: Wi-Fi or Tailscale'} aria-label={relay ? 'Through Cloudflare' : 'Wi-Fi or Tailscale'} className="settings-route"><Icon name={relay ? 'cloud' : 'wifi'} size={12} />- </span>+ </HStack>)}@@ -165,9 +167,9 @@ function ManagedComputerCard({ store, ssh: overSSH }: { store: BotStore; ssh: boconst owner = cloud?.owner ?? nullconst accountLine = (- <div className="settings-row" style={{ gap: 8 }}>+ <HStack gap={8} className="settings-row"><Icon name={owner ? 'person.crop.circle.badge.checkmark' : 'person.crop.circle.badge.plus'} size={13} color="var(--secondary)" />- <span style={{ ...font('callout'), flex: 1 }}>+ <Text size="callout" grow>{owner? owner.userId === account.user?.userId? 'In your account'@@ -175,7 +177,7 @@ function ManagedComputerCard({ store, ssh: overSSH }: { store: BotStore; ssh: bo: account.isSignedIn? 'Not in your account': 'Sign in to add it to your account'}- </span>+ </Text>{owner ? (<Button kind="secondary" onClick={() => setConfirmUnclaim(true)} disabled={busy || !online}>Remove from account@@ -185,21 +187,21 @@ function ManagedComputerCard({ store, ssh: overSSH }: { store: BotStore; ssh: bo{busy ? 'Adding…' : 'Add to account'}</Button>) : null}- </div>+ </HStack>)return (- <div style={{ display: 'flex', flexDirection: 'column', gap: 28 }}>+ <VStack gap={28}><CardSection>{[<div key="header" className="settings-row"><ComputerBadge computer={store.computer} size={26} />- <div className="settings-stack" style={{ flex: 1 }}>- <span style={font('headline')}>{name}</span>- <span style={{ ...font('caption'), color: 'var(--secondary)' }}>+ <VStack grow className="settings-stack">+ <Text size="headline">{name}</Text>+ <Text size="caption" tone="secondary">{overSSH ? 'Over SSH' : isMacLabel} · {statusText(store)}- </span>- </div>+ </Text>+ </VStack>{overSSH ? (// This computer's voice settings are their own Settings page.<IconButton title="Voice chat" icon="waveform" selected={showVoice} disabled={!online} onClick={() => setShowVoice((s) => !s)} />@@ -209,7 +211,7 @@ function ManagedComputerCard({ store, ssh: overSSH }: { store: BotStore; ssh: bo<Switch key="cloud" on={cloud?.enabled ?? false} disabled={busy || !online} onChange={(on) => run(() => app.cloud.setCloud(store, on))}><span className="settings-stack"><span>Reach from anywhere</span>- <span style={{ ...font('caption'), color: cloud?.lastError ? 'var(--attention)' : 'var(--secondary)' }}>{cloudLine}</span>+ <Text size="caption" tone={cloud?.lastError ? 'attention' : 'secondary'}>{cloudLine}</Text></span></Switch>,accountLine,@@ -223,9 +225,9 @@ function ManagedComputerCard({ store, ssh: overSSH }: { store: BotStore; ssh: bo><span className="settings-stack settings-appear"><span>Skip the 6-digit check</span>- <span style={{ ...font('caption'), color: autoApproval ? 'var(--attention)' : 'var(--secondary)' }}>+ <Text size="caption" tone={autoApproval ? 'attention' : 'secondary'}>{autoApproval ? 'Devices on your account get in on their own.' : 'Each new device shows a code you approve here.'}- </span>+ </Text></span></Switch>,]@@ -238,19 +240,19 @@ function ManagedComputerCard({ store, ssh: overSSH }: { store: BotStore; ssh: bo? [<Spinner key="loading" />]: [...(devices.length === 0- ? [<span key="none" style={{ color: 'var(--secondary)' }}>None yet. Pair an iPhone, or approve one from your account.</span>]+ ? [<Text key="none" tone="secondary">None yet. Pair an iPhone, or approve one from your account.</Text>]: []),...devices.map((device) => (- <div key={device.key} className="settings-row settings-appear" style={{ gap: 8 }}>- <span style={{ width: 18, display: 'flex', justifyContent: 'center', color: 'var(--secondary)' }}>+ <HStack key={device.key} gap={8} className="settings-row settings-appear">+ <IconSlot width={18} tone="secondary"><Icon name={deviceIcon(device.platform)} size={13} />- </span>- <div className="settings-stack" style={{ flex: 1 }}>+ </IconSlot>+ <VStack grow className="settings-stack"><span>{device.name}</span>- <span style={{ ...font('caption'), color: 'var(--tertiary)' }}>{deviceDetail(device)}</span>- </div>+ <Text size="caption" tone="tertiary">{deviceDetail(device)}</Text>+ </VStack><IconButton title="Revoke access" icon="xmark.circle" onClick={() => setConfirmRevoke(device)} />- </div>+ </HStack>)),]}</CardSection>@@ -301,7 +303,7 @@ function ManagedComputerCard({ store, ssh: overSSH }: { store: BotStore; ssh: boactions={[{ title: 'Remove from account', destructive: true, action: () => run(() => app.cloud.unclaim(store)) }]}onClose={() => setConfirmUnclaim(false)}/>- </div>+ </VStack>)}@@ -341,43 +343,42 @@ function PairingPanel({ store }: { store: BotStore }) {return () => clearTimeout(timer)}, [info?.expiresAt, load])- const caption = { ...font('caption'), textAlign: 'center' as const }return (- <div style={{ padding: 16, display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 12 }}>+ <VStack align="center" gap={12} className="settings-pairing">{info && qr ? (<>- <div className="settings-appear" style={{ padding: 10, background: '#fff', borderRadius: 12 }}>- <img src={qr} alt={`Pairing code for ${name}`} width={200} height={200} style={{ display: 'block', imageRendering: 'pixelated' }} />+ <div className="pairing-qr settings-appear">+ <img src={qr} alt={`Pairing code for ${name}`} width={200} height={200} /></div>- <div style={{ ...caption, color: 'var(--secondary)' }}>+ <Text as="div" size="caption" tone="secondary" className="settings-centered">Scan with the Codync app or the iPhone Camera. No Tailscale or open ports needed: your iPhone connects directly on the same Wi-Fi, and through the encrypted relay anywhere else.- </div>+ </Text>{store.cloud?.enabled !== true ? (- <div style={{ ...caption, color: 'var(--attention)' }}>+ <Text as="div" size="caption" tone="attention" className="settings-centered">{info.urls.length === 0? 'No network address found and “Reach from anywhere” is off. Connect to Wi-Fi or turn it on.': `“Reach from anywhere” is off, so the iPhone only reaches ${name} on the same network.`}- </div>+ </Text>) : null}- <div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>+ <HStack gap={4}>{info.expiresAt ? (- <span style={{ ...font('caption2'), color: 'var(--tertiary)' }}>+ <Text size="caption2" tone="tertiary">Works once, until {new Date(info.expiresAt).toLocaleTimeString(undefined, { hour: 'numeric', minute: '2-digit' })}- </span>+ </Text>) : null}<IconButton title="New code" icon="arrow.clockwise" onClick={() => void load()} /><IconButton title="Copy pairing link" icon="doc.on.doc" onClick={() => window.codync.app.copy(info.pairingUrl)} />- </div>+ </HStack></>) : error ? (<>- <div style={{ ...caption, color: 'var(--danger)' }}>{error}</div>+ <Text as="div" size="caption" tone="danger" className="settings-centered">{error}</Text><IconButton title="Try again" icon="arrow.clockwise" onClick={() => void load()} /></>) : (<Spinner size={20} />)}- </div>+ </VStack>)}// MARK: SSH@@ -413,17 +414,17 @@ function SSHProfileEditor({ profile: initial, isNew }: { profile: SSHProfile; is}const field = (label: string, value: string, set: (v: string) => void, prompt: string) => (- <div className="settings-row" style={{ gap: 12 }}>- <span style={{ color: 'var(--text)' }}>{label}</span>+ <HStack gap={12} className="settings-row">+ <Text tone="text">{label}</Text><input className="settings-field" aria-label={label} placeholder={prompt} value={value} spellCheck={false} onChange={(e) => set(e.target.value)} />- </div>+ </HStack>)return (// Return in a field saves (the default action).- <div style={{ width: 460, display: 'flex', flexDirection: 'column' }} onKeyDown={(e) => e.key === 'Enter' && e.target instanceof HTMLInputElement && void save()}>+ <VStack className="settings-ssh-editor" onKeyDown={(e) => e.key === 'Enter' && e.target instanceof HTMLInputElement && void save()}><ModalHeader title={isNew ? 'Add SSH computer' : 'Edit SSH computer'} trailing={<IconButton title={isNew ? 'Add' : 'Save'} icon="checkmark" onClick={() => void save()} />} />- <div style={{ display: 'flex', flexDirection: 'column', gap: 16, padding: '4px 20px 20px' }}>+ <VStack gap={16} className="settings-ssh-editor-body"><CardSection>{field('Name', profile.name, (name) => setProfile({ ...profile, name }), 'Optional')}{field('Host', profile.host, (host) => setProfile({ ...profile, host }), 'SSH alias or hostname')}@@ -431,28 +432,28 @@ function SSHProfileEditor({ profile: initial, isNew }: { profile: SSHProfile; is{field('SSH port', port, setPort, 'From SSH config')}<div className="settings-row"><span>Key</span>- <span style={{ flex: 1 }} />- <span style={{ color: 'var(--secondary)' }}>{profile.identityFile?.split('/').pop() ?? 'ssh-agent / SSH config'}</span>+ <Spacer />+ <Text tone="secondary">{profile.identityFile?.split('/').pop() ?? 'ssh-agent / SSH config'}</Text><IconButtontitle="Choose key file"icon="key"onClick={() => void bridge.chooseKey().then((path) => path && setProfile((p) => ({ ...p, identityFile: path })))}/>{profile.identityFile ? (- <span className="settings-appear" style={{ display: 'flex' }}>+ <HStack as="span" align="stretch" className="settings-appear"><IconButton title="Use ssh-agent" icon="xmark.circle" onClick={() => setProfile({ ...profile, identityFile: null })} />- </span>+ </HStack>) : null}</div>{field('Codync port', remotePort, setRemotePort, '')}</CardSection>- <span style={{ ...font('caption'), color: 'var(--secondary)' }}>+ <Text size="caption" tone="secondary">Codync opens an SSH tunnel to codync-host on that computer's loopback. It uses your SSH config and ssh-agent; agent forwarding stays off.- </span>+ </Text><Reveal show={problem !== null}>- <span style={{ ...font('caption'), color: 'var(--danger)' }}>{problem}</span>+ <Text size="caption" tone="danger">{problem}</Text></Reveal>- </div>- </div>+ </VStack>+ </VStack>)}diff --git a/apps/desktop/src/renderer/views/settings/SSHRow.tsx b/apps/desktop/src/renderer/views/settings/SSHRow.tsxindex bdcbd808..c3f77537 100644--- a/apps/desktop/src/renderer/views/settings/SSHRow.tsx+++ b/apps/desktop/src/renderer/views/settings/SSHRow.tsx@@ -1,7 +1,8 @@import { SSH_INSTALL_COMMAND, type SSHProfile, type SSHStatus } from '@shared/ssh'import { Button, IconButton } from '../../components/Controls'import { Icon } from '../../components/Icon'-import { font } from '../../lib/fonts'+import { HStack, IconSlot, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { Reveal } from './parts'import { sshStatusDetail } from '@shared/ssh-startup'@@ -32,13 +33,13 @@ export function SSHRow({ profile, status, edit, attached = true }: { profile: SSreturn (<div className="settings-card settings-appear"><div className="settings-row">- <span style={{ width: 22, display: 'flex', justifyContent: 'center', color: 'var(--secondary)' }}>+ <IconSlot width={22} tone="secondary"><Icon name="terminal" size={13} />- </span>- <div className="settings-stack" style={{ flex: 1 }}>- <span style={font('callout', 'medium')}>{profile.name || profile.host}</span>- <span style={{ ...font('caption'), color: problem ? 'var(--attention)' : 'var(--secondary)' }}>{line}</span>- </div>+ </IconSlot>+ <VStack grow className="settings-stack">+ <Text size="callout" weight="medium">{profile.name || profile.host}</Text>+ <Text size="caption" tone={problem ? 'attention' : 'secondary'}>{line}</Text>+ </VStack>{active ? (<IconButton title="Disconnect" icon="stop.circle" onClick={() => bridge.disconnect(profile.id)} />) : (@@ -49,26 +50,26 @@ export function SSHRow({ profile, status, edit, attached = true }: { profile: SS</div><Reveal show={status.kind === 'confirmHostKey'}>{status.kind === 'confirmHostKey' ? (- <div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>- <span style={{ ...font('caption'), color: 'var(--secondary)' }}>+ <VStack gap={6}>+ <Text size="caption" tone="secondary">First connection to {status.name}. Check that its host key fingerprint matches what the computer's owner sees (- <code style={{ fontFamily: 'var(--mono)' }}>ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub</code>).- </span>+ <code className="settings-mono">ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub</code>).+ </Text>{status.fingerprints.map((f) => (- <span key={f} className="selectable" style={font('caption', undefined, 'monospaced')}>{f}</span>+ <Text key={f} size="caption" mono className="selectable">{f}</Text>))}- <div style={{ display: 'flex', gap: 8 }}>+ <HStack align="stretch" gap={8}><Button onClick={() => bridge.trustHostKey(profile.id)}>Trust and connect</Button><Button kind="secondary" onClick={() => bridge.disconnect(profile.id)}>Cancel</Button>- </div>- </div>+ </HStack>+ </VStack>) : null}</Reveal><Reveal show={status.kind === 'notInstalled' && !dev}>- <div className="settings-row" style={{ gap: 6 }}>+ <HStack gap={6} className="settings-row"><span className="settings-code selectable">{SSH_INSTALL_COMMAND}</span><IconButton title="Copy install command" icon="doc.on.doc" onClick={() => window.codync.app.copy(SSH_INSTALL_COMMAND)} />- </div>+ </HStack></Reveal></div>)diff --git a/apps/desktop/src/renderer/views/settings/SettingsView.tsx b/apps/desktop/src/renderer/views/settings/SettingsView.tsxindex 783cb131..7e775bec 100644--- a/apps/desktop/src/renderer/views/settings/SettingsView.tsx+++ b/apps/desktop/src/renderer/views/settings/SettingsView.tsx@@ -1,9 +1,10 @@-import { useEffect, useState } from 'react'+import { Fragment, useEffect, useState } from 'react'import { islandLabel } from '@shared/island'import { Button, CardForm, CardSection, ChoicePicker, IconButton, ProgressBar, Switch, ValueRow } from '../../components/Controls'import { Icon } from '../../components/Icon'import { useDismiss } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { HStack, IconSlot, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { useModel } from '../../lib/observable'import { DEFAULT_TEXT_SIZE, prefs, TEXT_SIZES, usePref } from '../../lib/prefs'import { useAccount } from '../../store/account'@@ -41,25 +42,25 @@ export function SettingsView({ page: initial }: { page: SettingsPage }) {<div className="settings"><nav className="settings-sidebar">{['Personal', thisComputer].map((group) => (- <div key={group} style={{ display: 'contents' }}>- <div className="settings-group" style={{ paddingTop: group === 'Personal' ? 0 : 16 }}>{group}</div>+ <Fragment key={group}>+ <div className="settings-group">{group}</div>{pages.filter((p) => p.group === group).map((item) => (<button key={item.id} className={`settings-item ${item.id === page ? 'selected' : ''}`} aria-current={item.id === page ? 'page' : undefined} onClick={() => setPage(item.id)}>- <span style={{ width: 18, display: 'flex', justifyContent: 'center', color: 'var(--secondary)' }}>+ <IconSlot width={18} tone="secondary"><Icon name={item.icon} size={13} />- </span>- <span style={{ flex: 1, minWidth: 0, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{item.label ?? item.title}</span>+ </IconSlot>+ <Text truncate grow>{item.label ?? item.title}</Text>{item.id === 'computers' && app.approvals.length > 0 ? (- <span style={{ ...font(11, 'semibold'), color: 'var(--secondary)' }}>{app.approvals.length}</span>+ <Text size="caption" weight="semibold" tone="secondary">{app.approvals.length}</Text>) : null}</button>))}- </div>+ </Fragment>))}</nav><div className="settings-divider" /><div className="settings-main">- <div style={{ ...font(24, 'semibold'), color: 'var(--text)', padding: '30px 32px 8px' }}>{current.title}</div>+ <Text as="div" size={24} weight="semibold" tone="text" className="settings-title">{current.title}</Text><div key={page} className="settings-page"><PageContent page={page} /></div>@@ -87,7 +88,7 @@ function PageContent({ page }: { page: SettingsPage }) {</StoreContext.Provider>) : (<CardForm>- <span style={{ color: 'var(--secondary)' }}>Voice keys are kept by {thisMac}'s host, which isn't running.</span>+ <Text tone="secondary">Voice keys are kept by {thisMac}'s host, which isn't running.</Text></CardForm>)case 'usage':@@ -119,14 +120,14 @@ function GeneralSettings() {<CardSection title="Account" footer={account.errorMessage}><div className="settings-row"><Icon name="person.crop.circle" size={26} color="var(--secondary)" />- <div className="settings-stack" style={{ flex: 1 }}>- <span style={{ whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>+ <VStack grow className="settings-stack">+ <Text truncate>{account.isSignedIn ? (account.user?.email ?? 'Signed in') : 'Not signed in'}- </span>- <span style={{ ...font('caption'), color: 'var(--secondary)' }}>+ </Text>+ <Text size="caption" tone="secondary">{account.isSignedIn ? 'Reach your computers from anywhere' : 'Sign in to reach your computers from anywhere'}- </span>- </div>+ </Text>+ </VStack>{account.isSignedIn ? (<Button kind="secondary" onClick={() => void account.signOut()} disabled={account.isBusy}>{account.isBusy ? 'Please wait…' : 'Sign out'}@@ -184,11 +185,11 @@ function PrivacySettings() {return (<><CardSection title="Privacy" footer="Which features you use, never your messages, code or files. Helps us spot bugs sooner and make Codync better for you.">- <div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>- <span style={{ opacity: running ? 1 : 0.4 }}>Share usage analytics</span>+ <HStack gap={4}>+ <span className={running ? undefined : 'settings-off'}>Share usage analytics</span><IconButton title="About usage analytics" icon="info.circle" onClick={() => setAbout(true)} />- <Switch on={local?.analytics === true} onChange={setShared} disabled={!running} label="Share usage analytics" style={{ flex: 1, justifyContent: 'flex-end' }} />- </div>+ <Switch on={local?.analytics === true} onChange={setShared} disabled={!running} label="Share usage analytics" className="settings-privacy-switch" />+ </HStack></CardSection><FormSheet open={about} onClose={() => setAbout(false)}><AnalyticsSheet />@@ -202,15 +203,15 @@ function UsageLimitsList() {const app = useApp()const stores = app.computers.flatMap((c) => app.store(c.id) ?? [])const withUsage = stores.filter((s) => s.usage.providers.length > 0)- if (withUsage.length === 0) return <span style={{ color: 'var(--secondary)' }}>No usage information yet.</span>+ if (withUsage.length === 0) return <Text tone="secondary">No usage information yet.</Text>return (<>{withUsage.flatMap((store) => [stores.length > 1 ? (- <div key={`${store.computer.id}-label`} style={{ ...font('headline'), display: 'flex', alignItems: 'center', gap: 6 }}>+ <HStack key={`${store.computer.id}-label`} gap={6} className="settings-usage-computer"><ComputerBadge computer={store.computer} size={16} />{store.hostName}- </div>+ </HStack>) : null,<UsageLimits key={store.computer.id} usage={store.usage} />,])}@@ -235,10 +236,10 @@ function UpdateSettings() {<CardSection title="Codync" footer={footer}>{[<ValueRow key="version" label="Version" detail={lastChecked}>- <span style={{ display: 'flex', alignItems: 'center', gap: 10 }}>+ <HStack as="span" gap={10}><span>{window.codync.appVersion}</span><UpdateButton updates={updates} />- </span>+ </HStack></ValueRow>,...(updates.downloadPercent !== null? [@@ -256,7 +257,7 @@ function UpdateSettings() {...(updates.error? [<div key="error" className="settings-row settings-appear">- <span style={{ flex: 1, color: 'var(--attention)' }}>{updates.error}</span>+ <Text tone="attention" grow>{updates.error}</Text><Button kind="secondary" onClick={() => window.codync.updates.check()} disabled={updates.checking}>Retry</Button>diff --git a/apps/desktop/src/renderer/views/settings/UsageLimits.tsx b/apps/desktop/src/renderer/views/settings/UsageLimits.tsxindex f1156285..b32c5978 100644--- a/apps/desktop/src/renderer/views/settings/UsageLimits.tsx+++ b/apps/desktop/src/renderer/views/settings/UsageLimits.tsx@@ -1,44 +1,33 @@import type { Usage } from '@shared/models'-import { ProgressBar } from '../../components/Controls'-import { font } from '../../lib/fonts'+import { HStack, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { prefs, usePref } from '../../lib/prefs'import { ProviderMascot } from '../usage/ProviderMascot'+import { UsageBar } from '../usage/UsageBar'import { providerTintCSS, resetDescription, windowTitle } from '../usage/usage-model'+import './settings.css'/** Every limit as a bar under its provider, the way the menu bar lists them. */export function UsageLimits({ usage }: { usage: Usage }) {const [style] = usePref(prefs.usageIconStyle)return (- <div style={{ display: 'flex', flexDirection: 'column', gap: 18 }}>+ <VStack gap={18}>{usage.providers.map((provider) => (- <div key={provider.id} style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>- <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>+ <VStack key={provider.id} gap={10}>+ <HStack gap={8}><ProviderMascot provider={provider} size={18} style={style} />- <span style={{ ...font(13, 'semibold'), color: 'var(--text)' }}>{provider.name}</span>- </div>+ <Text size="body" weight="semibold" tone="text">{provider.name}</Text>+ </HStack>{provider.windows.map((w) => (- <div key={w.id} style={{ ...font(12), display: 'flex', alignItems: 'center', gap: 10, whiteSpace: 'nowrap' }}>- <span style={{ width: 64, flex: 'none', overflow: 'hidden', textOverflow: 'ellipsis', color: 'var(--text)' }}>{windowTitle(w)}</span>+ <HStack key={w.id} gap={10} className="settings-usage-row">+ <Text tone="text" truncate className="settings-usage-title">{windowTitle(w)}</Text><UsageBar percent={w.percent} tint={providerTintCSS(provider.id)} />- <span style={{ width: 36, flex: 'none', textAlign: 'right', fontVariantNumeric: 'tabular-nums', color: 'var(--text)' }}>{Math.round(w.percent)}%</span>- <span style={{ width: 130, flex: 'none', textAlign: 'right', overflow: 'hidden', textOverflow: 'ellipsis', color: 'var(--secondary)' }}>{resetDescription(w) ?? ''}</span>- </div>+ <Text tone="text" tabular className="settings-usage-percent">{Math.round(w.percent)}%</Text>+ <Text tone="secondary" truncate className="settings-usage-reset">{resetDescription(w) ?? ''}</Text>+ </HStack>))}- </div>+ </VStack>))}- </div>- )-}--/** A capsule filled to `percent`: the provider's tint below 70%, then amber, red from 90%. */-export function UsageBar({ percent, tint }: { percent: number; tint: string }) {- const fill = percent >= 90 ? 'var(--danger)' : percent >= 70 ? 'var(--warning)' : tint- return (- <ProgressBar- value={Math.min(1, Math.max(0.02, percent / 100))}- label={`${Math.round(percent)}% used`}- fill={fill}- style={{ flex: 1, minWidth: 0, height: 6, background: 'var(--bubble-agent)' }}- />+ </VStack>)}diff --git a/apps/desktop/src/renderer/views/settings/VoiceChatSettingsView.tsx b/apps/desktop/src/renderer/views/settings/VoiceChatSettingsView.tsxindex 041d7c1e..29c2613d 100644--- a/apps/desktop/src/renderer/views/settings/VoiceChatSettingsView.tsx+++ b/apps/desktop/src/renderer/views/settings/VoiceChatSettingsView.tsx@@ -3,8 +3,9 @@ import { useEffect, useMemo, useRef, useState } from 'react'import type { HostClient } from '../../client/host-client'import { Button, CardForm, CardSection, ChoicePicker, IconButton, Spinner, ValueRow } from '../../components/Controls'import { Icon } from '../../components/Icon'-import { ModalHeader } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { ModalHeader, SheetPage } from '../../components/Overlay'+import { HStack, Spacer, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { usePref } from '../../lib/prefs'import { useStore } from '../../store/context'import { errorText, liveClient, Reveal } from './parts'@@ -29,9 +30,9 @@ export function VoiceChatSettingsView({ showsHeader = true }: { showsHeader?: bo? 'On-device speech, on this computer. Applies from the next call.': onDeviceUnavailableReason()return (- <div style={{ display: 'flex', flexDirection: 'column', background: 'var(--background)', width: showsHeader ? 440 : undefined, height: showsHeader ? 600 : '100%' }}>+ <SheetPage className={showsHeader ? 'settings-voice-sheet' : undefined}>{showsHeader ? <ModalHeader title="Voice chat" /> : null}- <div style={{ flex: 1, minHeight: 0 }}>+ <div className="settings-voice-body"><CardForm><CardSection title="Voice" footer={footer}>{[@@ -67,7 +68,7 @@ export function VoiceChatSettingsView({ showsHeader = true }: { showsHeader?: bo{provider ? <ProviderVoiceSettings key={provider} provider={provider} /> : null}</CardForm></div>- </div>+ </SheetPage>)}@@ -196,17 +197,17 @@ function ProviderVoiceSettings({ provider }: { provider: VoiceProvider }) {return <ChoicePicker selection={selection} options={options.map((m) => ({ id: m, label: m }))} onChange={onChange} />}- const dimmed = { opacity: hasKey ? 1 : 0.55, pointerEvents: hasKey ? undefined : ('none' as const), transition: 'opacity var(--layout)' }+ const dimmed = hasKey ? 'settings-dimmable' : 'settings-dimmable dimmed'const keyArea = (- <div key="key" style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>+ <VStack key="key" gap={8}>{hasKey && !replacing ? (// The key is on the computer: say so, and offer test / replace / remove.<div className="settings-row"><Icon name="key.fill" size={13} color="var(--secondary)" />- <div className="settings-stack" style={{ flex: 1 }}>- <span style={{ color: 'var(--text)', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>Key saved</span>- <span style={{ ...font('caption'), color: 'var(--tertiary)', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>Stays on {store.hostName}</span>- </div>+ <VStack grow className="settings-stack">+ <Text tone="text" truncate>Key saved</Text>+ <Text size="caption" tone="tertiary" truncate>Stays on {store.hostName}</Text>+ </VStack>{busy ? (<Spinner />) : (@@ -219,8 +220,8 @@ function ProviderVoiceSettings({ provider }: { provider: VoiceProvider }) {</div>) : (// Paste a key; the computer checks it with the provider before keeping it.- <div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>- <div className="settings-row" style={{ gap: 8 }}>+ <VStack gap={10}>+ <HStack gap={8} className="settings-row"><inputtype="password"aria-label="API key"@@ -228,7 +229,7 @@ function ProviderVoiceSettings({ provider }: { provider: VoiceProvider }) {value={key}spellCheck={false}autoComplete="off"- style={{ flex: 1, minWidth: 0 }}+ className="settings-key-input"onChange={(e) => setKey(e.target.value)}onKeyDown={(e) => e.key === 'Enter' && test()}/>@@ -239,29 +240,29 @@ function ProviderVoiceSettings({ provider }: { provider: VoiceProvider }) {Save</Button>)}- </div>- <div className="settings-row" style={font('footnote')}>- <button style={{ color: 'var(--text)', textDecoration: 'underline' }} onClick={() => window.codync.app.openExternal(info.keyPage)}>+ </HStack>+ <Text as="div" size="footnote" className="settings-row">+ <button className="settings-link" onClick={() => window.codync.app.openExternal(info.keyPage)}>Get a key from {info.name}</button>- <span style={{ flex: 1 }} />+ <Spacer />{replacing ? (- <button style={{ color: 'var(--secondary)' }} onClick={() => { setReplacing(false); setKey(''); setResult(null) }}>+ <button className="settings-quiet-button" onClick={() => { setReplacing(false); setKey(''); setResult(null) }}>Cancel</button>) : null}- </div>- </div>+ </Text>+ </VStack>)}<Reveal show={result !== null}>{result ? (- <span style={{ ...font('footnote'), display: 'flex', alignItems: 'center', gap: 5, color: result.ok ? 'var(--secondary)' : 'var(--danger)' }}>+ <HStack as="span" gap={5} className={`settings-key-result ${result.ok ? '' : 'failed'}`}><Icon name={result.ok ? 'checkmark.circle.fill' : 'exclamationmark.circle.fill'} size={10} />{result.text}- </span>+ </HStack>) : null}</Reveal>- </div>+ </VStack>)return (@@ -270,11 +271,11 @@ function ProviderVoiceSettings({ provider }: { provider: VoiceProvider }) {keyArea,...(speechMode? [- <div key="stt" style={dimmed}><ValueRow label="Speech to text">{picker(transcribeModel, models.transcribe, pick('transcribe', setTranscribeModel))}</ValueRow></div>,- <div key="tts" style={dimmed}><ValueRow label="Text to speech">{picker(speechModel, models.speech, pick('speech', setSpeechModel))}</ValueRow></div>,+ <div key="stt" className={dimmed}><ValueRow label="Speech to text">{picker(transcribeModel, models.transcribe, pick('transcribe', setTranscribeModel))}</ValueRow></div>,+ <div key="tts" className={dimmed}><ValueRow label="Text to speech">{picker(speechModel, models.speech, pick('speech', setSpeechModel))}</ValueRow></div>,]- : [<div key="model" style={dimmed}><ValueRow label="Model">{picker(model, models.models, pick('realtime', setModel))}</ValueRow></div>]),- <div key="voice" style={dimmed}>+ : [<div key="model" className={dimmed}><ValueRow label="Model">{picker(model, models.models, pick('realtime', setModel))}</ValueRow></div>]),+ <div key="voice" className={dimmed}><ValueRow label="Voice"><ChoicePickerselection={chosenVoice}@@ -286,7 +287,7 @@ function ProviderVoiceSettings({ provider }: { provider: VoiceProvider }) {/></ValueRow></div>,- <div key="minutes" style={dimmed}>+ <div key="minutes" className={dimmed}><ValueRow label="This month">≈ {voice.voiceMinutes(provider)} min</ValueRow></div>,]}diff --git a/apps/desktop/src/renderer/views/settings/parts.tsx b/apps/desktop/src/renderer/views/settings/parts.tsxindex 1340244c..c124ccad 100644--- a/apps/desktop/src/renderer/views/settings/parts.tsx+++ b/apps/desktop/src/renderer/views/settings/parts.tsx@@ -1,6 +1,7 @@-import type { CSSProperties, ReactNode } from 'react'+import type { ReactNode } from 'react'import { usePresence } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { Spacer } from '../../components/Stack'+import { Text } from '../../components/Text'import type { BotStore } from '../../store/bot-store'import './settings.css'@@ -14,11 +15,11 @@ export function deviceIcon(platform: string | null | undefined) {}/** Keeps `children` mounted while it fades and folds away. */-export function Reveal({ show, children, style }: { show: boolean; children: ReactNode; style?: CSSProperties }) {+export function Reveal({ show, children }: { show: boolean; children: ReactNode }) {const { mounted, shown } = usePresence(show)if (!mounted) return nullreturn (- <div className={`settings-reveal ${shown ? 'shown' : ''}`} style={style}>+ <div className={`settings-reveal ${shown ? 'shown' : ''}`}><div>{children}</div></div>)@@ -28,8 +29,8 @@ export function Reveal({ show, children, style }: { show: boolean; children: Reaexport function SectionHeader({ title, children }: { title: string; children?: ReactNode }) {return (<div className="settings-section-header">- <span role="heading" aria-level={3} style={{ ...font(13, 'semibold'), color: 'var(--text)' }}>{title}</span>- <span style={{ flex: 1 }} />+ <Text as="h3" size="body" weight="semibold" tone="text">{title}</Text>+ <Spacer />{children}</div>)diff --git a/apps/desktop/src/renderer/views/settings/settings.css b/apps/desktop/src/renderer/views/settings/settings.cssindex bc1f6ff9..6cabd82e 100644--- a/apps/desktop/src/renderer/views/settings/settings.css+++ b/apps/desktop/src/renderer/views/settings/settings.css@@ -14,11 +14,14 @@padding: 30px 10px 10px;}.settings-group {- font-size: calc(12px * var(--scale));+ font-size: var(--text-callout);font-weight: 500;color: var(--tertiary);padding: 0 10px 4px;}+.settings-group:not(:first-child) {+ padding-top: 16px;+}.settings-item {display: flex;align-items: center;@@ -26,13 +29,14 @@height: 32px;padding: 0 10px;border-radius: var(--radius-s);- font-size: calc(13px * var(--scale));+ font-size: var(--text-body);color: var(--text);transition: background-color var(--hover);}.settings-item.selected {background: rgba(var(--text-rgb), 0.08);}+/* A row's leading icon, centered in a fixed column so the labels line up. */.settings-divider {width: 1px;flex: none;@@ -44,6 +48,9 @@display: flex;flex-direction: column;}+.settings-title {+ padding: 30px 32px 8px;+}.settings-page {flex: 1;min-height: 0;@@ -91,13 +98,121 @@}.settings-code {font-family: var(--mono);- font-size: calc(11px * var(--scale));+ font-size: var(--text-caption);padding: 6px;flex: 1;min-width: 0;background: var(--code-background);border-radius: var(--radius-xs);}+.settings-mono {+ font-family: var(--mono);+}+.settings-centered {+ text-align: center;+}+/* Underlined text buttons (links out) and the quieter Cancel beside them. */+.settings-link {+ color: var(--text);+ text-decoration: underline;+}+.settings-quiet-button {+ color: var(--secondary);+}+.settings-off {+ opacity: 0.4;+}++/* General: the analytics switch sits at the row's end, after its label and info button. */+.switch.settings-privacy-switch {+ flex: 1;+ justify-content: flex-end;+}++/* Usage: a computer's label over its limits, then one row per limit. */+.settings-usage-computer {+ font-size: var(--text-body);+ font-weight: 700;+}+.settings-usage-row {+ font-size: var(--text-callout);+ font-weight: 400;+ white-space: nowrap;+}+.settings-usage-title {+ width: 64px;+ flex: none;+}+.settings-usage-percent {+ width: 36px;+ flex: none;+ text-align: right;+}+.settings-usage-reset {+ width: 130px;+ flex: none;+ text-align: right;+}++/* Computers & devices. */+.settings-computers {+ height: 100%;+ overflow-y: auto;+ background: var(--background);+}+.settings-computers-content {+ padding: 14px 14px 20px;+}+.settings-route {+ color: var(--tertiary);+}+.settings-pairing {+ padding: 16px;+}+.settings-ssh-editor {+ width: 460px;+}+.settings-ssh-editor-body {+ padding: 4px 20px 20px;+}+.settings-approval {+ width: 420px;+}+.settings-approval-body {+ padding: 0 24px 24px;+}+.settings-analytics-icon {+ padding-top: 2px;+}++/* Voice chat: its own sheet outside Settings; rows that need a key dim until there is one. */+.sheet-page.settings-voice-sheet {+ width: 440px;+ height: 600px;+}+.settings-voice-body {+ flex: 1;+ min-height: 0;+}+.settings-dimmable {+ transition: opacity var(--layout);+}+.settings-dimmable.dimmed {+ opacity: 0.55;+ pointer-events: none;+}+.settings-key-input {+ flex: 1;+ min-width: 0;+}+.settings-key-result {+ font-size: var(--text-caption);+ font-weight: 400;+ color: var(--secondary);+}+.settings-key-result.failed {+ color: var(--danger);+}/* A row that appears fades in. */.settings-appear {diff --git a/apps/desktop/src/renderer/views/sidebar-footer.css b/apps/desktop/src/renderer/views/sidebar-footer.cssindex dc25aa43..54f31457 100644--- a/apps/desktop/src/renderer/views/sidebar-footer.css+++ b/apps/desktop/src/renderer/views/sidebar-footer.css@@ -64,7 +64,7 @@justify-content: center;gap: 9px;white-space: nowrap;- font-size: calc(13px * var(--scale));+ font-size: var(--text-body);font-weight: 500;border: 1px solid var(--chrome-stroke);transition: background-color var(--hover), transform var(--hover);diff --git a/apps/desktop/src/renderer/views/sidebar-header.css b/apps/desktop/src/renderer/views/sidebar-header.cssindex be8a56cc..961446b6 100644--- a/apps/desktop/src/renderer/views/sidebar-header.css+++ b/apps/desktop/src/renderer/views/sidebar-header.css@@ -46,9 +46,20 @@.sidebar:not(.compact) .sidebar-header::before { backdrop-filter: none; }}+/* The roster's computer summary and filter (ComputerFilterHeader). */+.computer-filter {+ display: flex;+ align-items: center;+ gap: 4px;+ min-width: 0;+ padding: 6px 0;+ font-size: var(--text-callout);+ font-weight: 500;+ color: var(--secondary);+}.computer-filter-action {height: 32px;- min-width: 44px;+ padding: 0 9px;justify-content: center;flex: none;border: 1px solid var(--chrome-stroke);diff --git a/apps/desktop/src/renderer/views/thread/Attachments.tsx b/apps/desktop/src/renderer/views/thread/Attachments.tsxindex 6fc6a1d1..2e620d02 100644--- a/apps/desktop/src/renderer/views/thread/Attachments.tsx+++ b/apps/desktop/src/renderer/views/thread/Attachments.tsx@@ -1,9 +1,11 @@import { useEffect, useState } from 'react'import { isImageName, type Attachment } from '@shared/models'import { Icon } from '../../components/Icon'-import { ModalHeader, Sheet } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { ModalHeader, Sheet, SheetPage } from '../../components/Overlay'+import { HStack, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { useStoreRef } from '../../store/context'+import './attachments.css'/** The symbol for a file by its extension. */export function attachmentSymbol(name: string) {@@ -32,38 +34,38 @@ export function byteCount(bytes: number) {export function AttachmentList({ attachments, botId }: { attachments: Attachment[]; botId: string }) {const [viewing, setViewing] = useState<Attachment | null>(null)return (- <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-end', gap: 4 }}>+ <VStack align="flex-end" gap={4}>{attachments.map((file) =>isImageName(file.name) ? (- <button key={file.id} aria-label={file.name} onClick={() => setViewing(file)} style={{ borderRadius: 16, overflow: 'hidden', maxWidth: 220, maxHeight: 280, display: 'flex' }}>- <AttachmentImage file={file} botId={botId} style={{ maxWidth: 220, maxHeight: 280 }} />+ <button key={file.id} className="attachment-image-button" aria-label={file.name} onClick={() => setViewing(file)}>+ <AttachmentImage file={file} botId={botId} fit="thumbnail" /></button>) : (- <div key={file.id} style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '8px 12px', background: 'var(--bubble-user)', borderRadius: 16 }}>+ <HStack key={file.id} gap={8} className="attachment-file"><Icon name={attachmentSymbol(file.name)} size={16} color="var(--secondary)" />- <div style={{ display: 'flex', flexDirection: 'column', gap: 1, minWidth: 0 }}>- <span style={{ ...font('subheadline'), color: 'var(--text)', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', maxWidth: 200 }}>{file.name}</span>- <span style={{ ...font('caption2'), color: 'var(--tertiary)' }}>{byteCount(file.size)}</span>- </div>- </div>+ <VStack gap={1} shrink>+ <Text size="subheadline" tone="text" truncate className="attachment-file-name">{file.name}</Text>+ <Text size="caption2" tone="tertiary">{byteCount(file.size)}</Text>+ </VStack>+ </HStack>),)}<Sheet open={viewing !== null} onClose={() => setViewing(null)} width={720} height={560}>{viewing ? (- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' }}>+ <SheetPage><ModalHeader title={viewing.name} />- <div style={{ flex: 1, minHeight: 0, padding: 12, display: 'grid', placeItems: 'center' }}>- <AttachmentImage file={viewing} botId={botId} style={{ maxWidth: '100%', maxHeight: '100%', objectFit: 'contain' }} />+ <div className="attachment-viewer">+ <AttachmentImage file={viewing} botId={botId} fit="full" /></div>- </div>+ </SheetPage>) : null}</Sheet>- </div>+ </VStack>)}/** A sent image, fetched from the computer once and then read from the cache. */-function AttachmentImage({ file, botId, style }: { file: Attachment; botId: string; style?: React.CSSProperties }) {+function AttachmentImage({ file, botId, fit }: { file: Attachment; botId: string; fit: 'thumbnail' | 'full' }) {const store = useStoreRef()const [url, setUrl] = useState<string | null>(null)useEffect(() => {@@ -81,10 +83,10 @@ function AttachmentImage({ file, botId, style }: { file: Attachment; botId: stri}, [store, file.id, botId])if (!url) {return (- <div style={{ width: 160, height: 120, borderRadius: 16, background: 'var(--bubble-user)', display: 'grid', placeItems: 'center' }}>+ <div className="attachment-placeholder"><Icon name="photo" size={13} color="var(--tertiary)" /></div>)}- return <img src={url} alt="" style={{ display: 'block', ...style }} />+ return <img src={url} alt="" className={`attachment-image ${fit}`} />}diff --git a/apps/desktop/src/renderer/views/thread/BotConversation.tsx b/apps/desktop/src/renderer/views/thread/BotConversation.tsxindex 96259c69..a2991fe4 100644--- a/apps/desktop/src/renderer/views/thread/BotConversation.tsx+++ b/apps/desktop/src/renderer/views/thread/BotConversation.tsx@@ -2,7 +2,8 @@ import { useEffect, useRef, useState } from 'react'import { BotAvatar } from '../../components/Avatar'import { Icon } from '../../components/Icon'import { ModalHeader } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { HStack, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { useStore } from '../../store/context'import type { Entry } from '@shared/models'import { botConversation, buildBotConversation, groupSummary, verbOf, type BotConversationRow, type BotExchange } from './bot-exchange'@@ -19,16 +20,15 @@ export function BotMessageRow({ exchanges, open }: { exchanges: BotExchange[]; oconst lead = count > 1 ? `${count} messages with` : verbOf(exchanges[0]!)return (<button- className="press bot-message-row"+ className={failed ? 'press bot-message-row failed' : 'press bot-message-row'}onClick={() => open(peerId)}title="Open conversation"aria-label={`${lead} ${name}${failed ? ', failed' : ''}`}- style={{ ...font('footnote'), color: failed ? 'var(--danger)' : 'var(--secondary)' }}>{failed ? <Icon name="exclamationmark.triangle.fill" size={10} color="var(--danger)" /> : null}- <span>{lead}</span>+ <Text size="footnote">{lead}</Text>{peer ? <BotAvatar bot={peer} size={18} animated={false} /> : null}- <span style={{ ...font('footnote', 'semibold'), color: failed ? 'var(--danger)' : 'var(--text)' }}>{name}</span>+ <Text size="footnote" weight="semibold" tone={failed ? 'danger' : 'text'}>{name}</Text><Icon name="chevron.right" size={10} color="var(--tertiary)" /></button>)@@ -38,17 +38,17 @@ export function BotMessageRow({ exchanges, open }: { exchanges: BotExchange[]; ofunction BotPair({ botId, peerId }: { botId: string; peerId: string }) {const store = useStore()const label = (id: string) => (- <span style={{ display: 'flex', alignItems: 'center', gap: 6, minWidth: 0 }}>+ <HStack as="span" gap={6} shrink>{store.bots.get(id) ? <BotAvatar bot={store.bots.get(id)!} size={20} animated={false} /> : null}- <span style={{ overflow: 'hidden', textOverflow: 'ellipsis' }}>{store.authorName(id)}</span>- </span>+ <Text truncate>{store.authorName(id)}</Text>+ </HStack>)return (- <span style={{ display: 'flex', alignItems: 'center', gap: 8 }} aria-label={`${store.authorName(botId)} and ${store.authorName(peerId)}`}>+ <HStack as="span" gap={8} aria-label={`${store.authorName(botId)} and ${store.authorName(peerId)}`}>{label(botId)}<Icon name="arrow.left.arrow.right" size={11} color="var(--tertiary)" />{label(peerId)}- </span>+ </HStack>)}@@ -89,8 +89,8 @@ export function BotConversationView({ botId, peerId }: { botId: string; peerId:<ModalHeader title={<BotPair botId={botId} peerId={peerId} />} /><div className="bot-conversation-scroll" ref={scroller}><div className="bot-conversation-rows">- {error ? <div style={{ ...font('footnote'), color: 'var(--danger)', textAlign: 'center', paddingTop: 24 }}>{error}</div> : null}- {!error && fetched && rows.length === 0 ? <div style={{ ...font('footnote'), color: 'var(--tertiary)', textAlign: 'center', paddingTop: 24 }}>No messages yet.</div> : null}+ {error ? <Text as="div" size="footnote" tone="danger" className="bot-conversation-note">{error}</Text> : null}+ {!error && fetched && rows.length === 0 ? <Text as="div" size="footnote" tone="tertiary" className="bot-conversation-note">No messages yet.</Text> : null}{rows.map((row) => <ConversationRow key={row.id} row={row} />)}</div></div>@@ -105,7 +105,7 @@ function ConversationRow({ row }: { row: BotConversationRow }) {return <TimeSeparator date={row.at} />case 'message':return (- <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-start', gap: 4, paddingTop: row.showsAuthor ? 12 : 4 }}>+ <VStack align="flex-start" gap={4} className={row.showsAuthor ? 'chat-row group-start' : 'chat-row'}>{row.showsAuthor ? <AuthorLabel botId={row.author} /> : null}<div className="message agent"><div className="message-body">@@ -114,12 +114,12 @@ function ConversationRow({ row }: { row: BotConversationRow }) {</Bubble></div></div>- </div>+ </VStack>)case 'status': {const failed = row.outcome.kind === 'failed'const text = row.outcome.kind === 'failed' ? row.outcome.detail || "Didn't complete." : `Waiting for ${store.authorName(row.awaiting)}…`- return <div className="selectable" style={{ ...font('footnote'), color: failed ? 'var(--danger)' : 'var(--secondary)', padding: '6px 12px' }}>{text}</div>+ return <Text as="div" size="footnote" tone={failed ? 'danger' : 'secondary'} className="selectable bot-conversation-status">{text}</Text>}}}diff --git a/apps/desktop/src/renderer/views/thread/ChatRows.tsx b/apps/desktop/src/renderer/views/thread/ChatRows.tsxindex 24d066c1..ae717a34 100644--- a/apps/desktop/src/renderer/views/thread/ChatRows.tsx+++ b/apps/desktop/src/renderer/views/thread/ChatRows.tsx@@ -5,8 +5,9 @@ import { BotAvatar } from '../../components/Avatar'import { Hairline, IconButton } from '../../components/Controls'import { Icon } from '../../components/Icon'import { AnchoredMenu, useContextMenu, type MenuItem, type ReactionPick } from '../../components/Overlay'+import { HStack, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { ThinkingOrb } from '../../components/ThinkingOrb'-import { font, px } from '../../lib/fonts'import { avatarColor } from '../../lib/theme'import { useStore as useLiveStore, useStoreRef as useStore } from '../../store/context'import { QUICK_REACTIONS, type BotStore } from '../../store/bot-store'@@ -35,34 +36,34 @@ export const ChatRow = memo(function ChatRow({ entry, groupStart, chat, openTracswitch (entry.kind) {case 'user':return (- <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-end', gap: 4, paddingTop: groupStart ? 12 : 4 }}>+ <VStack align="flex-end" gap={4} className={groupStart ? 'chat-row group-start' : 'chat-row'}><UserBubble entry={entry} botWorking={!!chat && isWorking(chat)} reply={reply} /><ReactionsRow entry={entry} />{chip}- </div>+ </VStack>)case 'agent':return (- <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-start', gap: 4, paddingTop: groupStart ? 12 : 4 }}>+ <VStack align="flex-start" gap={4} className={groupStart ? 'chat-row group-start' : 'chat-row'}>{chat && isGroup(chat) && groupStart ? <AuthorLabel botId={entry.data.author} /> : null}<AgentBubble entry={entry} openTrace={openTrace} reply={reply} />- <div style={{ paddingLeft: chat && isGroup(chat) ? 34 : 0, display: 'flex', flexDirection: 'column', gap: 4 }}>+ <VStack gap={4} className={chat && isGroup(chat) ? 'chat-row-indent' : undefined}><ReactionsRow entry={entry} />{chip}- </div>- </div>+ </VStack>+ </VStack>)case 'permission':return (- <div style={{ display: 'flex', flexDirection: 'column', gap: 4, paddingTop: 12 }}>+ <VStack gap={4} className="chat-row group-start">{chat && isGroup(chat) ? <AuthorLabel botId={entry.data.author} /> : null}<LivePermission entry={entry} />- </div>+ </VStack>)default:- if (entry.data.connectionRequest) return <div style={{ paddingTop: 12 }}><ConnectionRequestCard entry={entry} /></div>- if (entry.data.handoff) return <div style={{ paddingTop: 10 }}><HandoffNotice entry={entry} card={entry.data.handoff} /></div>- return <div style={{ paddingTop: 10 }}><NoticeRow entry={entry} /></div>+ if (entry.data.connectionRequest) return <div className="chat-row group-start"><ConnectionRequestCard entry={entry} /></div>+ if (entry.data.handoff) return <div className="chat-row notice"><HandoffNotice entry={entry} card={entry.data.handoff} /></div>+ return <div className="chat-row notice"><NoticeRow entry={entry} /></div>}})@@ -77,10 +78,10 @@ export function AuthorLabel({ botId }: { botId?: string | null }) {const store = useStore()const bot = botId ? store.bots.get(botId) : undefinedreturn (- <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>+ <HStack gap={8}>{bot ? <BotAvatar bot={bot} size={26} animated={false} /> : null}- <span style={{ ...font('subheadline', 'medium'), color: bot ? avatarColor(bot.avatarColor) : 'var(--secondary)' }}>{store.authorName(botId)}</span>- </div>+ <Text size="subheadline" weight="medium" tone="secondary" style={bot ? { color: avatarColor(bot.avatarColor) } : undefined}>{store.authorName(botId)}</Text>+ </HStack>)}@@ -97,19 +98,19 @@ export function ThreadChip({ summary, open }: { summary: ThreadSummary; open: ()aria-label={`View thread, ${summary.count} ${summary.count === 1 ? 'reply' : 'replies'}${unread > 0 ? `, ${unread} new` : ''}`}>{authors.length ? (- <span style={{ display: 'flex' }}>- {authors.map((b, i) => (- <span key={b.id} style={{ marginLeft: i ? -6 : 0 }}>+ <HStack as="span" align="stretch" className="thread-chip-authors">+ {authors.map((b) => (+ <span key={b.id}><BotAvatar bot={b} size={18} animated={false} /></span>))}- </span>+ </HStack>) : null}- <span style={{ ...font('footnote', 'semibold'), color: 'var(--accent)' }}>{summary.count === 1 ? '1 reply' : `${summary.count} replies`}</span>+ <Text size="footnote" weight="semibold" tone="accent">{summary.count === 1 ? '1 reply' : `${summary.count} replies`}</Text>{unread > 0 ? (- <span style={{ ...font('footnote', 'semibold'), color: 'var(--text)' }}>{unread} new</span>+ <Text size="footnote" weight="semibold" tone="text">{unread} new</Text>) : (- <span style={{ ...font('footnote'), color: 'var(--tertiary)' }}>{relativeTime.day(summary.lastAt)}</span>+ <Text size="footnote" tone="tertiary">{relativeTime.day(summary.lastAt)}</Text>)}<Icon name="chevron.right" size={10} color="var(--tertiary)" /></button>@@ -131,7 +132,7 @@ export function Bubble({ className, items, reactions, children }: { className: s/** The centered time label between runs of messages. */export function TimeSeparator({ date }: { date: number }) {- return <div style={{ ...font('footnote'), color: 'var(--tertiary)', textAlign: 'center', padding: '18px 0 6px' }}>{relativeTime.separator(date)}</div>+ return <Text as="div" size="footnote" tone="tertiary" className="time-separator">{relativeTime.separator(date)}</Text>}const fullDate = new Intl.DateTimeFormat(undefined, { dateStyle: 'medium', timeStyle: 'short' })@@ -167,24 +168,23 @@ export function UserBubble({ entry, botWorking, reply }: { entry: Entry; botWorkfunction UserStatus({ entry, botWorking, hovering }: { entry: Entry; botWorking: boolean; hovering: boolean }) {const store = useStore()- const caption = { ...font('caption2'), color: 'var(--tertiary)' }switch (entry.data.status) {case 'sending':- return <span style={caption}>Sending…</span>+ return <Text size="caption2" tone="tertiary">Sending…</Text>case 'queued':- return <span style={caption}>{botWorking ? 'Queued until this response finishes' : 'Queued'}</span>+ return <Text size="caption2" tone="tertiary">{botWorking ? 'Queued until this response finishes' : 'Queued'}</Text>case 'failed':return (- <span style={{ display: 'flex', alignItems: 'center', gap: 2, ...font('caption2', 'semibold') }}>- <span style={{ color: 'var(--danger)', marginRight: 4 }}>Failed to send</span>+ <HStack as="span" gap={2}>+ <Text size="caption2" weight="semibold" tone="danger" className="user-status-error">Failed to send</Text><IconButton title="Resend" icon="arrow.clockwise" size={24} onClick={() => store.retry(entry)} /><IconButton title="Delete" icon="trash" size={24} onClick={() => store.discard(entry)} />- </span>+ </HStack>)case 'cancelled':- return <span style={caption}>Not sent — stopped</span>+ return <Text size="caption2" tone="tertiary">Not sent — stopped</Text>default:- return <span style={{ ...font(11), color: 'var(--tertiary)', opacity: hovering ? 1 : 0, transition: 'opacity var(--hover)' }}>{relativeTime.time(entry.createdAt)}</span>+ return <Text size="caption" tone="tertiary" className={hovering ? 'user-status-time shown' : 'user-status-time'}>{relativeTime.time(entry.createdAt)}</Text>}}@@ -204,7 +204,7 @@ export function AgentBubble({ entry, openTrace, reply }: { entry: Entry; openTra{ title: 'Show what it did', icon: 'list.bullet', action: openTrace },]}>- {entry.data.files?.length ? <div style={{ display: 'grid', gap: 6 }}>{entry.data.files.map((file) => <FileDownloadCard key={file.id} entry={entry} file={file} />)}</div> : <MarkdownText text={entry.data.text ?? ''} />}+ {entry.data.files?.length ? <div className="file-message-cards">{entry.data.files.map((file) => <FileDownloadCard key={file.id} entry={entry} file={file} />)}</div> : <MarkdownText text={entry.data.text ?? ''} />}</Bubble><MessageActions className="trailing" visible={hovering} reactions={reactionPick(store, entry)} reply={reply} trace={openTrace} copy={copy} /></div>@@ -217,30 +217,30 @@ export function NoticeRow({ entry }: { entry: Entry }) {if (entry.data.callSeconds !== undefined) {const s = entry.data.callSecondsreturn (- <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', gap: 6, ...font('footnote'), fontVariantNumeric: 'tabular-nums', color: 'var(--secondary)' }}>- <Icon name="waveform" size={10} />- {`${text} · ${String(Math.floor(s / 60)).padStart(2, '0')}:${String(s % 60).padStart(2, '0')}`}- </div>+ <HStack justify="center" gap={6}>+ <Icon name="waveform" size={10} color="var(--secondary)" />+ <Text size="footnote" tone="secondary" tabular>{`${text} · ${String(Math.floor(s / 60)).padStart(2, '0')}:${String(s % 60).padStart(2, '0')}`}</Text>+ </HStack>)}switch (entry.data.style) {case 'divider':return (- <div style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '6px 0' }}>- <Hairline style={{ flex: 1 }} />- <span style={{ ...font('caption2'), color: 'var(--tertiary)', textAlign: 'center', maxWidth: 260 }}>{text}</span>- <Hairline style={{ flex: 1 }} />- </div>+ <HStack gap={10} className="chat-notice-divider">+ <Hairline grow />+ <Text size="caption2" tone="tertiary" className="chat-notice-divider-text">{text}</Text>+ <Hairline grow />+ </HStack>)case 'error':return (- <div style={{ display: 'flex', alignItems: 'flex-start', gap: 8, padding: 12, borderRadius: 12, background: 'color-mix(in srgb, var(--danger) 12%, transparent)' }}>+ <HStack align="flex-start" gap={8} className="chat-notice-error"><Icon name="exclamationmark.triangle.fill" size={10} color="var(--danger)" />- <span className="selectable" style={{ ...font('footnote'), color: 'var(--text)' }}>{text}</span>- </div>+ <Text size="footnote" tone="text" className="selectable">{text}</Text>+ </HStack>)default:- return <div style={{ ...font('footnote'), color: 'var(--secondary)', textAlign: 'center' }}>{text}</div>+ return <Text as="div" size="footnote" tone="secondary" className="chat-notice">{text}</Text>}}@@ -252,27 +252,27 @@ export function WorkingIndicator({ bot, thinking }: { bot: Bot; thinking: stringconst [expanded, setExpanded] = useState(false)const waiting = needsInput(bot)return (- <div style={{ display: 'flex', alignItems: 'center', gap: 10, paddingRight: 40 }}>+ <HStack gap={10} className="agent-inset"><button className="working" disabled={!thinking} onClick={() => setExpanded((e) => !e)} aria-expanded={thinking ? expanded : undefined}>- <span style={{ display: 'flex', alignItems: 'center', gap: 8 }}>+ <HStack as="span" gap={8}><ThinkingOrb state={waiting ? 'listening' : 'working'} size={16} color={waiting ? 'var(--warning)' : 'var(--secondary)'} />- <span style={{ ...font('subheadline'), color: waiting ? 'var(--attention)' : 'var(--secondary)', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{bot.activity || 'Working…'}</span>+ <Text size="subheadline" tone={waiting ? 'attention' : 'secondary'} truncate>{bot.activity || 'Working…'}</Text>{bot.startedAt ? <Timer since={bot.startedAt} /> : null}{thinking ? (- <span style={{ display: 'flex', transform: `rotate(${expanded ? 180 : 0}deg)`, transition: 'transform var(--layout)' }}>+ <HStack as="span" align="stretch" className={expanded ? 'working-chevron expanded' : 'working-chevron'}><Icon name="chevron.down" size={10} weight="semibold" color="var(--tertiary)" />- </span>+ </HStack>) : null}- </span>+ </HStack>{expanded && thinking ? (- <div className="selectable thinking" style={{ ...font('footnote'), color: 'var(--secondary)' }} ref={(el) => {+ <div className="selectable thinking" ref={(el) => {if (el) el.scrollTop = el.scrollHeight}}>{thinking}</div>) : null}</button>- </div>+ </HStack>)}@@ -287,7 +287,7 @@ function Timer({ since }: { since: number }) {const h = Math.floor(s / 3600)const m = Math.floor((s % 3600) / 60)const sec = String(s % 60).padStart(2, '0')- return <span style={{ ...font('footnote'), fontVariantNumeric: 'tabular-nums', color: 'var(--tertiary)' }}>{h ? `${h}:${String(m).padStart(2, '0')}:${sec}` : `${m}:${sec}`}</span>+ return <Text size="footnote" tone="tertiary" tabular>{h ? `${h}:${String(m).padStart(2, '0')}:${sec}` : `${m}:${sec}`}</Text>}/** The user's reactions under a message; clicking one takes it back. */@@ -296,13 +296,13 @@ export function ReactionsRow({ entry }: { entry: Entry }) {const reactions = entry.data.reactionsif (!reactions?.length) return nullreturn (- <div style={{ display: 'flex', gap: 4 }}>+ <HStack align="stretch" gap={4}>{reactions.map((emoji) => (<button key={emoji} className="press reaction-chip" title={`Remove ${emoji}`} aria-label={`Remove reaction ${emoji}`} onClick={() => store.react(entry, emoji)}>- <span style={{ fontSize: px(13) }}>{emoji}</span>+ <Text size="body">{emoji}</Text></button>))}- </div>+ </HStack>)}@@ -320,7 +320,7 @@ function MessageActions({ visible, className, reactions, reply, trace, copy }: {const more = useRef<HTMLButtonElement>(null)const shown = visible || menu !== nullreturn (- <div className={`message-actions ${className}`} style={{ opacity: shown ? 1 : 0, pointerEvents: shown ? 'auto' : 'none' }} aria-hidden={!shown}>+ <div className={`message-actions ${className} ${shown ? 'shown' : ''}`} aria-hidden={!shown}><button ref={smile} className="message-action" title="Add reaction" aria-label="Add reaction" onClick={() => setMenu('reactions')}><Icon name="face.smiling" size={14} /></button>diff --git a/apps/desktop/src/renderer/views/thread/Composer.tsx b/apps/desktop/src/renderer/views/thread/Composer.tsxindex d1e3b490..524d365b 100644--- a/apps/desktop/src/renderer/views/thread/Composer.tsx+++ b/apps/desktop/src/renderer/views/thread/Composer.tsx@@ -4,7 +4,8 @@ import { isGroup, isWorkingIn, type Bot } from '@shared/models'import { BotAvatar } from '../../components/Avatar'import { Icon } from '../../components/Icon'import { usePresence } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { useModel } from '../../lib/observable'import { useStore } from '../../store/context'import { MAX_FILE_SIZE, type OutgoingFile } from '../../store/bot-store'@@ -157,18 +158,16 @@ function DestinationComposer({ botId, thread, onCall, onInterrupt }: {call: ['waveform', 'Call'],send: ['arrow.up', 'Send'],} as const)[trailing]- const fill = trailing === 'interrupt' ? 'var(--danger-fill)' : trailing === 'send' ? (canSend ? 'var(--accent-fill)' : 'var(--accent-dim)') : 'var(--accent-fill)'- const ink = trailing === 'interrupt' ? 'var(--on-danger)' : trailing === 'send' ? (canSend ? 'var(--on-accent)' : 'var(--tertiary)') : 'var(--on-accent)'const enabled = trailing !== 'send' || canSendreturn (- <div style={{ display: 'flex', flexDirection: 'column' }}>+ <VStack><ComposerReveal open={suggestions.length > 0}><div className="mentions">{suggestions.map((m) => (<button key={m.id} className="press mention" onClick={() => mention(m)}><BotAvatar bot={m} size={18} animated={false} />- <span style={{ ...font('subheadline'), color: 'var(--text)' }}>{m.name}</span>+ <Text size="subheadline" tone="text">{m.name}</Text></button>))}</div>@@ -255,11 +254,10 @@ function DestinationComposer({ botId, thread, onCall, onInterrupt }: {</button>) : null}<button- className="press composer-send"+ className={trailing === 'interrupt' ? 'press composer-send interrupt' : 'press composer-send'}disabled={!enabled}aria-label={label}title={label}- style={{ background: fill, color: ink }}onClick={() => {if (trailing === 'interrupt') onInterrupt?.()else if (trailing === 'stop') store.stop(botId)@@ -276,7 +274,7 @@ function DestinationComposer({ botId, thread, onCall, onInterrupt }: {</div></div></div>- </div>+ </VStack>)}diff --git a/apps/desktop/src/renderer/views/thread/ComposerAttachment.tsx b/apps/desktop/src/renderer/views/thread/ComposerAttachment.tsxindex fdfad437..5af82585 100644--- a/apps/desktop/src/renderer/views/thread/ComposerAttachment.tsx+++ b/apps/desktop/src/renderer/views/thread/ComposerAttachment.tsx@@ -1,7 +1,7 @@import { useEffect, useState } from 'react'import { isImageName } from '@shared/models'import { Icon } from '../../components/Icon'-import { font } from '../../lib/fonts'+import { Text } from '../../components/Text'import type { OutgoingFile } from '../../store/bot-store'import { attachmentSymbol } from './Attachments'@@ -33,7 +33,7 @@ export function ComposerAttachment({ file, remove }: { file: OutgoingFile; removreturn (<span className="file-chip"><Icon name={attachmentSymbol(file.name)} size={10} color="var(--secondary)" />- <span style={{ ...font('footnote'), color: 'var(--text)', maxWidth: 160, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{file.name}</span>+ <Text size="footnote" tone="text" truncate className="file-chip-name">{file.name}</Text><button className="file-chip-remove" aria-label={`Remove ${file.name}`} title="Remove" onClick={remove}><Icon name="xmark" size={10} weight="bold" color="var(--secondary)" /></button>diff --git a/apps/desktop/src/renderer/views/thread/DetailsPanel.tsx b/apps/desktop/src/renderer/views/thread/DetailsPanel.tsxindex 513e8f55..2de6a960 100644--- a/apps/desktop/src/renderer/views/thread/DetailsPanel.tsx+++ b/apps/desktop/src/renderer/views/thread/DetailsPanel.tsx@@ -1,9 +1,10 @@import { isGroup, isWorking, type Bot } from '@shared/models'import { AgentIcon } from '../../components/AgentIcon'import { BotAvatar, GroupAvatar } from '../../components/Avatar'-import { IconButton, Switch, TabChoice } from '../../components/Controls'+import { IconButton, RowLabel, Switch, TabChoice } from '../../components/Controls'import { Icon } from '../../components/Icon'-import { font } from '../../lib/fonts'+import { HStack, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { useStore } from '../../store/context'import { BotSettingsPanel } from '../bots/BotEditorView'import { MemoryCard } from '../bots/MemoryView'@@ -100,13 +101,10 @@ function ComputerUse({ bot }: { bot: Bot }) {<section className="details-section"><span className="details-section-title">Computer</span><div className="outlined-card details-switch">- <span className="details-switch-text">- <span>Use the computer</span>- {ready ? null : <span className="details-switch-note">On that computer, open Codync → Settings → Computer access to set it up first.</span>}- </span>- <span style={{ display: 'flex', flex: 'none' }}>+ <RowLabel grow label="Use the computer" detail={ready ? null : 'On that computer, open Codync → Settings → Computer access to set it up first.'} />+ <HStack as="span" align="stretch" className="details-switch-control"><Switch label="Use the computer" on={bot.computer} disabled={store.isOffline} onChange={(on) => store.setComputer(bot, on)} />- </span>+ </HStack></div></section>)@@ -121,19 +119,19 @@ function GroupMembersList({ group, editGroup }: { group: Bot; editGroup: () => v<div key={bot.id} className="member-row removable"><button className="member-open press" title={`Open ${bot.name}'s own chat`} onClick={() => store.setSelection(bot.id)}><BotAvatar bot={bot} size={32} />- <span style={{ display: 'flex', flexDirection: 'column', gap: 1, minWidth: 0, flex: 1 }}>+ <VStack as="span" gap={1} grow><span className="member-name">{bot.name}</span>- {isWorking(bot) ? <span className="member-name" style={{ ...font('compactSecondary'), color: 'var(--secondary)' }}>{bot.activity || 'Working…'}</span> : null}- </span>+ {isWorking(bot) ? <Text size="compactSecondary" tone="secondary" className="member-name">{bot.activity || 'Working…'}</Text> : null}+ </VStack></button>{group.members.length > 1 ? <IconButton title={`Remove ${bot.name} from the group`} icon="xmark" onClick={() => store.removeMember(group, bot.id)} /> : null}</div>))}<button className="member-row press" onClick={editGroup}>- <span style={{ width: 32, display: 'grid', placeItems: 'center' }}>+ <span className="member-add-icon"><Icon name="plus" size={16} color="var(--secondary)" /></span>- <span className="member-name" style={{ color: 'var(--secondary)' }}>Add Member</span>+ <Text tone="secondary" className="member-name">Add Member</Text></button></div>)diff --git a/apps/desktop/src/renderer/views/thread/FileDownloadCard.tsx b/apps/desktop/src/renderer/views/thread/FileDownloadCard.tsxindex 315a2366..9a2d36e7 100644--- a/apps/desktop/src/renderer/views/thread/FileDownloadCard.tsx+++ b/apps/desktop/src/renderer/views/thread/FileDownloadCard.tsx@@ -2,8 +2,10 @@ import type { Entry, SharedFile } from '@shared/models'import { useStore } from '../../store/context'import { Icon } from '../../components/Icon'import { IconButtonBase } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { HStack, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { attachmentSymbol, byteCount } from './Attachments'+import './attachments.css'export function FileDownloadCard({ entry, file }: { entry: Entry; file: SharedFile }) {const store = useStore()@@ -11,12 +13,12 @@ export function FileDownloadCard({ entry, file }: { entry: Entry; file: SharedFiconst busy = state?.kind === 'downloading'const action = busy ? 'Cancel download' : state?.kind === 'failed' ? 'Retry download' : state?.kind === 'saved' ? 'Save again' : 'Download'const detail = busy ? `${byteCount(state.received)} of ${byteCount(file.size)}` : state?.kind === 'failed' ? state.message : state?.kind === 'saved' ? `${byteCount(file.size)} · Saved` : byteCount(file.size)- return <div style={{ display: 'flex', alignItems: 'center', gap: 12, padding: 14, background: 'var(--bubble-agent)', borderRadius: 16, maxWidth: 380 }}>+ return <HStack gap={12} className="file-card"><Icon name={attachmentSymbol(file.name)} size={24} color="var(--secondary)" />- <div style={{ minWidth: 0, flex: 1 }}>- <div style={{ ...font('subheadline', 'semibold'), whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }} title={file.name}>{file.name}</div>- <div role={state?.kind === 'failed' ? 'alert' : 'status'} style={{ ...font('caption2'), color: state?.kind === 'failed' ? 'var(--danger)' : 'var(--secondary)', overflowWrap: 'anywhere' }}>{detail}</div>- </div>+ <VStack grow>+ <Text as="div" size="subheadline" weight="semibold" truncate title={file.name}>{file.name}</Text>+ <Text as="div" size="caption2" tone={state?.kind === 'failed' ? 'danger' : 'secondary'} role={state?.kind === 'failed' ? 'alert' : 'status'} className="file-card-detail">{detail}</Text>+ </VStack><IconButtonBase title={action} icon={busy ? 'xmark' : 'arrow.down.to.line'} size={36} onClick={() => busy ? store.fileDownloads.cancel(file.id) : void store.fileDownloads.save(store.client, entry.id, file)} />- </div>+ </HStack>}diff --git a/apps/desktop/src/renderer/views/thread/HandoffNotice.tsx b/apps/desktop/src/renderer/views/thread/HandoffNotice.tsxindex 45bc9c06..c414dff4 100644--- a/apps/desktop/src/renderer/views/thread/HandoffNotice.tsx+++ b/apps/desktop/src/renderer/views/thread/HandoffNotice.tsx@@ -2,8 +2,8 @@ import { useState } from 'react'import type { Entry, HandoffCard } from '@shared/models'import { Button, CardForm, CardSection, Disclosure, IconButton, Spinner } from '../../components/Controls'import { Icon } from '../../components/Icon'-import { ModalHeader, Sheet } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { ModalHeader, Sheet, SheetPage } from '../../components/Overlay'+import { Text } from '../../components/Text'import { useStore as useLiveStore } from '../../store/context'import { Field } from '../marketplace/pieces'import './handoff.css'@@ -42,7 +42,7 @@ export function HandoffNotice({ entry, card }: { entry: Entry; card: HandoffCardreturn (<div className="handoff-card"><Line icon="arrow.triangle.branch" text={entry.data.text} />- <Disclosure expanded={expanded} onToggle={() => setExpanded(!expanded)} label={<span style={{ ...font('footnote'), fontWeight: 500 }}>What it carries</span>}>+ <Disclosure expanded={expanded} onToggle={() => setExpanded(!expanded)} label={<Text size="footnote" weight="medium">What it carries</Text>}>{carried}</Disclosure><div className="handoff-actions">@@ -52,7 +52,7 @@ export function HandoffNotice({ entry, card }: { entry: Entry; card: HandoffCard</>}</div><Sheet open={draft !== null} onClose={() => setDraft(null)} width={620}>- {draft !== null && <div className="handoff-editor">+ {draft !== null && <SheetPage><ModalHeadertitle="Edit the handoff"trailing={saving ? <Spinner /> : <IconButton title="Save" icon="checkmark" disabled={!draft.trim()} onClick={() => { void save() }} />}@@ -62,7 +62,7 @@ export function HandoffNotice({ entry, card }: { entry: Entry; card: HandoffCard<Field value={draft} onChange={setDraft} label="Handoff" lines={[10, 24]} mono /></CardSection></CardForm>- </div>}+ </SheetPage>}</Sheet></div>)diff --git a/apps/desktop/src/renderer/views/thread/Markdown.tsx b/apps/desktop/src/renderer/views/thread/Markdown.tsxindex 3f2ed44b..d9424116 100644--- a/apps/desktop/src/renderer/views/thread/Markdown.tsx+++ b/apps/desktop/src/renderer/views/thread/Markdown.tsx@@ -1,6 +1,9 @@import { memo, type ReactNode } from 'react'import { parseMarkdown, type Block } from './markdown-blocks.ts'import { Hairline } from '../../components/Controls'+import { HStack, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'+import './markdown.css'// The Mac's Markdown for messages: the blocks from `markdown-blocks.ts`, with inline styling like// `AttributedString(markdown:)`.@@ -12,7 +15,7 @@ export function inline(text: string, key = 'i'): ReactNode[] {text.split(/(`[^`\n]+`)/).forEach((part, i) => {if (part.length > 2 && part.startsWith('`') && part.endsWith('`')) {out.push(- <code key={`${key}${i}`} style={{ fontFamily: 'var(--mono)', background: 'rgba(var(--text-rgb), 0.08)' }}>+ <code key={`${key}${i}`} className="md-code-span">{part.slice(1, -1)}</code>,)@@ -37,11 +40,11 @@ function emphasis(text: string, key: string): ReactNode[] {if (m[1] !== undefined) {const url = m[2]!out.push(- <a key={k} href={url} title={url} onClick={(e) => { e.preventDefault(); window.codync.app.openExternal(url) }} style={{ color: 'var(--accent)', textDecoration: 'underline', textUnderlineOffset: '0.15em', cursor: 'pointer' }}>+ <a key={k} href={url} title={url} className="md-link" onClick={(e) => { e.preventDefault(); window.codync.app.openExternal(url) }}>{emphasis(m[1], `${k}-`)}</a>,)- } else if (m[3] !== undefined || m[4] !== undefined) out.push(<strong key={k} style={{ fontWeight: 600 }}>{emphasis(m[3] ?? m[4]!, `${k}-`)}</strong>)+ } else if (m[3] !== undefined || m[4] !== undefined) out.push(<strong key={k} className="md-strong">{emphasis(m[3] ?? m[4]!, `${k}-`)}</strong>)else if (m[5] !== undefined) out.push(<s key={k}>{emphasis(m[5], `${k}-`)}</s>)else out.push(<em key={k}>{emphasis(m[6] ?? m[7]!, `${k}-`)}</em>)rest = rest.slice(m.index + m[0].length)@@ -49,42 +52,33 @@ function emphasis(text: string, key: string): ReactNode[] {return out}-const headingSize = (level: number) => (level === 1 ? 15 : level === 2 ? 13 : 11)-/**- * SwiftUI's `.lineSpacing(4 * scale)`: four points between lines on top of the font's own, none- * above the first or below the last (the negative margins take the half-leading back).- */-const lineHeight = 'calc(1.2em + 4px * var(--md-scale))'-const spaced: React.CSSProperties = { lineHeight, margin: 'calc(-2px * var(--md-scale)) 0' }-const text: React.CSSProperties = { color: 'var(--text)', whiteSpace: 'pre-wrap', overflowWrap: 'anywhere', ...spaced }-const MarkdownBlock = memo(function MarkdownBlock({ block }: { block: Block }) {switch (block.kind) {case 'paragraph':- return <div style={{ ...text, fontSize: 'var(--conversation)' }}>{inline(block.text)}</div>+ return <div className="md-text md-spaced md-body">{inline(block.text)}</div>case 'heading':return (- <div style={{ ...text, fontSize: `calc(${headingSize(block.level)}px * var(--md-scale))`, fontWeight: block.level === 2 ? 600 : 700 }}>+ <div className={`md-text md-spaced md-heading-${Math.min(block.level, 3)}`}>{inline(block.text)}</div>)case 'bullet':return (- <div style={{ display: 'flex', alignItems: 'baseline', gap: 6, fontSize: 'var(--conversation)', paddingLeft: block.depth * 16, ...spaced }}>- <span style={{ color: 'var(--secondary)', fontVariantNumeric: 'tabular-nums', flex: 'none' }}>{block.marker}</span>- <span style={{ color: 'var(--text)', whiteSpace: 'pre-wrap', overflowWrap: 'anywhere', minWidth: 0 }}>{inline(block.text)}</span>- </div>+ <HStack align="baseline" gap={6} className="md-spaced md-body" style={{ paddingLeft: block.depth * 16 }}>+ <Text tone="secondary" className="md-marker">{block.marker}</Text>+ <span className="md-text md-bullet-text">{inline(block.text)}</span>+ </HStack>)case 'rule':- return <Hairline style={{ margin: '4px 0' }} />+ return <Hairline className="md-rule" />case 'table': {const columns = Math.max(block.header.length, ...block.rows.map((r) => r.length))const cols = Array.from({ length: columns }, (_, i) => i)return (- <div style={{ overflowX: 'auto' }}>- <div style={{ display: 'grid', gridTemplateColumns: `repeat(${columns}, max-content)`, columnGap: 16, rowGap: 7, fontSize: 'var(--conversation)', color: 'var(--text)', padding: '2px 0', width: 'max-content', lineHeight }}>+ <div className="md-table-scroll">+ <div className="md-table md-body" style={{ gridTemplateColumns: `repeat(${columns}, max-content)` }}>{cols.map((i) => (- <span key={`h${i}`} style={{ fontWeight: 600 }}>{inline(block.header[i] ?? '', `h${i}`)}</span>+ <Text key={`h${i}`} weight="semibold">{inline(block.header[i] ?? '', `h${i}`)}</Text>))}{block.rows.map((row, r) => [<Hairline key={`l${r}`} style={{ gridColumn: `1 / span ${columns}` }} />,@@ -95,11 +89,11 @@ const MarkdownBlock = memo(function MarkdownBlock({ block }: { block: Block }) {)}case 'quote':- return <div style={{ ...text, fontSize: 'var(--conversation)', color: 'var(--secondary)', paddingLeft: 10, boxShadow: 'inset 3px 0 0 var(--border)' }}>{inline(block.text)}</div>+ return <div className="md-text md-spaced md-body md-quote">{inline(block.text)}</div>case 'code':return (- <div style={{ background: 'var(--code-background)', borderRadius: 8, overflowX: 'auto' }}>- <pre style={{ margin: 0, padding: 10, fontFamily: 'var(--mono)', fontSize: 'calc(10px * var(--md-scale))', color: 'var(--text)', width: 'max-content', lineHeight }}>{block.text}</pre>+ <div className="md-code">+ <pre className="md-code-text">{block.text}</pre></div>)}@@ -109,10 +103,10 @@ const MarkdownBlock = memo(function MarkdownBlock({ block }: { block: Block }) {export const MarkdownText = memo(function MarkdownText({ text }: { text: string }) {const blocks = parseMarkdown(text)return (- <div className="markdown selectable" style={{ display: 'flex', flexDirection: 'column', gap: 10, minWidth: 0 }}>+ <VStack gap={10} shrink className="markdown selectable">{blocks.map((b, i) => (<MarkdownBlock key={i} block={b} />))}- </div>+ </VStack>)})diff --git a/apps/desktop/src/renderer/views/thread/PermissionCard.tsx b/apps/desktop/src/renderer/views/thread/PermissionCard.tsxindex 9da8a4a1..9cd0315c 100644--- a/apps/desktop/src/renderer/views/thread/PermissionCard.tsx+++ b/apps/desktop/src/renderer/views/thread/PermissionCard.tsx@@ -2,7 +2,9 @@ import { useState } from 'react'import type { Entry, FileDiff, PermissionOption } from '@shared/models'import { Disclosure, Spinner } from '../../components/Controls'import { Icon } from '../../components/Icon'-import { font, px } from '../../lib/fonts'+import { HStack, VStack } from '../../components/Stack'+import { Text } from '../../components/Text'+import './permission-card.css'/** What the agent wants, from the tool's kind (also the notch island's headline). */export const permissionHeadline = (toolKind?: string) => {@@ -52,54 +54,48 @@ export function PermissionCard({ entry, hostName, answering, respond }: { entry:const options = sortedOptions(d.options ?? [])const cwd = d.cwd ? ` · ${d.cwd.split('/').filter(Boolean).pop() ?? d.cwd}` : ''return (- <div style={{ paddingRight: 40 }}>- <div style={{ display: 'flex', flexDirection: 'column', gap: 10, padding: 16, background: 'var(--bubble-agent)', borderRadius: 22 }}>- <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>- <span style={{ ...font('headline'), color: 'var(--text)' }}>{permissionHeadline(d.toolKind)}</span>- {pending ? <span style={{ width: 7, height: 7, borderRadius: '50%', background: 'var(--warning)' }} /> : null}- </div>- <div- className="selectable"- style={{- ...font('subheadline', undefined, 'monospaced'), color: 'var(--secondary)', overflowWrap: 'anywhere',- ...(expanded ? {} : { display: '-webkit-box', WebkitLineClamp: 3, WebkitBoxOrient: 'vertical', overflow: 'hidden' }),- }}- >+ <div className="agent-inset">+ <VStack gap={10} className="permission-card">+ <HStack gap={8}>+ <Text size="headline" tone="text">{permissionHeadline(d.toolKind)}</Text>+ {pending ? <span className="permission-card-dot" /> : null}+ </HStack>+ <Text as="div" size="subheadline" mono tone="secondary" lines={expanded ? undefined : 3} className="selectable permission-card-title">{d.title ?? ''}- </div>- <div style={{ display: 'flex', alignItems: 'center', gap: 6, ...font('caption'), color: 'var(--tertiary)' }}>- <Icon name="desktopcomputer" size={10} />- {`Runs on ${hostName}${cwd}`}- </div>+ </Text>+ <HStack gap={6}>+ <Icon name="desktopcomputer" size={10} color="var(--tertiary)" />+ <Text size="caption" tone="tertiary">{`Runs on ${hostName}${cwd}`}</Text>+ </HStack>{hasDetail ? (- <Disclosure expanded={expanded} onToggle={() => setExpanded((e) => !e)} label={<span style={{ ...font('caption', 'medium'), color: 'var(--secondary)' }}>Details</span>}>- <div style={{ display: 'flex', flexDirection: 'column', gap: 8, paddingTop: 6 }}>+ <Disclosure expanded={expanded} onToggle={() => setExpanded((e) => !e)} label={<Text size="caption" weight="medium" tone="secondary">Details</Text>}>+ <VStack gap={8} className="permission-card-details">{d.command ? <CodeBox text={d.command} /> : null}{d.detail ? <CodeBox text={d.detail.slice(0, 2000)} /> : null}{(d.diffs ?? []).map((diff, i) => <DiffView key={i} diff={diff} />)}- </div>+ </VStack></Disclosure>) : null}{pending ? (- <div style={{ background: 'var(--background)', borderRadius: 14, marginTop: 4 }}>+ <div className="permission-card-options">{options.map((o, i) => (<div key={o.optionId}>- {i > 0 ? <div style={{ height: 0.5, background: 'var(--border)' }} /> : null}+ {i > 0 ? <div className="thread-hairline" /> : null}<button+ className={answering === null || answering === o.optionId ? 'permission-option' : 'permission-option dimmed'}disabled={answering !== null}onClick={() => respond(o.optionId)}- style={{ display: 'flex', alignItems: 'center', gap: 8, width: '100%', minHeight: 46, padding: '0 14px', opacity: answering === null || answering === o.optionId ? 1 : 0.4 }}>- <span style={{ ...font('body', o.kind === 'allow_once' ? 'semibold' : 'regular'), color: o.kind.startsWith('allow') ? 'var(--text)' : 'var(--danger)', flex: 1 }}>{optionLabel(o)}</span>+ <Text size="body" weight={o.kind === 'allow_once' ? 'semibold' : 'regular'} tone={o.kind.startsWith('allow') ? 'text' : 'danger'} className="permission-option-label">{optionLabel(o)}</Text>{answering === o.optionId ? <Spinner size={14} /> : null}</button></div>))}</div>) : (- <div style={{ ...font('caption', 'medium'), color: 'var(--secondary)' }}>{outcome(entry)}</div>+ <Text as="div" size="caption" weight="medium" tone="secondary">{outcome(entry)}</Text>)}- </div>+ </VStack></div>)}@@ -131,8 +127,8 @@ function outcome(entry: Entry) {export function CodeBox({ text }: { text: string }) {return (- <div style={{ background: 'var(--code-background)', borderRadius: 8, overflow: 'auto', maxHeight: 240 }}>- <pre className="selectable" style={{ margin: 0, padding: 8, fontFamily: 'var(--mono)', fontSize: px(10), color: 'var(--text)', width: 'max-content' }}>{text}</pre>+ <div className="code-box">+ <pre className="selectable code-box-text">{text}</pre></div>)}@@ -140,22 +136,22 @@ export function CodeBox({ text }: { text: string }) {export function DiffView({ diff }: { diff: FileDiff }) {const lines = diff.patch.split('\n').slice(0, 80)return (- <div style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>- <div style={{ display: 'flex', alignItems: 'center', gap: 6, ...font('caption', undefined, 'monospaced'), color: 'var(--secondary)' }}>+ <VStack gap={4}>+ <HStack gap={6} className="diff-header"><Icon name={diff.isNew ? 'doc.badge.plus' : 'doc.text'} size={10} />- <span style={{ flex: 1, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{diff.path.split('/').pop()}</span>- <span style={{ color: 'var(--added)' }}>+{diff.added}</span>- <span style={{ color: 'var(--removed)' }}>−{diff.removed}</span>- </div>- <div style={{ background: 'var(--code-background)', borderRadius: 8, overflow: 'auto', maxHeight: 260 }}>- <div style={{ padding: 8, fontFamily: 'var(--mono)', fontSize: px(10), width: 'max-content' }}>+ <Text truncate grow>{diff.path.split('/').pop()}</Text>+ <Text tone="added">+{diff.added}</Text>+ <Text tone="removed">−{diff.removed}</Text>+ </HStack>+ <div className="code-box diff-box">+ <div className="code-box-text">{lines.map((line, i) => (- <div key={i} style={{ whiteSpace: 'pre', color: line.startsWith('+') ? 'var(--added)' : line.startsWith('-') ? 'var(--removed)' : 'var(--secondary)' }}>+ <Text as="div" key={i} tone={line.startsWith('+') ? 'added' : line.startsWith('-') ? 'removed' : 'secondary'} className="diff-line">{line || ' '}- </div>+ </Text>))}</div></div>- </div>+ </VStack>)}diff --git a/apps/desktop/src/renderer/views/thread/RepliesView.tsx b/apps/desktop/src/renderer/views/thread/RepliesView.tsxindex 710ee4d9..5d1e690a 100644--- a/apps/desktop/src/renderer/views/thread/RepliesView.tsx+++ b/apps/desktop/src/renderer/views/thread/RepliesView.tsx@@ -1,8 +1,9 @@import { useEffect, useLayoutEffect, useRef, useState } from 'react'import { isWorkingIn } from '@shared/models'-import { Hairline, IconButton } from '../../components/Controls'-import { Sheet } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { Hairline } from '../../components/Controls'+import { ModalHeader, Sheet, SheetPage } from '../../components/Overlay'+import { HStack } from '../../components/Stack'+import { Text } from '../../components/Text'import { useStore } from '../../store/context'import { UpdateNeededCard } from '../UpdateNeededCard'import { buildChat, rowIn, useArrivals } from './chat-items'@@ -39,26 +40,20 @@ export function RepliesView({ botId, rootId, close }: { botId: string; rootId: sconst openTrace = () => setShowTrace(true)return (- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' }}>- <div style={{ display: 'flex', alignItems: 'center', gap: 8, height: 48, padding: '0 10px 0 16px', flex: 'none' }}>- <div style={{ display: 'flex', flexDirection: 'column', flex: 1, minWidth: 0 }}>- <span style={{ ...font('compactBody', 'semibold'), color: 'var(--text)' }}>Thread</span>- <span style={{ ...font('caption'), color: 'var(--tertiary)', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{chat?.name ?? ''}</span>- </div>- <IconButton title="Close thread" icon="xmark" onClick={close} />- </div>- <div style={{ height: 0.5, background: 'var(--border)', flex: 'none' }} />- <div ref={scroller} style={{ flex: 1, overflowY: 'auto' }}>- <div style={{ padding: '8px 16px 0' }}>+ <SheetPage>+ <ModalHeader title="Thread" subtitle={chat?.name ?? ''} onClose={close} closeTitle="Close thread" />+ <div className="thread-hairline" />+ <div ref={scroller} className="thread-scroll">+ <div className="replies-content">{root ? (<><ChatRow entry={root} groupStart chat={chat} openTrace={openTrace} />- <div style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '12px 0' }}>- <span style={{ ...font('caption'), color: 'var(--tertiary)', whiteSpace: 'nowrap' }}>+ <HStack gap={10} className="replies-count">+ <Text size="caption" tone="tertiary" className="replies-count-label">{replyCount(root.data.thread?.count ?? 0)}- </span>- <Hairline style={{ flex: 1 }} />- </div>+ </Text>+ <Hairline grow />+ </HStack></>) : null}{items.map((item) =>@@ -69,16 +64,16 @@ export function RepliesView({ botId, rootId, close }: { botId: string; rootId: s) : null,)}{chat && live ? (- <div className={arrivals.has('working') ? 'row-in' : undefined} style={{ paddingTop: 6 }}>+ <div className={arrivals.has('working') ? 'chat-working row-in' : 'chat-working'}><WorkingIndicator bot={chat} thinking={store.currentThinking(botId, rootId)} /></div>) : null}- <div style={{ height: 8 }} />+ <div className="chat-end" /></div></div>- <div style={{ flex: 'none' }}>+ <div className="replies-composer">{store.mismatch ? (- <div style={{ padding: '0 16px 8px' }}>+ <div className="composer-update-needed"><UpdateNeededCard /></div>) : (@@ -88,7 +83,7 @@ export function RepliesView({ botId, rootId, close }: { botId: string; rootId: s<Sheet open={showTrace} onClose={() => setShowTrace(false)} width={620} height={560}><TraceView botId={botId} thread={rootId} /></Sheet>- </div>+ </SheetPage>)}diff --git a/apps/desktop/src/renderer/views/thread/ThreadView.tsx b/apps/desktop/src/renderer/views/thread/ThreadView.tsxindex b5b44293..9187ca0c 100644--- a/apps/desktop/src/renderer/views/thread/ThreadView.tsx+++ b/apps/desktop/src/renderer/views/thread/ThreadView.tsx@@ -4,7 +4,8 @@ import { BotAvatar, GroupAvatar } from '../../components/Avatar'import { Spinner } from '../../components/Controls'import { Icon } from '../../components/Icon'import { Sheet, usePresence } from '../../components/Overlay'-import { font } from '../../lib/fonts'+import { HStack, IconSlot, Spacer } from '../../components/Stack'+import { Text } from '../../components/Text'import { prefs, usePref } from '../../lib/prefs'import { useStore } from '../../store/context'import { UpdateNeededCard } from '../UpdateNeededCard'@@ -145,21 +146,21 @@ export const ThreadView = memo(function ThreadView({ botId }: { botId: string })<div className="top-chrome"><TopFade /><div className="top-chrome-row">- <span style={{ flex: 1 }} />+ <Spacer />{(!showSettings || openThread || !wide) && !compactDetails ? (<MacChatButton className="ringed" title="Conversation details" icon="chevron.left.2" direction={[-1, 0]} onClick={toggleDetails} />) : null}</div>{/* The call bar takes the pill's place; its frosted glass would show the name blurred. */}<button className={`title-pill ${calling ? 'hidden-by-call' : ''}`} inert={calling} onClick={toggleDetails} aria-label={`${bot?.name ?? 'Conversation'}, view details`} title="View conversation details">- <span style={{ display: 'flex', alignItems: 'center', gap: 7 }}>+ <HStack as="span" gap={7}>{bot ? isGroup(bot) ? <GroupAvatar members={store.members(bot)} size={22} /> : <BotAvatar bot={bot} size={22} /> : null}- <span style={{ ...font(13, 'medium'), color: 'var(--text)', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{bot?.name ?? ''}</span>+ <Text size="body" weight="medium" tone="text" truncate>{bot?.name ?? ''}</Text>{/* Grok Bot's hint on hover: the pill opens the details. */}<span className="title-pill-chevron"><Icon name="chevron.right" size={10} weight="semibold" color="var(--secondary)" /></span>- </span>+ </HStack>{store.shownConnection.kind !== 'online' || store.mismatch ? <ConnectionSubtitle /> : null}</button></div>@@ -167,7 +168,7 @@ export const ThreadView = memo(function ThreadView({ botId }: { botId: string })<div className="composer-dock" ref={dock}><div className="composer-fade" />{store.mismatch ? (- <div style={{ padding: '0 16px 8px' }}>+ <div className="composer-update-needed"><UpdateNeededCard /></div>) : (@@ -241,10 +242,10 @@ function ConnectionSubtitle() {return store.hostRoute === 'relay' ? 'Connected through Cloudflare' : store.hostRoute === 'direct' ? 'Connected over Wi-Fi or Tailscale' : store.hostRoute === 'loopback' ? 'Connected locally' : 'Connected'})()return (- <span style={{ display: 'flex', alignItems: 'center', gap: 6, ...font(11, 'medium'), color: 'var(--secondary)' }} title={`${store.hostName} · ${description}`} aria-label={`${store.hostName}, ${description}`}>- <span style={{ width: 12, display: 'flex', justifyContent: 'center' }}>{connecting ? <Spinner size={8} /> : <Icon name={symbol} size={8} weight="medium" />}</span>- <span style={{ whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{store.connectionLabel}</span>- </span>+ <HStack as="span" gap={6} className="title-pill-subtitle" title={`${store.hostName} · ${description}`} aria-label={`${store.hostName}, ${description}`}>+ <IconSlot width={12}>{connecting ? <Spinner size={8} /> : <Icon name={symbol} size={8} weight="medium" />}</IconSlot>+ <Text size="caption" weight="medium" truncate>{store.connectionLabel}</Text>+ </HStack>)}@@ -353,22 +354,22 @@ const Transcript = memo(function Transcript({ botId, openTrace, openThread, open{loadingEarlier ? <Spinner size={14} /> : 'Load earlier messages'}</button>) : null}- {items.length === 0 && bot ? <div style={{ paddingTop: 40 }}>{isGroup(bot) ? <GroupIntroCard group={bot} /> : <IntroCard bot={bot} />}</div> : null}+ {items.length === 0 && bot ? <div className="transcript-intro">{isGroup(bot) ? <GroupIntroCard group={bot} /> : <IntroCard bot={bot} />}</div> : null}{items.map((item) => (<div key={item.id} className={arrivals.has(item.id) ? rowIn(item) : undefined}><Row item={item} chat={bot} openTrace={openTrace} openThread={openThread} openRoutine={openRoutine} openBotChat={openBotChat} /></div>))}{bot && live ? (- <div className={arrivals.has('working') ? 'row-in' : undefined} style={{ paddingTop: 6 }}>+ <div className={arrivals.has('working') ? 'chat-working row-in' : 'chat-working'}><WorkingIndicator bot={bot} thinking={store.currentThinking(botId, null)} /></div>) : null}- <div style={{ height: 8 }} />+ <div className="chat-end" /></div></div>{jump.mounted ? (- <div className={`jump-to-latest ${jump.shown ? 'shown' : ''}`} inert={!jump.shown} style={{ bottom: 'calc(var(--composer-height, 70px) + 10px)' }}>+ <div className={`jump-to-latest ${jump.shown ? 'shown' : ''}`} inert={!jump.shown}><MacChatButtontitle="Jump to latest"icon="arrow.down"@@ -392,7 +393,7 @@ function Row({ item, chat, openTrace, openThread, openRoutine, openBotChat }: {const e = item.entryif (e.kind === 'notice' && e.data.routineId) {return (- <button onClick={() => openRoutine(e.data.routineId!)} style={{ display: 'flex', alignItems: 'center', gap: 6, ...font('footnote'), color: 'var(--secondary)', padding: '10px 0', margin: '0 auto' }}>+ <button className="chat-routine-notice" onClick={() => openRoutine(e.data.routineId!)}><Icon name="clock.arrow.circlepath" size={10} />{e.data.text ?? 'Routine'}</button>@@ -409,10 +410,10 @@ function GroupIntroCard({ group }: { group: Bot }) {return (<div className="intro-card"><GroupAvatar members={members} size={72} />- <div style={{ ...font('title2', 'semibold'), color: 'var(--text)' }}>{group.name}</div>- {group.name !== names.join(', ') ? <div style={{ ...font('subheadline'), color: 'var(--secondary)' }}>{names.join(' · ')}</div> : null}- {group.description ? <div style={{ ...font('subheadline'), color: 'var(--secondary)' }}>{group.description}</div> : null}- <div style={{ ...font('callout'), color: 'var(--secondary)', paddingTop: 4, lineHeight: 1.5, maxWidth: 360, textWrap: 'balance' }}>Everyone answers in turn. @mention a bot to ask just that one.</div>+ <Text as="div" size="title2" weight="semibold" tone="text">{group.name}</Text>+ {group.name !== names.join(', ') ? <Text as="div" size="subheadline" tone="secondary">{names.join(' · ')}</Text> : null}+ {group.description ? <Text as="div" size="subheadline" tone="secondary">{group.description}</Text> : null}+ <Text as="div" size="callout" tone="secondary" className="intro-card-hint balanced">Everyone answers in turn. @mention a bot to ask just that one.</Text></div>)}@@ -422,12 +423,12 @@ function IntroCard({ bot }: { bot: Bot }) {return (<div className="intro-card"><BotAvatar bot={bot} size={72} />- <div style={{ ...font('title2', 'semibold'), color: 'var(--text)' }}>{bot.name}</div>- <div style={{ ...font('callout'), color: 'var(--secondary)', overflowWrap: 'anywhere' }}>+ <Text as="div" size="title2" weight="semibold" tone="text">{bot.name}</Text>+ <Text as="div" size="callout" tone="secondary" className="intro-card-path">{bot.managedWorkspace ? `${store.backendName(bot.backend)} · Personal workspace` : `${store.backendName(bot.backend)} in ${bot.cwd}`}- </div>- {bot.description ? <div style={{ ...font('subheadline'), color: 'var(--secondary)' }}>{bot.description}</div> : null}- <div style={{ ...font('callout'), color: 'var(--secondary)', paddingTop: 4, lineHeight: 1.5 }}>Tell it what you need. You'll get a notification when it's done or needs you.</div>+ </Text>+ {bot.description ? <Text as="div" size="subheadline" tone="secondary">{bot.description}</Text> : null}+ <Text as="div" size="callout" tone="secondary" className="intro-card-hint">Tell it what you need. You'll get a notification when it's done or needs you.</Text></div>)}diff --git a/apps/desktop/src/renderer/views/thread/TraceView.tsx b/apps/desktop/src/renderer/views/thread/TraceView.tsxindex 67fd275d..d339bfe9 100644--- a/apps/desktop/src/renderer/views/thread/TraceView.tsx+++ b/apps/desktop/src/renderer/views/thread/TraceView.tsx@@ -2,12 +2,15 @@ import { useLayoutEffect, useRef, useState } from 'react'import type { Entry, EntryData } from '@shared/models'import { CardSection, Disclosure } from '../../components/Controls'import { Icon } from '../../components/Icon'-import { ModalHeader } from '../../components/Overlay'+import { ModalHeader, SheetPage } from '../../components/Overlay'+import { HStack, IconSlot, VStack } from '../../components/Stack'+import { Text, type Tone } from '../../components/Text'import { ThinkingOrb, type OrbState } from '../../components/ThinkingOrb'-import { font } from '../../lib/fonts'+import type { Weight } from '../../lib/fonts'import { useStore } from '../../store/context'import { MarkdownText } from './Markdown'import { CodeBox, DiffView } from './PermissionCard'+import './trace.css'/*** "Full conversation": everything the agent did (narration, thinking, tool calls with output@@ -27,35 +30,36 @@ export function TraceView({ botId, thread = null }: { botId: string; thread?: stif (el) el.scrollTop = el.scrollHeight}, [])return (- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' }}>+ <SheetPage><ModalHeader title="Full conversation" />- <div ref={scroller} style={{ flex: 1, overflowY: 'auto' }}>- <div style={{ display: 'flex', flexDirection: 'column', gap: 14, padding: 14, fontSize: 'calc(12px * var(--scale))' }}>- {sorted.length === 0 ? <span style={{ color: 'var(--tertiary)' }}>Nothing yet.</span> : null}+ <div ref={scroller} className="thread-scroll">+ <VStack gap={14} className="trace-content">+ {sorted.length === 0 ? <Text tone="tertiary">Nothing yet.</Text> : null}{sorted.map(([turn, entries]) => (- <div key={turn} style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>- <div style={{ ...font('compactSecondary', 'semibold'), color: 'var(--text)', paddingLeft: 4, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>+ <VStack key={turn} gap={8}>+ <Text as="div" size="compactSecondary" weight="semibold" tone="text" truncate className="trace-turn-title">{entries.find((e) => e.kind === 'user')?.data.text ?? `Turn ${turn}`}- </div>+ </Text><CardSection>{entries.map((e) => (<TraceRow key={e.id} entry={e} />))}</CardSection>- </div>+ </VStack>))}- </div>+ </VStack></div>- </div>+ </SheetPage>)}-function Label({ icon, children, style }: { icon: React.ReactNode; children: React.ReactNode; style?: React.CSSProperties }) {+/** An icon centered on the first line of caption text beside it. */+function Label({ icon, weight, tone, children }: { icon: React.ReactNode; weight?: Weight; tone?: Tone; children: React.ReactNode }) {return (- <span style={{ display: 'flex', alignItems: 'flex-start', gap: 6, ...style }}>- <span style={{ display: 'flex', alignItems: 'center', minHeight: '1.25em' }}>{icon}</span>- <span style={{ minWidth: 0 }}>{children}</span>- </span>+ <HStack as="span" align="flex-start" gap={6}>+ <HStack as="span" className="trace-label-icon">{icon}</HStack>+ <Text size="caption" weight={weight} tone={tone} className="trace-label-text">{children}</Text>+ </HStack>)}@@ -65,16 +69,16 @@ function TraceRow({ entry }: { entry: Entry }) {switch (entry.kind) {case 'user':return (- <Label icon={<Icon name="person.fill" size={11} color="var(--secondary)" />} style={font('subheadline')}>- <span style={{ color: 'var(--text)' }}>{d.text ?? ''}</span>+ <Label icon={<Icon name="person.fill" size={11} color="var(--secondary)" />} tone="text">+ {d.text ?? ''}</Label>)case 'agent':return (- <div style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>- <span style={{ ...font('caption2', 'semibold'), color: 'var(--tertiary)' }}>{d.final ? 'Reply' : 'Said'}</span>+ <VStack gap={4}>+ <Text size="caption2" weight="semibold" tone="tertiary">{d.final ? 'Reply' : 'Said'}</Text><MarkdownText text={d.text ?? ''} />- </div>+ </VStack>)case 'thought':return (@@ -82,27 +86,27 @@ function TraceRow({ entry }: { entry: Entry }) {expanded={expanded}onToggle={() => setExpanded((x) => !x)}label={- <span style={{ display: 'flex', alignItems: 'center', gap: 6, ...font('subheadline'), color: 'var(--secondary)' }}>+ <HStack as="span" gap={6}><ThinkingOrb size={16} color="var(--secondary)" animated={false} />- Thinking- </span>+ <Text size="subheadline" tone="secondary">Thinking</Text>+ </HStack>}>- <div className="selectable" style={{ ...font('footnote'), color: 'var(--secondary)', whiteSpace: 'pre-wrap' }}>{d.text ?? ''}</div>+ <Text as="div" size="footnote" tone="secondary" className="selectable trace-thought">{d.text ?? ''}</Text></Disclosure>)case 'tool':return <ToolRow data={d} />case 'plan':return (- <div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>- <Label icon={<Icon name="checklist" size={11} weight="bold" />} style={font('subheadline', 'bold')}>+ <VStack gap={6}>+ <Label icon={<Icon name="checklist" size={11} weight="bold" />} weight="bold">Plan</Label>{(d.entries ?? []).map((item, i) => (<Labelkey={i}- style={font('footnote')}+ tone="text"icon={<Iconname={item.status === 'completed' ? 'checkmark.circle.fill' : item.status === 'in_progress' ? 'circle.dotted' : 'circle'}@@ -111,19 +115,19 @@ function TraceRow({ entry }: { entry: Entry }) {/>}>- <span style={{ color: 'var(--text)', textDecoration: item.status === 'completed' ? 'line-through' : undefined }}>{item.content}</span>+ <span className={item.status === 'completed' ? 'trace-plan-done' : undefined}>{item.content}</span></Label>))}- </div>+ </VStack>)case 'permission':return (- <Label icon={<Icon name="hand.raised" size={11} />} style={{ ...font('subheadline'), color: 'var(--secondary)' }}>+ <Label icon={<Icon name="hand.raised" size={11} color="var(--secondary)" />} tone="secondary">{d.title ?? 'Approval'}</Label>)default:- return <span style={{ ...font('footnote'), color: 'var(--tertiary)' }}>{d.text ?? ''}</span>+ return <Text size="footnote" tone="tertiary">{d.text ?? ''}</Text>}}@@ -136,11 +140,11 @@ export function ToolRow({ data }: { data: EntryData }) {const [expanded, setExpanded] = useState(false)const hasBody = !!data.output || !!data.diffs?.lengthconst label = (- <span style={{ display: 'flex', alignItems: 'center', gap: 8, ...font('caption'), flex: 1, minWidth: 0 }}>- <span style={{ width: 18, display: 'flex', justifyContent: 'center', color: 'var(--secondary)' }}>+ <HStack as="span" gap={8} grow>+ <IconSlot width={18} tone="secondary"><Icon name={toolIcon(data.toolKind)} size={10} />- </span>- <span style={{ ...font('subheadline'), color: 'var(--text)', flex: 1, minWidth: 0, display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical', overflow: 'hidden' }}>{data.title ?? 'Tool'}</span>+ </IconSlot>+ <Text size="subheadline" tone="text" lines={2} grow>{data.title ?? 'Tool'}</Text>{data.status === 'completed' ? (<Icon name="checkmark" size={10} color="var(--accent)" />) : data.status === 'failed' ? (@@ -148,15 +152,15 @@ export function ToolRow({ data }: { data: EntryData }) {) : (<ThinkingOrb state={toolOrb(data.toolKind)} size={16} color="var(--secondary)" />)}- </span>+ </HStack>)if (!hasBody) return labelreturn (<Disclosure expanded={expanded} onToggle={() => setExpanded((x) => !x)} label={label}>- <div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>+ <VStack gap={8}>{(data.diffs ?? []).map((diff, i) => <DiffView key={i} diff={diff} />)}{data.output ? <CodeBox text={data.output} /> : null}- </div>+ </VStack></Disclosure>)}diff --git a/apps/desktop/src/renderer/views/thread/attachments.css b/apps/desktop/src/renderer/views/thread/attachments.cssnew file mode 100644index 00000000..0d6330d9--- /dev/null+++ b/apps/desktop/src/renderer/views/thread/attachments.css@@ -0,0 +1,53 @@+/* Files in the chat: sent attachments (Attachments.tsx) and files a bot shares (FileDownloadCard.tsx). */+.attachment-image-button {+ display: flex;+ border-radius: var(--radius-l);+ overflow: hidden;+ max-width: 220px;+ max-height: 280px;+}+.attachment-image {+ display: block;+}+.attachment-image.thumbnail {+ max-width: 220px;+ max-height: 280px;+}+.attachment-image.full {+ max-width: 100%;+ max-height: 100%;+ object-fit: contain;+}+.attachment-placeholder {+ width: 160px;+ height: 120px;+ border-radius: var(--radius-l);+ background: var(--bubble-user);+ display: grid;+ place-items: center;+}+.attachment-file {+ padding: 8px 12px;+ background: var(--bubble-user);+ border-radius: var(--radius-l);+}+.attachment-file-name {+ max-width: 200px;+}+.attachment-viewer {+ flex: 1;+ min-height: 0;+ padding: 12px;+ display: grid;+ place-items: center;+}++.file-card {+ padding: 14px;+ background: var(--bubble-agent);+ border-radius: var(--radius-l);+ max-width: 380px;+}+.file-card-detail {+ overflow-wrap: anywhere;+}diff --git a/apps/desktop/src/renderer/views/thread/bot-conversation.css b/apps/desktop/src/renderer/views/thread/bot-conversation.cssindex 592fcdd6..73248cc0 100644--- a/apps/desktop/src/renderer/views/thread/bot-conversation.css+++ b/apps/desktop/src/renderer/views/thread/bot-conversation.css@@ -4,6 +4,10 @@gap: 6px;margin: 0 auto;padding: 10px 0;+ color: var(--secondary);+}+.bot-message-row.failed {+ color: var(--danger);}.bot-conversation {display: flex;@@ -22,3 +26,10 @@.bot-conversation-rows {padding: 0 16px 8px;}+.bot-conversation-note {+ text-align: center;+ padding-top: 24px;+}+.bot-conversation-status {+ padding: 6px 12px;+}diff --git a/apps/desktop/src/renderer/views/thread/chat-controls.css b/apps/desktop/src/renderer/views/thread/chat-controls.cssindex 0d06baff..4b3a2a8f 100644--- a/apps/desktop/src/renderer/views/thread/chat-controls.css+++ b/apps/desktop/src/renderer/views/thread/chat-controls.css@@ -84,6 +84,7 @@}.jump-to-latest {position: absolute;+ bottom: calc(var(--composer-height, 70px) + 10px);left: 50%;z-index: 5;transform: translateX(-50%);diff --git a/apps/desktop/src/renderer/views/thread/composer.css b/apps/desktop/src/renderer/views/thread/composer.cssindex 3a8c4cb5..f63a06d6 100644--- a/apps/desktop/src/renderer/views/thread/composer.css+++ b/apps/desktop/src/renderer/views/thread/composer.css@@ -1,3 +1,76 @@+/* The box, its mentions row and its attachments. */+.mentions {+ display: flex;+ gap: 6px;+ padding: 0 16px 6px;+ overflow-x: auto;+}+.mention,+.file-chip {+ display: flex;+ align-items: center;+ gap: 6px;+ padding: 6px 10px;+ border-radius: var(--radius-pill);+ background: var(--surface);+ flex: none;+}+.composer {+ display: flex;+ align-items: flex-end;+ gap: 8px;+ padding: 8px 14px 14px;+ max-width: var(--column);+ margin: 0 auto;+ width: 100%;+}+.file-chips {+ display: flex;+ gap: 6px;+ padding: 8px 10px 0;+ overflow-x: auto;+}+.file-chips:has(.attachment-tile) {+ align-items: flex-start;+}+.attachment-tile {+ position: relative;+ width: 80px;+ height: 80px;+ flex: none;+ border-radius: var(--radius-l);+ overflow: hidden;+ background: var(--surface);+}+.attachment-tile img {+ width: 100%;+ height: 100%;+ object-fit: contain;+}+.attachment-remove {+ position: absolute;+ top: 4px;+ right: 4px;+ width: 22px;+ height: 22px;+ display: flex;+ align-items: center;+ justify-content: center;+ border-radius: 50%;+ background: rgba(0, 0, 0, 0.75);+}+.file-chip-name {+ max-width: 160px;+}+/* The remove glyph is small; its target is 24 pt. */+.file-chip-remove {+ display: grid;+ place-items: center;+ width: 24px;+ height: 24px;+ margin: -6px -8px -6px -4px;+}+.composer-add {width: 25px;height: 25px;@@ -100,8 +173,19 @@place-items: center;flex: none;margin-bottom: calc(max(0px, (round(up, calc(var(--conversation) * 1.25), 1px) + 10px - 25px) / 2));+ background: var(--accent-fill);+ color: var(--on-accent);transition: background-color var(--morph), color var(--morph), transform var(--press);}+.composer-send.interrupt {+ background: var(--danger-fill);+ color: var(--on-danger);+}+/* Disabled only as Send with nothing sendable. */+.composer-send:disabled {+ background: var(--accent-dim);+ color: var(--tertiary);+}/* The `/` command list, floating over the transcript above the box. */.command-menu {diff --git a/apps/desktop/src/renderer/views/thread/details-panel.css b/apps/desktop/src/renderer/views/thread/details-panel.cssindex 57598d4a..7ccd5f97 100644--- a/apps/desktop/src/renderer/views/thread/details-panel.css+++ b/apps/desktop/src/renderer/views/thread/details-panel.css@@ -54,7 +54,7 @@display: flex;align-items: center;gap: 5px;- font-size: calc(12px * var(--scale));+ font-size: var(--text-callout);color: var(--secondary);}@@ -71,7 +71,7 @@}.details-section-title {padding-left: 2px;- font-size: calc(13px * var(--scale));+ font-size: var(--text-body);font-weight: 600;color: var(--text);}@@ -80,20 +80,11 @@align-items: center;gap: 12px;padding: 12px 14px;- font-size: calc(13px * var(--scale));+ font-size: var(--text-body);color: var(--text);}-.details-switch-text {- display: flex;- flex-direction: column;- gap: 3px;- flex: 1;- min-width: 0;-}-.details-switch-note {- font-size: calc(11px * var(--scale));- line-height: 1.35;- color: var(--secondary);+.details-switch-control {+ flex: none;}/* Every group in the inspector is an outlined card, like the routines; inputs take the fill. */@@ -120,6 +111,13 @@white-space: nowrap;}+/* The Use the computer note is an instruction: it stays whole. */+.details-tab .details-switch .detail-note {+ display: block;+ overflow: visible;+ -webkit-line-clamp: unset;+}+/* The panel is narrow: a row with a note puts its control under the label and note. */.details-tab .value-row:has(.detail-note) {flex-wrap: wrap;diff --git a/apps/desktop/src/renderer/views/thread/handoff.css b/apps/desktop/src/renderer/views/thread/handoff.cssindex 65f3a930..e4896c16 100644--- a/apps/desktop/src/renderer/views/thread/handoff.css+++ b/apps/desktop/src/renderer/views/thread/handoff.css@@ -1,8 +1,7 @@-.handoff-line { display: inline-flex; align-items: center; gap: 6px; font-size: calc(12px * var(--scale)); color: var(--secondary); min-width: 0; }+.handoff-line { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-callout); color: var(--secondary); min-width: 0; }.handoff-line span { overflow-wrap: anywhere; }.handoff-folded { max-width: 620px; }.handoff-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--radius-l); background: var(--bubble-agent); max-width: 560px; }.handoff-actions { display: flex; align-items: center; gap: 8px; }-.handoff-text { margin: 0; font-size: calc(12px * var(--scale)); color: var(--secondary); white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; line-height: 1.45; }+.handoff-text { margin: 0; font-size: var(--text-callout); color: var(--secondary); white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; line-height: 1.45; }.handoff-carried { font-family: var(--mono, ui-monospace, monospace); max-height: 320px; overflow: auto; }-.handoff-editor { display: flex; flex-direction: column; height: 100%; background: var(--background); }diff --git a/apps/desktop/src/renderer/views/thread/markdown.css b/apps/desktop/src/renderer/views/thread/markdown.cssnew file mode 100644index 00000000..a0de30dc--- /dev/null+++ b/apps/desktop/src/renderer/views/thread/markdown.css@@ -0,0 +1,86 @@+/* Message Markdown (Markdown.tsx). Its sizes follow the conversation's text size, not the app's+ type ramp. */+.md-body {+ font-size: var(--conversation);+}+.md-text {+ color: var(--text);+ white-space: pre-wrap;+ overflow-wrap: anywhere;+}+/* SwiftUI's `.lineSpacing(4 * scale)`: four points between lines on top of the font's own. */+.md-spaced,+.md-table,+.md-code-text {+ line-height: calc(1.2em + 4px * var(--md-scale));+}+/* None above the first line or below the last: the negative margins take the half-leading back. */+.md-spaced {+ margin: calc(-2px * var(--md-scale)) 0;+}+.md-heading-1 {+ font-size: calc(15px * var(--md-scale));+ font-weight: 700;+}+.md-heading-2 {+ font-size: calc(13px * var(--md-scale));+ font-weight: 600;+}+.md-heading-3 {+ font-size: calc(11px * var(--md-scale));+ font-weight: 700;+}+.md-marker {+ font-variant-numeric: tabular-nums;+ flex: none;+}+.md-bullet-text {+ min-width: 0;+}+.md-quote {+ color: var(--secondary);+ padding-left: 10px;+ box-shadow: inset 3px 0 0 var(--border);+}+.md-table-scroll {+ overflow-x: auto;+}+.md-table {+ display: grid;+ column-gap: 16px;+ row-gap: 7px;+ color: var(--text);+ padding: 2px 0;+ width: max-content;+}+.md-code {+ background: var(--code-background);+ border-radius: 8px;+ overflow-x: auto;+}+.md-code-text {+ margin: 0;+ padding: 10px;+ font-family: var(--mono);+ font-size: calc(10px * var(--md-scale));+ color: var(--text);+ width: max-content;+}++/* Inline styling. */+.md-code-span {+ font-family: var(--mono);+ background: rgba(var(--text-rgb), 0.08);+}+.md-link {+ color: var(--accent);+ text-decoration: underline;+ text-underline-offset: 0.15em;+ cursor: pointer;+}+.md-strong {+ font-weight: 600;+}+.md-rule {+ margin: 4px 0;+}diff --git a/apps/desktop/src/renderer/views/thread/permission-card.css b/apps/desktop/src/renderer/views/thread/permission-card.cssnew file mode 100644index 00000000..7a36e7a3--- /dev/null+++ b/apps/desktop/src/renderer/views/thread/permission-card.css@@ -0,0 +1,64 @@+/* The approval card in the chat, and the command and diff boxes it shares with the trace. */+.permission-card {+ padding: 16px;+ background: var(--bubble-agent);+ border-radius: var(--radius-xl);+}+.permission-card-dot {+ width: 7px;+ height: 7px;+ border-radius: 50%;+ background: var(--warning);+}+.permission-card-title {+ overflow-wrap: anywhere;+}+.permission-card-details {+ padding-top: 6px;+}+.permission-card-options {+ background: var(--background);+ border-radius: 14px;+ margin-top: 4px;+}+.permission-option {+ display: flex;+ align-items: center;+ gap: 8px;+ width: 100%;+ min-height: 46px;+ padding: 0 14px;+}+/* The other answers while one is on its way. */+.permission-option.dimmed {+ opacity: 0.4;+}+.permission-option-label {+ flex: 1;+}++.code-box {+ background: var(--code-background);+ border-radius: 8px;+ overflow: auto;+ max-height: 240px;+}+.code-box.diff-box {+ max-height: 260px;+}+.code-box-text {+ margin: 0;+ padding: 8px;+ font-family: var(--mono);+ font-size: calc(10px * var(--scale));+ color: var(--text);+ width: max-content;+}+.diff-header {+ font-family: var(--mono);+ font-size: var(--text-caption);+ color: var(--secondary);+}+.diff-line {+ white-space: pre;+}diff --git a/apps/desktop/src/renderer/views/thread/thread.css b/apps/desktop/src/renderer/views/thread/thread.cssindex bfd97d82..38890617 100644--- a/apps/desktop/src/renderer/views/thread/thread.css+++ b/apps/desktop/src/renderer/views/thread/thread.css@@ -99,6 +99,9 @@opacity: 0;transform: translateY(-8px);}+.title-pill-subtitle {+ color: var(--secondary);+}.transcript-frame {position: absolute;@@ -109,6 +112,17 @@overflow-y: auto;overflow-anchor: none;}+/* The scrolling body of a thread or the trace sheet, under its header. */+.thread-scroll {+ flex: 1;+ overflow-y: auto;+}+/* Half a point at every resolution (the shared hairline is 1 px at 1x). */+.thread-hairline {+ height: 0.5px;+ background: var(--border);+ flex: none;+}.transcript-content {container-type: inline-size;max-width: var(--column);@@ -121,9 +135,12 @@width: 100%;text-align: center;padding: 12px 0;- font-size: calc(11px * var(--scale));+ font-size: var(--text-caption);color: var(--secondary);}+.transcript-intro {+ padding-top: 40px;+}.intro-card {display: flex;flex-direction: column;@@ -134,12 +151,72 @@padding: 0 24px;text-align: center;}+.intro-card-path {+ overflow-wrap: anywhere;+}+.intro-card-hint {+ padding-top: 4px;+ line-height: 1.5;+}+.intro-card-hint.balanced {+ max-width: 360px;+ text-wrap: balance;+}+/* Room under the last row. */+.chat-end {+ height: 8px;+}.composer-dock {flex: none;}+.composer-update-needed {+ padding: 0 16px 8px;+}/* Messages */+/* Space above a row: more where a new speaker's run (or a card) starts. */+.chat-row {+ padding-top: 4px;+}+.chat-row.group-start {+ padding-top: 12px;+}+.chat-row.notice {+ padding-top: 10px;+}+/* A group message's reactions and thread line up past its author's avatar. */+.chat-row-indent {+ padding-left: 34px;+}+.time-separator {+ text-align: center;+ padding: 18px 0 6px;+}+.chat-notice {+ text-align: center;+}+.chat-notice-divider {+ padding: 6px 0;+}+.chat-notice-divider-text {+ text-align: center;+ max-width: 260px;+}+.chat-notice-error {+ padding: 12px;+ border-radius: var(--radius-m);+ background: color-mix(in srgb, var(--danger) 12%, transparent);+}+.chat-routine-notice {+ display: flex;+ align-items: center;+ gap: 6px;+ padding: 10px 0;+ margin: 0 auto;+ font-size: var(--text-caption);+ color: var(--secondary);+}.message {display: flex;flex-direction: column;@@ -188,14 +265,34 @@.bubble.agent {background: var(--chat-agent);}+.file-message-cards {+ display: grid;+ gap: 6px;+}+.user-status-error {+ margin-right: 4px;+}+.user-status-time {+ opacity: 0;+ transition: opacity var(--hover);+}+.user-status-time.shown {+ opacity: 1;+}.message-actions {position: absolute;bottom: 0;display: flex;align-items: center;gap: 2px;+ opacity: 0;+ pointer-events: none;transition: opacity var(--hover);}+.message-actions.shown {+ opacity: 1;+ pointer-events: auto;+}.message-actions.leading {right: calc(100% + 6px);}@@ -225,6 +322,16 @@border-radius: var(--radius-pill);background: var(--surface);}+.thread-chip-authors > * + * {+ margin-left: -6px;+}+/* Agent-side cards (working, approvals) stop short of the far edge. */+.agent-inset {+ padding-right: 40px;+}+.chat-working {+ padding-top: 6px;+}.working {display: flex;flex-direction: column;@@ -235,90 +342,34 @@text-align: left;min-width: 0;}+.working-chevron {+ transition: transform var(--layout);+}+.working-chevron.expanded {+ transform: rotate(180deg);+}.thinking {max-height: 180px;overflow-y: auto;white-space: pre-wrap;text-align: left;+ font-size: var(--text-caption);+ color: var(--secondary);}-/* Composer */-.mentions {- display: flex;- gap: 6px;- padding: 0 16px 6px;- overflow-x: auto;-}-.mention {- display: flex;- align-items: center;- gap: 6px;- padding: 6px 10px;- border-radius: var(--radius-pill);- background: var(--surface);- flex: none;-}-.composer {- display: flex;- align-items: flex-end;- gap: 8px;- padding: 8px 14px 14px;- max-width: var(--column);- margin: 0 auto;- width: 100%;-}-.file-chips {- display: flex;- gap: 6px;- padding: 8px 10px 0;- overflow-x: auto;-}-.file-chips:has(.attachment-tile) {- align-items: flex-start;+/* Thread */+.replies-content {+ padding: 8px 16px 0;}-.attachment-tile {- position: relative;- width: 80px;- height: 80px;- flex: none;- border-radius: var(--radius-l);- overflow: hidden;- background: var(--surface);-}-.attachment-tile img {- width: 100%;- height: 100%;- object-fit: contain;+.replies-count {+ padding: 12px 0;}-.attachment-remove {- position: absolute;- top: 4px;- right: 4px;- width: 22px;- height: 22px;- display: flex;- align-items: center;- justify-content: center;- border-radius: 50%;- background: rgba(0, 0, 0, 0.75);+.replies-count-label {+ white-space: nowrap;}-.file-chip {- display: flex;- align-items: center;- gap: 6px;- padding: 6px 10px;- border-radius: var(--radius-pill);- background: var(--surface);+.replies-composer {flex: none;}-/* The remove glyph is small; its target is 24 pt. */-.file-chip-remove {- display: grid;- place-items: center;- width: 24px;- height: 24px;- margin: -6px -8px -6px -4px;-}.call-overlay {position: absolute;@@ -349,6 +400,10 @@}.side-panel.shown { opacity: 1; }.side-panel.resizing { transition: none; }+.side-panel-content {+ height: 100%;+ flex: none;+}/* A message arriving while the list follows the newest pops in from its bubble's side (Grok Bot's). */.row-in {diff --git a/apps/desktop/src/renderer/views/thread/trace.css b/apps/desktop/src/renderer/views/thread/trace.cssnew file mode 100644index 00000000..b9193432--- /dev/null+++ b/apps/desktop/src/renderer/views/thread/trace.css@@ -0,0 +1,21 @@+/* The "Full conversation" sheet (TraceView.tsx). */+.trace-content {+ padding: 14px;+ font-size: var(--text-callout);+}+.trace-turn-title {+ padding-left: 4px;+}+/* A label's icon sits centered on its first line of caption text. */+.trace-label-icon {+ min-height: calc(var(--text-caption) * 1.25);+}+.trace-label-text {+ min-width: 0;+}+.trace-plan-done {+ text-decoration: line-through;+}+.trace-thought {+ white-space: pre-wrap;+}diff --git a/apps/desktop/src/renderer/views/usage/ProviderMascot.tsx b/apps/desktop/src/renderer/views/usage/ProviderMascot.tsxindex 0e2573a7..92d3679b 100644--- a/apps/desktop/src/renderer/views/usage/ProviderMascot.tsx+++ b/apps/desktop/src/renderer/views/usage/ProviderMascot.tsx@@ -2,26 +2,28 @@ import type { UsageProvider } from '@shared/models'import { agentIconURL, AgentIcon } from '../../components/AgentIcon'import { CharacterAvatar, drawCharacter } from '../../components/Avatar'import { Icon } from '../../components/Icon'+import { HStack } from '../../components/Stack'import { palette } from '../../lib/theme'import { mascotShape, providerRegistry, providerTint, providerTintCSS, tightest } from './usage-model'+import './usage.css'/** A provider's character, with a red "!" once any of its limits is nearly used up. */export function ProviderMascot({ provider, size, style = 'character' }: { provider: UsageProvider; size: number; style?: 'character' | 'original' }) {const full = (tightest(provider)?.percent ?? 0) >= 90if (style === 'original') {return (- <span style={{ width: size, height: size, display: 'grid', placeItems: 'center', flex: 'none' }}>+ <span className="usage-mascot-logo" style={{ width: size, height: size }}><AgentIcon registry={providerRegistry(provider.id)} size={size * 0.84} color={providerTintCSS(provider.id)} /></span>)}return (- <span style={{ position: 'relative', width: size, height: size, flex: 'none', display: 'block' }}>+ <span className="usage-mascot" style={{ width: size, height: size }}><CharacterAvatar shape={mascotShape(provider.id)} color="" tint={providerTint(provider.id)} size={size} mood={full ? 'needsInput' : 'idle'} />{full ? (- <span style={{ position: 'absolute', top: -size * 0.12, right: -size * 0.12, display: 'flex', color: 'var(--danger)', background: '#fff', borderRadius: '50%' }}>+ <HStack as="span" align="stretch" className="usage-mascot-alert" style={{ top: -size * 0.12, right: -size * 0.12 }}><Icon name="exclamationmark.circle.fill" size={size * 0.34} weight="bold" scaled={false} />- </span>+ </HStack>) : null}</span>)diff --git a/apps/desktop/src/renderer/views/usage/UsageBar.tsx b/apps/desktop/src/renderer/views/usage/UsageBar.tsxnew file mode 100644index 00000000..bb6c9c4f--- /dev/null+++ b/apps/desktop/src/renderer/views/usage/UsageBar.tsx@@ -0,0 +1,15 @@+import { ProgressBar } from '../../components/Controls'+import './usage.css'++/** A capsule filled to `percent`: the provider's tint below 70%, then amber, red from 90%. */+export function UsageBar({ percent, tint }: { percent: number; tint: string }) {+ const fill = percent >= 90 ? 'var(--danger)' : percent >= 70 ? 'var(--warning)' : tint+ return (+ <ProgressBar+ value={Math.min(1, Math.max(0.02, percent / 100))}+ label={`${Math.round(percent)}% used`}+ fill={fill}+ className="usage-bar"+ />+ )+}diff --git a/apps/desktop/src/renderer/views/usage/usage.css b/apps/desktop/src/renderer/views/usage/usage.cssnew file mode 100644index 00000000..47658f7d--- /dev/null+++ b/apps/desktop/src/renderer/views/usage/usage.css@@ -0,0 +1,25 @@+/* A provider's character (ProviderMascot): sized by its caller. */+.usage-mascot {+ position: relative;+ flex: none;+ display: block;+}+.usage-mascot-logo {+ display: grid;+ place-items: center;+ flex: none;+}+/* The red "!" once a limit is nearly used up, on a white disc in both schemes. */+.usage-mascot-alert {+ position: absolute;+ color: var(--danger);+ background: #fff;+ border-radius: 50%;+}+/* A usage limit's bar (UsageBar): thicker than a progress bar, on the bubble color. */+.progress-track.usage-bar {+ flex: 1;+ min-width: 0;+ height: 6px;+ background: var(--bubble-agent);+}diff --git a/docs/design/ui-conventions.md b/docs/design/ui-conventions.mdindex b03b6c98..22af4856 100644--- a/docs/design/ui-conventions.md+++ b/docs/design/ui-conventions.md@@ -52,7 +52,7 @@ The chat window's account menu copies Grok Bot's: Usage, Get Codync for mobile,The iPhone and the desktop no longer share UI code. `CodyncUI` (`apps/ios/Kit/`) is the iPhone app's own package; the desktop app (`apps/desktop/src/renderer/`) is a TypeScript port of the same screens with its own `BotStore`, chat items (`views/thread/chat-items.ts`) and Markdown blocks (`markdown-blocks.ts`).- The iPhone chat's chrome is in `ThreadView.swift` (`body`, `chrome`, `header`). The iPhone conversation (chat and thread) is a UIKit collection view of hosted SwiftUI rows (`ConversationList.swift`): it loads earlier messages from the computer as the reader scrolls up, runs under the bars and the composer (the list sits in the safe area and reaches past it, so rows never get a safe area of their own), follows the newest message until they scroll away (with a round "Jump to latest" button), and pops each new message in ([chat messages](../features/chat-messages.md)).-- The desktop UI rules (custom controls, no system menus except the tray, icon-only buttons, fill or border) are implemented in `apps/desktop/src/renderer/components/` (`Controls.tsx`, `Overlay.tsx`, `Icon.tsx`). Chrome on the sidebar (its header actions, the computer filter, Extensions) is outlined; chrome floating over the conversation (the title pill, the composer) is filled with a shadow. Corner radii and shadows come from the `--radius-*` and `--shadow-*` scale in `styles/theme.css`. Status text uses `--attention` (`--warning` is for dots and fills only), and destructive fills use `--danger-fill` with `--on-danger`, so both stay readable in light and dark. Sheets and dialogs hold focus while open: the window behind goes inert, Tab cycles inside, and focus returns to where it was on close.+- The desktop UI rules (custom controls, no system menus except the tray, icon-only buttons, fill or border) are implemented in `apps/desktop/src/renderer/components/` (`Controls.tsx`, `Overlay.tsx`, `Icon.tsx`, `Text.tsx`, `Stack.tsx`); how views use them and the theme tokens: [desktop styles](../guides/desktop-styles.md). Chrome on the sidebar (its header actions, the computer filter, Extensions) is outlined; chrome floating over the conversation (the title pill, the composer) is filled with a shadow. Corner radii and shadows come from the `--radius-*` and `--shadow-*` scale in `styles/theme.css`. Status text uses `--attention` (`--warning` is for dots and fills only), and destructive fills use `--danger-fill` with `--on-danger`, so both stay readable in light and dark. Sheets and dialogs hold focus while open: the window behind goes inert, Tab cycles inside, and focus returns to where it was on close.- The Android app (`apps/android/`) ports the iPhone screens one to one in Compose. Where iOS uses system UI (the tab bar, menus, sheets, Liquid Glass), Android draws the same look with its `design` module: glass from Kyant's backdrop library (blur, lens refraction and highlight on RenderEffect/RuntimeShader), the iOS sheet with its grabber and drag-to-close, glass menus and context menus, Inter for SF Pro and Material Symbols for SF Symbols (`Symbol("sf.name")`), and the soft scroll edge under its bars (`ScrollEdge`: the content behind the header, composer and tab bar blurs and washes out). Android has no Liquid Glass of its own; Material widgets aren't used.- A change to one lands in the other and the TUI in the same change; see [native client parity](#native-client-parity).diff --git a/docs/guides/desktop-styles.md b/docs/guides/desktop-styles.mdnew file mode 100644index 00000000..b27c736e--- /dev/null+++ b/docs/guides/desktop-styles.md@@ -0,0 +1,30 @@+# Desktop styles++How the desktop renderer (`apps/desktop/src/renderer/`) styles its views. Views hold no styling of their own: text, layout and visuals come from the shared primitives and tokens below, and an inline `style` is left only for values computed at runtime.++## Tokens (`styles/theme.css`)++- **Color**: `--text`, `--secondary`, `--tertiary`, `--danger`, `--attention` (status text), `--accent`, surfaces (`--background`, `--surface`, `--panel`, `--bubble-*`, `--chat-*`, `--chrome-fill`, `--composer-fill`), strokes (`--border`, `--chrome-stroke`, `--stroke-strong`), fills with their ink (`--accent-fill`/`--on-accent`, `--danger-fill`/`--on-danger`, `--warning`/`--on-warning`), `--added`/`--removed`, `--code-background`, `--scrim`. Every color has a light and a dark value. Views use the tokens, or `rgba(var(--text-rgb), a)` for a tint of the text color; a literal only where the color must not follow the theme (white behind a QR code or a favicon).+- **Type ramp**: `--text-large-title` 26, `--text-title` 22, `--text-title2` 17, `--text-title3` 15, `--text-body` 13, `--text-callout` 12, `--text-caption` 11 (points, scaled by the text size preference). `lib/fonts.ts` maps the macOS style names onto it (`headline` and `body` → body, `compactBody` → callout, `subheadline`, `footnote`, `caption`, `caption2`, `compactSecondary` → caption).+- **Radius**: `--radius-xs` 6, `--radius-s` 10, `--radius-m` 12, `--radius-l` 16, `--radius-xl` 22, `--radius-pill`. **Shadow**: `--shadow-s` (resting), `--shadow-m` (floating chrome), `--shadow-l` (menus, panels), `--shadow-xl` (sheets, dialogs).+- **Motion**: `--hover`, `--fade`, `--press`, `--morph`, `--layout`, `--ease`, `--ease-out`, `--spring`. The island has its own (`--island-spring`, `--island-fold`) in `views/island/island.css`.++## Primitives (`components/`)++| Need | Use |+| --- | --- |+| Text in a type style and color | `<Text size="caption" tone="secondary" weight="semibold" mono as="div">` (`Text.tsx`). With `size` the weight defaults to regular (bold for `headline`); without it, size and weight come from around it. `truncate` ends one line with an ellipsis, `lines={n}` clamps to n lines, `grow` takes a stack's free space, `tabular` lines digits up |+| A row / a column | `<HStack gap={8}>` (centered vertically; `align="stretch"` or `"baseline"` otherwise) / `<VStack gap={8}>` (`Stack.tsx`); `grow` takes the free space, `shrink` lets it shrink so text inside can truncate; `justify`, `wrap`, `as` |+| Space between stack items | `<Spacer />`, `<Spacer min={8} />` |+| A fixed-width column that centers an icon, so labels line up | `<IconSlot width={18} tone="secondary">` |+| A row's title with a note under it | `RowLabel` (`Controls.tsx`) |+| A sheet's content | `<SheetPage>` with a `ModalHeader` (`Overlay.tsx`); `ModalHeader` takes a `subtitle`, and `onClose` when it heads a panel instead of a modal |+| One line with an ellipsis on an element that isn't `Text` | `.truncate` |+| Controls | `Controls.tsx`, `Overlay.tsx`, `Icon.tsx`; `Hairline`, `Pill`, `Switch` and `ProgressBar` take a `className` for a view's own sizing, and a panel beside an anchor is placed with `anchorPlacement` |++## Where a style goes++1. Text styling is `Text` props; layout is `HStack`/`VStack`/`Spacer`.+2. Anything else static (padding, background, radius, size, position, borders) is a class in the view's CSS file, named after the view (`.bot-row`, `.unread-badge`), written with the tokens above.+3. No static inline styles. Inline `style` only for values computed at runtime: a size or color from props or data, a measured width, a transform that follows state. Keep the static part of that element in its class.+4. A pattern repeated across views becomes a primitive or a shared class here; don't copy it.