Skip to content

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

feat: put what changes often on a bot's Details tab, in outlined cards

leepokaidb49ee7755bb
diff --git a/apps/desktop/src/renderer/components/Controls.tsx b/apps/desktop/src/renderer/components/Controls.tsx
index 15d07d9b..a9e44b98 100644
--- a/apps/desktop/src/renderer/components/Controls.tsx
+++ b/apps/desktop/src/renderer/components/Controls.tsx
@@ -67,19 +67,22 @@ export function DropdownMenu({ items, children, className, style, title }: { ite
/** Picks one value: the current choice in a pill with a chevron, opening a Codync menu. */
export function ChoicePicker<T extends string | number>({ selection, options, onChange, fill, fits = false }: {
selection: T
- options: { id: T; label: string }[]
+ /** `leading`: a picture before the label, in the menu and on the picker (an agent's logo). */
+ options: { id: T; label: string; leading?: ReactNode }[]
onChange: (id: T) => void
fill?: string
fits?: boolean
}) {
- const label = options.find((o) => o.id === selection)?.label ?? 'Choose'
+ const chosen = options.find((o) => o.id === selection)
+ const label = chosen?.label ?? 'Choose'
return (
<DropdownMenu
title={label}
className={`choice-picker ${fill ? '' : 'outlined'}`}
style={{ background: fill, width: fits ? '100%' : undefined }}
- items={() => options.map((o) => ({ title: o.label, selected: o.id === selection, action: () => onChange(o.id) }))}
+ items={() => options.map((o) => ({ title: o.label, leading: o.leading, selected: o.id === selection, action: () => onChange(o.id) }))}
>
+ {chosen?.leading}
<span className="choice-label">{label}</span>
<Icon name="chevron.down" size={10} weight="semibold" color="var(--secondary)" />
</DropdownMenu>
@@ -181,7 +184,7 @@ export function ValueRow({ label, detail, children }: { label: string; detail?:
<div className="value-row">
<div style={{ display: 'flex', flexDirection: 'column', gap: 3, minWidth: 0 }}>
<span style={{ color: 'var(--text)' }}>{label}</span>
- {detail ? <span style={{ ...font('caption'), color: 'var(--secondary)', lineHeight: 1.35 }}>{detail}</span> : null}
+ {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>
diff --git a/apps/desktop/src/renderer/components/Overlay.tsx b/apps/desktop/src/renderer/components/Overlay.tsx
index aba55c11..40a9f535 100644
--- a/apps/desktop/src/renderer/components/Overlay.tsx
+++ b/apps/desktop/src/renderer/components/Overlay.tsx
@@ -146,6 +146,8 @@ export function Dialog({ open, title, message, actions, cancel = 'Cancel', onClo
export interface MenuItem {
title: string
icon?: string
+ /** A picture in the icon's place (an agent's logo). */
+ leading?: ReactNode
selected?: boolean
destructive?: boolean
divider?: boolean
@@ -220,9 +222,9 @@ export function MenuPanel({ items, reactions, dismiss, maxHeight }: { items: Men
item.action()
}}
>
- {item.icon ? (
+ {item.leading || item.icon ? (
<span className="menu-icon">
- <Icon name={item.icon} size={12} />
+ {item.leading ?? (item.icon ? <Icon name={item.icon} size={12} /> : null)}
</span>
) : null}
<span className="menu-title">{item.title}</span>
diff --git a/apps/desktop/src/renderer/components/controls.css b/apps/desktop/src/renderer/components/controls.css
index 18af8eb1..b66e19ca 100644
--- a/apps/desktop/src/renderer/components/controls.css
+++ b/apps/desktop/src/renderer/components/controls.css
@@ -132,6 +132,12 @@
color: var(--text);
}
+/* Grok Bot's list cards (routines, the computer switch): an outline on the page, no fill. */
+.outlined-card {
+ border: 1px solid var(--border);
+ border-radius: 14px;
+}
+
.tab-choice {
display: flex;
justify-content: center;
diff --git a/apps/desktop/src/renderer/store/bot-store.ts b/apps/desktop/src/renderer/store/bot-store.ts
index 43a6de6a..e6ebd1bf 100644
--- a/apps/desktop/src/renderer/store/bot-store.ts
+++ b/apps/desktop/src/renderer/store/bot-store.ts
@@ -265,6 +265,11 @@ export class BotStore extends BotSync {
this.patchBot(bot, { pinned })
}
+ /** Whether the bot may see and use the computer's screen. */
+ setComputer(bot: Bot, computer: boolean) {
+ this.patchBot(bot, { computer })
+ }
+
/** Whether the bot uses the memory all bots share. */
setSharedMemory(bot: Bot, sharedMemory: boolean) {
this.patchBot(bot, { sharedMemory })
diff --git a/apps/desktop/src/renderer/views/bots/BotEditorView.tsx b/apps/desktop/src/renderer/views/bots/BotEditorView.tsx
index 9775781c..90b2f33b 100644
--- a/apps/desktop/src/renderer/views/bots/BotEditorView.tsx
+++ b/apps/desktop/src/renderer/views/bots/BotEditorView.tsx
@@ -1,6 +1,7 @@
import { useCallback, useEffect, useRef, useState } from 'react'
import { fastModeRefusal, fastModeShown } from '@shared/fast-mode'
import { draftOf, type BotDraft, type DirListing } from '@shared/models'
+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'
@@ -59,8 +60,14 @@ export function BotEditorView({ draft: initial }: { draft: BotDraft }) {
)
}
+/**
+ * Which settings a form shows: all of them (a new bot, the editor sheet), what changes often
+ * (instructions, model, fast mode: the inspector's Details tab) or the rest (its Settings tab).
+ */
+export type FormPart = 'all' | 'often' | 'rarely'
+
/** The desktop inspector next to a conversation: the same form, saved as you edit. */
-export function BotSettingsPanel({ botId }: { botId: string }) {
+export function BotSettingsPanel({ botId, part }: { botId: string; part: FormPart }) {
const store = useStore()
const plugins = usePlugins(store)
const [draft, setDraft] = useState<BotDraft | null>(null)
@@ -86,15 +93,16 @@ export function BotSettingsPanel({ botId }: { botId: string }) {
return () => clearTimeout(timer)
}, [draft])
- return draft ? <BotSettingsForm draft={draft} onChange={change} error={error} plugins={plugins} /> : null
+ return draft ? <BotSettingsForm draft={draft} onChange={change} error={error} plugins={plugins} part={part} /> : null
}
/** Bot settings, in sections in the Settings style (`CardSection`). */
-function BotSettingsForm({ draft, onChange, error, plugins }: {
+function BotSettingsForm({ draft, onChange, error, plugins, part = 'all' }: {
draft: BotDraft
onChange: (update: (d: BotDraft) => BotDraft) => void
error: string | null
plugins: Plugins | null
+ part?: FormPart
}) {
const store = useStore()
const [pickingAvatar, setPickingAvatar] = useState(false)
@@ -113,6 +121,67 @@ function BotSettingsForm({ draft, onChange, error, plugins }: {
const connectors = plugins?.connectors ?? []
const skills = plugins?.skills ?? []
+ const instructions = (
+ <Field label="Standing instructions" detail="Rules that always apply. Put task-specific requests in the chat instead.">
+ <AutoTextArea className="field-box" value={draft.description} placeholder="e.g. Reviews PRs. Never pushes without asking." minRows={3} maxRows={8} onChange={(v) => set('description', v)} />
+ </Field>
+ )
+ const model = [
+ <AgentModelPicker key="model" backend={draft.backend} models={models} selection={draft.model} onChange={setModel} options={draft.modelOptions ?? {}} onOptionsChange={setModelOptions} />,
+ (draft.backend !== 'custom' && models.catalog?.fastMode) || draft.fastMode || (saved?.backend === draft.backend && fastModeShown(saved)) ? (
+ // Shown while the agent offers it (its model list, or the bot's own sessions), or while it's on.
+ <div key="fast" className="fade-in">
+ <SwitchRow
+ title="Fast mode"
+ detail={(saved && fastModeRefusal(saved)) ?? 'Faster replies for more usage, on models that offer it.'}
+ on={draft.fastMode ?? false}
+ onChange={(on) => set('fastMode', on)}
+ />
+ </div>
+ ) : null,
+ ]
+
+ const agent = (
+ <div key="agent" style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
+ <ValueRow label="Agent">
+ <ChoicePicker
+ selection={draft.backend}
+ options={[
+ ...backends.map((b) => ({ id: b.id, label: b.available ? b.name : `${b.name} (not installed)`, leading: <AgentIcon registry={b.registry ?? b.id} size={14} /> })),
+ { id: 'custom', label: 'Custom command', leading: <AgentIcon registry="custom" size={14} /> },
+ ]}
+ onChange={(id) => set('backend', id)}
+ />
+ </ValueRow>
+ {backend && !backend.available ? <span style={{ ...font('caption'), color: 'var(--warning)' }}>{backend.installHint}</span> : null}
+ {draft.backend === 'custom' ? (
+ <input
+ className="field-box fade-in"
+ style={font('callout', undefined, 'monospaced')}
+ value={draft.command ?? ''}
+ placeholder="ACP command, e.g. my-agent --acp"
+ spellCheck={false}
+ onChange={(e) => set('command', e.target.value || null)}
+ />
+ ) : null}
+ </div>
+ )
+
+ if (part === 'often') {
+ return (
+ <div className="bot-form">
+ <div className="bot-form-content">
+ <CardSection title="Instructions">{instructions}</CardSection>
+ <CardSection title="Agent">
+ {agent}
+ {model}
+ </CardSection>
+ {error ? <span className="fade-in" style={{ ...font('footnote'), color: 'var(--danger)' }}>{error}</span> : null}
+ </div>
+ </div>
+ )
+ }
+
return (
<div className="bot-form">
<div className="bot-form-content">
@@ -133,47 +202,16 @@ function BotSettingsForm({ draft, onChange, error, plugins }: {
<input className="field-box" value={draft.name} placeholder="Name" onChange={(e) => set('name', e.target.value)} />
</Field>
) : null}
- <Field label="Standing instructions" detail="Rules that always apply. Put task-specific requests in the chat instead.">
- <AutoTextArea className="field-box" value={draft.description} placeholder="e.g. Reviews PRs. Never pushes without asking." minRows={3} maxRows={8} onChange={(v) => set('description', v)} />
- </Field>
+ {part === 'all' ? instructions : null}
</CardSection>
- <CardSection title="Agent">
+ {/* 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>
</ValueRow>
- <div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
- <ValueRow label="Agent">
- <ChoicePicker
- selection={draft.backend}
- options={[...backends.map((b) => ({ id: b.id, label: b.available ? b.name : `${b.name} (not installed)` })), { id: 'custom', label: 'Custom command' }]}
- onChange={(id) => set('backend', id)}
- />
- </ValueRow>
- {backend && !backend.available ? <span style={{ ...font('caption'), color: 'var(--warning)' }}>{backend.installHint}</span> : null}
- {draft.backend === 'custom' ? (
- <input
- className="field-box fade-in"
- style={font('callout', undefined, 'monospaced')}
- value={draft.command ?? ''}
- placeholder="ACP command, e.g. my-agent --acp"
- spellCheck={false}
- onChange={(e) => set('command', e.target.value || null)}
- />
- ) : null}
- </div>
- <AgentModelPicker backend={draft.backend} models={models} selection={draft.model} onChange={setModel} options={draft.modelOptions ?? {}} onOptionsChange={setModelOptions} />
- {(draft.backend !== 'custom' && models.catalog?.fastMode) || draft.fastMode || (saved?.backend === draft.backend && fastModeShown(saved)) ? (
- // Shown while the agent offers it (its model list, or the bot's own sessions), or while it's on.
- <div className="fade-in">
- <SwitchRow
- title="Fast mode"
- detail={(saved && fastModeRefusal(saved)) ?? 'Faster replies for more usage, on models that offer it.'}
- on={draft.fastMode ?? false}
- onChange={(on) => set('fastMode', on)}
- />
- </div>
- ) : null}
+ {part === 'all' ? agent : null}
+ {part === 'all' ? model : null}
<ValueRow
label="Workspace"
detail={
@@ -216,7 +254,7 @@ function BotSettingsForm({ draft, onChange, error, plugins }: {
<CardSection title="Activity">
<SwitchRow title="Notifications" detail="Get notified when this bot finishes or needs you" on={draft.notify ?? true} onChange={(on) => set('notify', on)} />
- {store.screen ? (
+ {store.screen && part === 'all' ? (
<SwitchRow
title="Use the computer"
detail={
diff --git a/apps/desktop/src/renderer/views/bots/parts.tsx b/apps/desktop/src/renderer/views/bots/parts.tsx
index b658d462..3dd9cc50 100644
--- a/apps/desktop/src/renderer/views/bots/parts.tsx
+++ b/apps/desktop/src/renderer/views/bots/parts.tsx
@@ -14,7 +14,7 @@ export function Field({ label, detail, children }: { label: string; detail?: str
<div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
<div style={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
<span style={{ color: 'var(--text)' }}>{label}</span>
- {detail ? <span style={{ ...font('caption'), color: 'var(--secondary)', lineHeight: 1.35 }}>{detail}</span> : null}
+ {detail ? <span className="detail-note" title={detail} style={{ ...font('caption'), color: 'var(--secondary)', lineHeight: 1.35 }}>{detail}</span> : null}
</div>
{children}
</div>
@@ -27,7 +27,7 @@ export function SwitchRow({ title, detail, on, onChange }: { title: string; deta
<Switch on={on} onChange={onChange}>
<span style={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
<span style={{ color: 'var(--text)' }}>{title}</span>
- {detail ? <span style={{ ...font('caption'), color: 'var(--secondary)', lineHeight: 1.35 }}>{detail}</span> : null}
+ {detail ? <span className="detail-note" title={detail} style={{ ...font('caption'), color: 'var(--secondary)', lineHeight: 1.35 }}>{detail}</span> : null}
</span>
</Switch>
)
diff --git a/apps/desktop/src/renderer/views/routines/RoutinesView.tsx b/apps/desktop/src/renderer/views/routines/RoutinesView.tsx
index 12bb2e31..3929be32 100644
--- a/apps/desktop/src/renderer/views/routines/RoutinesView.tsx
+++ b/apps/desktop/src/renderer/views/routines/RoutinesView.tsx
@@ -1,5 +1,5 @@
-import { Fragment, useEffect, useRef, useState } from 'react'
-import { Hairline, IconButton, Switch } from '../../components/Controls'
+import { useEffect, useRef, useState } from 'react'
+import { IconButton, Switch } from '../../components/Controls'
import { Sheet } from '../../components/Overlay'
import { font } from '../../lib/fonts'
import { useStore } from '../../store/context'
@@ -117,7 +117,6 @@ export function RoutinesView({ botId, initialId, onClose }: { botId: string; ini
}
const editingRoutine = routines.find((r) => r.id === editing?.routineId) ?? null
- const surface = { background: 'var(--surface)', borderRadius: 16 }
return (
<div style={{ display: 'flex', flexDirection: 'column', gap: onClose ? 16 : 10, color: 'var(--text)', ...font(13) }}>
<div style={{ display: 'flex', alignItems: 'center' }}>
@@ -133,24 +132,21 @@ export function RoutinesView({ botId, initialId, onClose }: { botId: string; ini
{loadError ? <span style={{ ...font('caption'), color: 'var(--danger)' }}>{loadError}</span> : null}
{error ? <span style={{ ...font('caption'), color: 'var(--danger)', userSelect: 'text' }}>{error}</span> : null}
{routines.length === 0 ? (
- <div style={{ ...surface, ...font(12), lineHeight: 1.45, color: 'var(--secondary)', padding: 14 }}>
+ <div className="outlined-card" style={{ ...font(12), lineHeight: 1.45, color: 'var(--secondary)', padding: 14 }}>
{loaded ? 'No routines yet. Ask the bot for one, or set it up yourself with +.' : 'Loading routines…'}
</div>
) : (
- <div style={{ ...surface, padding: '0 14px' }}>
- {routines.map((routine, i) => (
- <Fragment key={routine.id}>
- {i > 0 ? <Hairline /> : null}
- <div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
- <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>
- </button>
- <span aria-label={routine.name} style={{ display: 'flex' }}>
- <Switch on={routine.enabled} disabled={busy || store.isOffline} onChange={(on) => void action('setRoutineEnabled', routine, on)} />
- </span>
- </div>
- </Fragment>
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
+ {routines.map((routine) => (
+ <div key={routine.id} className="outlined-card" style={{ display: 'flex', alignItems: 'center', gap: 12, padding: '0 14px' }}>
+ <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>
+ </button>
+ <span aria-label={routine.name} style={{ display: 'flex' }}>
+ <Switch on={routine.enabled} disabled={busy || store.isOffline} onChange={(on) => void action('setRoutineEnabled', routine, on)} />
+ </span>
+ </div>
))}
</div>
)}
diff --git a/apps/desktop/src/renderer/views/thread/DetailsPanel.tsx b/apps/desktop/src/renderer/views/thread/DetailsPanel.tsx
index 37b5fc16..513e8f55 100644
--- a/apps/desktop/src/renderer/views/thread/DetailsPanel.tsx
+++ b/apps/desktop/src/renderer/views/thread/DetailsPanel.tsx
@@ -1,7 +1,7 @@
import { isGroup, isWorking, type Bot } from '@shared/models'
import { AgentIcon } from '../../components/AgentIcon'
import { BotAvatar, GroupAvatar } from '../../components/Avatar'
-import { CardSection, IconButton, TabChoice, ValueRow } from '../../components/Controls'
+import { IconButton, Switch, TabChoice } from '../../components/Controls'
import { Icon } from '../../components/Icon'
import { font } from '../../lib/fonts'
import { useStore } from '../../store/context'
@@ -35,6 +35,7 @@ export function DetailsPanel({ botId, routineId, tab, setTab, editGroup, share,
const group = !!bot && isGroup(bot)
return (
<div className="details-panel">
+ <div className="details-drag" />
<div className="details-actions">
{bot && !group ? <MacChatButton className="ringed" title="Create template" icon="square.and.arrow.up" onClick={share} /> : null}
<MacChatButton className="ringed" title="Close details" icon="xmark" onClick={close} />
@@ -49,13 +50,14 @@ export function DetailsPanel({ botId, routineId, tab, setTab, editGroup, share,
<div key={tab} className="details-tab fade-in">
{tab === 'details' ? (
<>
+ <BotSettingsPanel botId={botId} part="often" />
{bot ? <ComputerUse bot={bot} /> : null}
<RoutinesView botId={botId} initialId={routineId} />
</>
) : tab === 'memory' ? (
<MemoryCard botId={botId} />
) : (
- <BotSettingsPanel botId={botId} />
+ <BotSettingsPanel botId={botId} part="rarely" />
)}
</div>
</>
@@ -88,14 +90,25 @@ function Identity({ bot }: { bot: Bot }) {
)
}
-/** Whether this bot may use the computer; it's changed in Settings. */
+/** Whether this bot may use the computer, switched right here (also in Settings). */
function ComputerUse({ bot }: { bot: Bot }) {
const store = useStore()
- if (!store.screen) return null
+ const screen = store.screen
+ if (!screen) return null
+ const ready = screen.platform === 'windows' || (screen.enabled && screen.connected && screen.capture && screen.input)
return (
- <CardSection title="Computer">
- <ValueRow label="Use the computer">{bot.computer ? 'On' : 'Off'}</ValueRow>
- </CardSection>
+ <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' }}>
+ <Switch label="Use the computer" on={bot.computer} disabled={store.isOffline} onChange={(on) => store.setComputer(bot, on)} />
+ </span>
+ </div>
+ </section>
)
}
diff --git a/apps/desktop/src/renderer/views/thread/ThreadView.tsx b/apps/desktop/src/renderer/views/thread/ThreadView.tsx
index dd83d04e..7e2a144c 100644
--- a/apps/desktop/src/renderer/views/thread/ThreadView.tsx
+++ b/apps/desktop/src/renderer/views/thread/ThreadView.tsx
@@ -138,6 +138,10 @@ export function ThreadView({ botId }: { botId: string }) {
<span style={{ display: 'flex', alignItems: 'center', 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>
+ {/* 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>
{store.shownConnection.kind !== 'online' || store.mismatch ? <ConnectionSubtitle /> : null}
</button>
diff --git a/apps/desktop/src/renderer/views/thread/details-panel.css b/apps/desktop/src/renderer/views/thread/details-panel.css
index a8b331e6..3722a05b 100644
--- a/apps/desktop/src/renderer/views/thread/details-panel.css
+++ b/apps/desktop/src/renderer/views/thread/details-panel.css
@@ -6,13 +6,24 @@
background: var(--background);
}
+/* The top band moves the window, like the chat's top chrome; the corner buttons stay clickable. */
+.details-drag {
+ position: absolute;
+ inset: 0 0 auto;
+ height: 54px;
+ z-index: 1;
+ /* What scrolls under it fades out, like the chat's top edge. */
+ background: linear-gradient(var(--background) 70%, transparent);
+ -webkit-app-region: drag;
+}
.details-actions {
position: absolute;
top: 11px;
right: 11px;
- z-index: 1;
+ z-index: 2;
display: flex;
gap: 8px;
+ -webkit-app-region: no-drag;
}
.details-scroll {
@@ -53,6 +64,71 @@
gap: 28px;
padding: 20px 16px 0;
}
+.details-section {
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+}
+.details-section-title {
+ padding-left: 2px;
+ font-size: calc(13px * var(--scale));
+ font-weight: 600;
+ color: var(--text);
+}
+.details-switch {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ padding: 12px 14px;
+ font-size: calc(13px * var(--scale));
+ 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);
+}
+
+/* Every group in the inspector is an outlined card, like the routines; inputs take the fill. */
+.details-tab .card-section-rows {
+ background: none;
+ border: 1px solid var(--border);
+ border-radius: 14px;
+}
+.details-tab .field-box {
+ background: var(--surface);
+}
+/* Long notes (skill descriptions, explanations, a note's description) stop at two lines in the
+ narrow panel; hovering shows the rest, and a skill's info button or a note opens it whole. */
+.details-tab .detail-note,
+.details-tab .memory-content > .memory-muted {
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+}
+.details-tab .routine-row > span {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+/* 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;
+ row-gap: 8px;
+}
+.details-tab .value-row:has(.detail-note) > :first-child {
+ flex: 1 1 100%;
+}
+
/* The settings form scrolls with the panel, not on its own. */
.details-tab .bot-form {
height: auto;
diff --git a/apps/desktop/src/renderer/views/thread/thread.css b/apps/desktop/src/renderer/views/thread/thread.css
index 68940a93..2474180b 100644
--- a/apps/desktop/src/renderer/views/thread/thread.css
+++ b/apps/desktop/src/renderer/views/thread/thread.css
@@ -78,6 +78,19 @@
.title-pill {
transition: opacity var(--layout), transform var(--layout);
}
+.title-pill-chevron {
+ display: flex;
+ width: 0;
+ margin-left: -7px;
+ overflow: hidden;
+ opacity: 0;
+ transition: width var(--hover), margin var(--hover), opacity var(--hover);
+}
+.title-pill:hover .title-pill-chevron {
+ width: calc(10px * var(--scale));
+ margin-left: 0;
+ opacity: 1;
+}
.title-pill.hidden-by-call {
opacity: 0;
transform: translateY(-8px);
diff --git a/apps/ios/Kit/Sources/CodyncUI/Bots/BotDetailsView.swift b/apps/ios/Kit/Sources/CodyncUI/Bots/BotDetailsView.swift
index 7fd8630d..46b3ae13 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Bots/BotDetailsView.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Bots/BotDetailsView.swift
@@ -42,6 +42,8 @@ struct BotDetailsView: View {
TabChoice(selection: $tab, options: [(.details, "Details"), (.memory, "Memory"), (.settings, "Settings")])
.padding(.top, 18)
page.padding(.top, 20)
+ .environment(\.cardStyle, .outlined)
+ .environment(\.noteLines, 2)
}
.padding(.horizontal, 20)
.padding(.bottom, 24)
@@ -105,9 +107,20 @@ struct BotDetailsView: View {
switch tab {
case .details:
VStack(alignment: .leading, spacing: 28) {
- if model.screen != nil, let bot {
- CardSection("Computer") {
- ValueRow("Use the computer", value: bot.computer ? "On" : "Off")
+ if let draft = Binding($draft) {
+ BotSettingsForm(draft: draft, error: saveError, scrolls: false, part: .often)
+ }
+ if let screen = model.screen, let bot {
+ VStack(alignment: .leading, spacing: 10) {
+ Text("Computer")
+ .font(.system(size: 15, weight: .semibold))
+ .foregroundStyle(Palette.text)
+ .padding(.leading, 2)
+ SwitchRow("Use the computer",
+ detail: screen.controlReady == true ? nil : "On that computer, open Codync → Settings → Computer access to set it up first.",
+ isOn: Binding(get: { bot.computer }, set: { model.setComputer(bot, $0) }))
+ .disabled(model.isOffline)
+ .outlinedCard()
}
}
RoutinesView(botId: botId, initialId: routineId) { dismiss() }
@@ -116,7 +129,7 @@ struct BotDetailsView: View {
MemoryCard(botId: botId)
case .settings:
if let draft = Binding($draft) {
- BotSettingsForm(draft: draft, error: saveError, scrolls: false)
+ BotSettingsForm(draft: draft, error: saveError, scrolls: false, part: .rarely)
}
}
}
diff --git a/apps/ios/Kit/Sources/CodyncUI/Bots/BotEditorView.swift b/apps/ios/Kit/Sources/CodyncUI/Bots/BotEditorView.swift
index 154f709d..f28482eb 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Bots/BotEditorView.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Bots/BotEditorView.swift
@@ -73,6 +73,12 @@ public struct BotEditorView: View {
}
}
+/// Which settings a form shows: all of them (a new bot), what changes often (instructions, model,
+/// fast mode: the details sheet's Details page) or the rest (its Settings page).
+enum FormPart {
+ case all, often, rarely
+}
+
/// Bot settings, in sections in the Settings style (`CardSection`). `scrolls` is off where a
/// surrounding view scrolls (the details sheet).
struct BotSettingsForm: View {
@@ -81,6 +87,7 @@ struct BotSettingsForm: View {
var computers: [(id: ComputerID, label: String)] = []
var computer: Binding<ComputerID>?
var scrolls = true
+ var part: FormPart = .all
@Environment(BotStore.self) private var model
@Environment(\.accessibilityReduceMotion) private var reduceMotion
@State private var pickingFolder = false
@@ -108,7 +115,60 @@ struct BotSettingsForm: View {
}
}
- private var sections: some View {
+ /// What changes often: on the details sheet's Details page.
+ private var oftenSections: some View {
+ VStack(alignment: .leading, spacing: 30) {
+ CardSection("Instructions") { instructions }
+ CardSection("Agent") {
+ agentPicker
+ modelPicker
+ }
+ if let error {
+ Text(error).font(.footnote).foregroundStyle(Palette.danger)
+ }
+ }
+ }
+
+ private var instructions: some View {
+ Field("Standing instructions", detail: "Rules that always apply. Put task-specific requests in the chat instead.") {
+ TextField("e.g. Reviews PRs. Never pushes without asking.", text: $draft.description, axis: .vertical)
+ .lineLimit(3...8)
+ .fieldBox()
+ }
+ }
+
+ private var agentPicker: some View {
+ VStack(alignment: .leading, spacing: 8) {
+ ValueRow("Agent") {
+ ChoicePicker(selection: $draft.backend,
+ options: (model.hello?.backends ?? []).map { ($0.id, $0.available ? $0.name : "\($0.name) (not installed)") } + [("custom", "Custom command")],
+ image: { id in AgentIcon.image(registry: model.hello?.backends.first { $0.id == id }?.registry ?? id) })
+ }
+ if let b = model.hello?.backends.first(where: { $0.id == draft.backend }), !b.available {
+ Text(b.installHint).font(.caption).foregroundStyle(Palette.warning)
+ .frame(maxWidth: .infinity, alignment: .leading)
+ }
+ if draft.backend == "custom" {
+ TextField("ACP command, e.g. my-agent --acp", text: Binding(get: { draft.command ?? "" }, set: { draft.command = $0.isEmpty ? nil : $0 }))
+ .font(.callout.monospaced())
+ .plainTextInput()
+ .fieldBox()
+ }
+ }
+ }
+
+ private var modelPicker: some View {
+ AgentModelPicker(backend: draft.backend, selection: $draft.model, options: $draft.modelOptions,
+ fastMode: Binding(get: { draft.fastMode ?? false }, set: { on in
+ withAnimation(Motion.reduced(Motion.fade, reduceMotion)) { draft.fastMode = on }
+ }), bot: draft.id.flatMap { model.bots[$0] })
+ }
+
+ @ViewBuilder private var sections: some View {
+ if part == .often { oftenSections } else { allSections }
+ }
+
+ private var allSections: some View {
VStack(alignment: .leading, spacing: 30) {
CardSection("Profile") {
VStack(alignment: .leading, spacing: 12) {
@@ -135,14 +195,11 @@ struct BotSettingsForm: View {
TextField("Name", text: $draft.name).fieldBox()
}
}
- Field("Standing instructions", detail: "Rules that always apply. Put task-specific requests in the chat instead.") {
- TextField("e.g. Reviews PRs. Never pushes without asking.", text: $draft.description, axis: .vertical)
- .lineLimit(3...8)
- .fieldBox()
- }
+ if part == .all { instructions }
}
- CardSection("Agent") {
+ // On the details sheet the agent and its model are on the Details page; what's left is where it works.
+ CardSection(part == .all ? "Agent" : "Workspace") {
VStack(alignment: .leading, spacing: 6) {
ValueRow("Computer") {
if let computer {
@@ -157,26 +214,10 @@ struct BotSettingsForm: View {
.font(.caption).foregroundStyle(Palette.warning)
}
}
- VStack(alignment: .leading, spacing: 8) {
- ValueRow("Agent") {
- ChoicePicker(selection: $draft.backend,
- options: (model.hello?.backends ?? []).map { ($0.id, $0.available ? $0.name : "\($0.name) (not installed)") } + [("custom", "Custom command")])
- }
- if let b = model.hello?.backends.first(where: { $0.id == draft.backend }), !b.available {
- Text(b.installHint).font(.caption).foregroundStyle(Palette.warning)
- .frame(maxWidth: .infinity, alignment: .leading)
- }
- if draft.backend == "custom" {
- TextField("ACP command, e.g. my-agent --acp", text: Binding(get: { draft.command ?? "" }, set: { draft.command = $0.isEmpty ? nil : $0 }))
- .font(.callout.monospaced())
- .plainTextInput()
- .fieldBox()
- }
+ if part == .all {
+ agentPicker
+ modelPicker
}
- AgentModelPicker(backend: draft.backend, selection: $draft.model, options: $draft.modelOptions,
- fastMode: Binding(get: { draft.fastMode ?? false }, set: { on in
- withAnimation(Motion.reduced(Motion.fade, reduceMotion)) { draft.fastMode = on }
- }), bot: draft.id.flatMap { model.bots[$0] })
ValueRow("Workspace", detail: draft.cwd.isEmpty
? "This bot has its own space for files. It can work in other folders when you ask."
: "This project is the default starting folder. The bot can work elsewhere when you ask.") {
@@ -209,7 +250,7 @@ struct BotSettingsForm: View {
CardSection("Activity") {
SwitchRow("Notifications", detail: "Get notified when this bot finishes or needs you",
isOn: Binding(get: { draft.notify ?? true }, set: { draft.notify = $0 }))
- if model.screen != nil {
+ if model.screen != nil, part == .all {
SwitchRow("Use the computer", detail: model.screen?.controlReady != true
? "Let this bot use apps. On that computer, open Codync → Settings → Computer access to set up permissions first."
: model.screen?.enabled == true
@@ -246,6 +287,7 @@ struct Field<Content: View>: View {
let label: String
var detail: String?
@ViewBuilder let content: Content
+ @Environment(\.noteLines) private var noteLines
init(_ label: String, detail: String? = nil, @ViewBuilder content: () -> Content) {
self.label = label
@@ -259,6 +301,7 @@ struct Field<Content: View>: View {
Text(label).foregroundStyle(Palette.text)
if let detail {
Text(detail).font(.caption).foregroundStyle(Palette.secondary).lineSpacing(2)
+ .lineLimit(noteLines)
.fixedSize(horizontal: false, vertical: true)
}
}
@@ -272,6 +315,7 @@ struct SwitchRow: View {
let title: String
var detail: String?
@Binding var isOn: Bool
+ @Environment(\.noteLines) private var noteLines
init(_ title: String, detail: String? = nil, isOn: Binding<Bool>) {
self.title = title
@@ -285,6 +329,7 @@ struct SwitchRow: View {
Text(title).foregroundStyle(Palette.text)
if let detail {
Text(detail).font(.caption).foregroundStyle(Palette.secondary).lineSpacing(2)
+ .lineLimit(noteLines)
.fixedSize(horizontal: false, vertical: true)
}
}
@@ -294,12 +339,23 @@ struct SwitchRow: View {
}
extension View {
- /// A rounded input box.
- func fieldBox(fill: Color = Palette.background) -> some View {
- textFieldStyle(.plain)
+ /// A rounded input box: the page color in a filled card, filled in an outlined one.
+ func fieldBox(fill: Color? = nil) -> some View {
+ modifier(FieldBox(fill: fill))
+ }
+}
+
+private struct FieldBox: ViewModifier {
+ let fill: Color?
+ @Environment(\.cardStyle) private var cardStyle
+
+ func body(content: Content) -> some View {
+ content
+ .textFieldStyle(.plain)
.padding(.horizontal, 14)
.padding(.vertical, 11)
- .background(fill, in: RoundedRectangle(cornerRadius: 12, style: .continuous))
+ .background(fill ?? (cardStyle == .outlined ? Palette.surface : Palette.background),
+ in: RoundedRectangle(cornerRadius: 12, style: .continuous))
}
}
@@ -370,119 +426,3 @@ struct AvatarPicker: View {
}
}
}
-
-/// Browses folders on the host, drilling down in place.
-struct FolderPicker: View {
- let start: String?
- let onPick: (String) -> Void
- /// The folders opened so far; the last one is shown.
- @State private var stack: [String?]
- @State private var forward = true
- @Environment(\.accessibilityReduceMotion) private var reduceMotion
-
- init(start: String?, onPick: @escaping (String) -> Void) {
- self.start = start
- self.onPick = onPick
- _stack = State(initialValue: [start])
- }
-
- var body: some View {
- let current = stack.last ?? nil
- VStack(spacing: 0) {
- HStack(spacing: 0) {
- if stack.count > 1 {
- BackButton { go(forward: false) { stack.removeLast() } }
- .padding(.leading, 12)
- .transition(.opacity)
- }
- ModalHeader(current.map { ($0 as NSString).lastPathComponent } ?? "Folders")
- }
- ZStack {
- FolderLevel(path: current, onPick: onPick) { path in go(forward: true) { stack.append(path) } }
- .id(stack.count)
- .transition(.asymmetric(
- insertion: .move(edge: forward ? .trailing : .leading),
- removal: .move(edge: forward ? .leading : .trailing)
- ).combined(with: .opacity))
- }
- .frame(maxHeight: .infinity, alignment: .top)
- .clipped()
- }
- .background(Palette.background)
- }
-
- /// Sets the slide direction first, so the leaving level takes it too, then moves.
- private func go(forward: Bool, _ change: @escaping () -> Void) {
- self.forward = forward
- Task { @MainActor in
- withAnimation(Motion.reduced(Motion.layout, reduceMotion), change)
- }
- }
-}
-
-/// One folder's subfolders.
-private struct FolderLevel: View {
- let path: String?
- let onPick: (String) -> Void
- let open: (String) -> Void
- @Environment(BotStore.self) private var model
- @State private var listing: DirListing?
- @State private var error: String?
- @State private var filter = ""
-
- var body: some View {
- ScrollView {
- LazyVStack(alignment: .leading, spacing: 22) {
- SearchField(text: $filter)
- if let listing {
- CardSection(footer: listing.path) {
- Button {
- onPick(listing.path)
- } label: {
- Label("Use “\((listing.path as NSString).lastPathComponent)”", systemImage: "checkmark.circle.fill")
- .font(.headline)
- .foregroundStyle(Palette.accent)
- .frame(maxWidth: .infinity, alignment: .leading)
- .contentShape(Rectangle())
- }
- .buttonStyle(PressScale())
- }
- let dirs = listing.dirs.filter { filter.isEmpty || $0.name.localizedCaseInsensitiveContains(filter) }
- if !dirs.isEmpty {
- CardSection {
- ForEach(dirs) { dir in
- Button {
- open(dir.path)
- } label: {
- HStack(spacing: 10) {
- Image(systemName: dir.isGit ? "arrow.triangle.branch" : "folder")
- .foregroundStyle(dir.isGit ? Palette.accent : Palette.secondary)
- .frame(width: 20)
- Text(dir.name).foregroundStyle(Palette.text).lineLimit(1)
- Spacer(minLength: 8)
- Image(systemName: "chevron.right")
- .font(.caption2.weight(.semibold))
- .foregroundStyle(Palette.tertiary)
- }
- .contentShape(Rectangle())
- }
- .buttonStyle(PressScale())
- }
- }
- }
- } else if let error {
- Text(error).foregroundStyle(Palette.danger)
- } else {
- Spinner(size: 20).frame(maxWidth: .infinity)
- }
- }
- .font(.body)
- .padding(20)
- }
- .scrollDismissesKeyboard(.interactively)
- .background(Palette.background)
- .task {
- do { listing = try await model.listDirs(path) } catch { self.error = error.localizedDescription }
- }
- }
-}
diff --git a/apps/ios/Kit/Sources/CodyncUI/Bots/FolderPicker.swift b/apps/ios/Kit/Sources/CodyncUI/Bots/FolderPicker.swift
new file mode 100644
index 00000000..b426abed
--- /dev/null
+++ b/apps/ios/Kit/Sources/CodyncUI/Bots/FolderPicker.swift
@@ -0,0 +1,118 @@
+import CodyncKit
+import SwiftUI
+
+/// Browses folders on the host, drilling down in place.
+struct FolderPicker: View {
+ let start: String?
+ let onPick: (String) -> Void
+ /// The folders opened so far; the last one is shown.
+ @State private var stack: [String?]
+ @State private var forward = true
+ @Environment(\.accessibilityReduceMotion) private var reduceMotion
+
+ init(start: String?, onPick: @escaping (String) -> Void) {
+ self.start = start
+ self.onPick = onPick
+ _stack = State(initialValue: [start])
+ }
+
+ var body: some View {
+ let current = stack.last ?? nil
+ VStack(spacing: 0) {
+ HStack(spacing: 0) {
+ if stack.count > 1 {
+ BackButton { go(forward: false) { stack.removeLast() } }
+ .padding(.leading, 12)
+ .transition(.opacity)
+ }
+ ModalHeader(current.map { ($0 as NSString).lastPathComponent } ?? "Folders")
+ }
+ ZStack {
+ FolderLevel(path: current, onPick: onPick) { path in go(forward: true) { stack.append(path) } }
+ .id(stack.count)
+ .transition(.asymmetric(
+ insertion: .move(edge: forward ? .trailing : .leading),
+ removal: .move(edge: forward ? .leading : .trailing)
+ ).combined(with: .opacity))
+ }
+ .frame(maxHeight: .infinity, alignment: .top)
+ .clipped()
+ }
+ .background(Palette.background)
+ }
+
+ /// Sets the slide direction first, so the leaving level takes it too, then moves.
+ private func go(forward: Bool, _ change: @escaping () -> Void) {
+ self.forward = forward
+ Task { @MainActor in
+ withAnimation(Motion.reduced(Motion.layout, reduceMotion), change)
+ }
+ }
+}
+
+/// One folder's subfolders.
+private struct FolderLevel: View {
+ let path: String?
+ let onPick: (String) -> Void
+ let open: (String) -> Void
+ @Environment(BotStore.self) private var model
+ @State private var listing: DirListing?
+ @State private var error: String?
+ @State private var filter = ""
+
+ var body: some View {
+ ScrollView {
+ LazyVStack(alignment: .leading, spacing: 22) {
+ SearchField(text: $filter)
+ if let listing {
+ CardSection(footer: listing.path) {
+ Button {
+ onPick(listing.path)
+ } label: {
+ Label("Use “\((listing.path as NSString).lastPathComponent)”", systemImage: "checkmark.circle.fill")
+ .font(.headline)
+ .foregroundStyle(Palette.accent)
+ .frame(maxWidth: .infinity, alignment: .leading)
+ .contentShape(Rectangle())
+ }
+ .buttonStyle(PressScale())
+ }
+ let dirs = listing.dirs.filter { filter.isEmpty || $0.name.localizedCaseInsensitiveContains(filter) }
+ if !dirs.isEmpty {
+ CardSection {
+ ForEach(dirs) { dir in
+ Button {
+ open(dir.path)
+ } label: {
+ HStack(spacing: 10) {
+ Image(systemName: dir.isGit ? "arrow.triangle.branch" : "folder")
+ .foregroundStyle(dir.isGit ? Palette.accent : Palette.secondary)
+ .frame(width: 20)
+ Text(dir.name).foregroundStyle(Palette.text).lineLimit(1)
+ Spacer(minLength: 8)
+ Image(systemName: "chevron.right")
+ .font(.caption2.weight(.semibold))
+ .foregroundStyle(Palette.tertiary)
+ }
+ .contentShape(Rectangle())
+ }
+ .buttonStyle(PressScale())
+ }
+ }
+ }
+ } else if let error {
+ Text(error).foregroundStyle(Palette.danger)
+ } else {
+ Spinner(size: 20).frame(maxWidth: .infinity)
+ }
+ }
+ .font(.body)
+ .padding(20)
+ }
+ .scrollDismissesKeyboard(.interactively)
+ .background(Palette.background)
+ .task {
+ do { listing = try await model.listDirs(path) } catch { self.error = error.localizedDescription }
+ }
+ }
+}
diff --git a/apps/ios/Kit/Sources/CodyncUI/Bots/MemoryFilesView.swift b/apps/ios/Kit/Sources/CodyncUI/Bots/MemoryFilesView.swift
index 0c1a666c..81237df5 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Bots/MemoryFilesView.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Bots/MemoryFilesView.swift
@@ -7,6 +7,7 @@ struct MemoryFilesList: View {
let files: MemoryFiles
let shared: Bool
@State private var open: MemoryFileTarget?
+ @Environment(\.noteLines) private var noteLines
var body: some View {
let folder = shared ? files.yours : files.bot
@@ -41,7 +42,7 @@ struct MemoryFilesList: View {
Label(file.name, systemImage: file.deleted ? "doc" : "doc.text")
.foregroundStyle(file.deleted ? Palette.tertiary : Palette.text)
if let description = file.description, !file.deleted {
- Text(description).font(.footnote).foregroundStyle(Palette.secondary)
+ Text(description).font(.footnote).foregroundStyle(Palette.secondary).lineLimit(noteLines)
}
Text(caption(file, cap: cap))
.font(.caption)
diff --git a/apps/ios/Kit/Sources/CodyncUI/Controls.swift b/apps/ios/Kit/Sources/CodyncUI/Controls.swift
index a871ea4f..8d63bc75 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Controls.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Controls.swift
@@ -130,15 +130,18 @@ public struct MenuItem: Identifiable {
public let id = UUID()
public var title: String
public var icon: String?
+ /// A picture in the icon's place (an agent's logo).
+ public var image: Image?
public var selected: Bool?
public var destructive: Bool
public var divider: Bool
public var action: () -> Void
- public init(_ title: String, icon: String? = nil, selected: Bool? = nil, destructive: Bool = false,
+ public init(_ title: String, icon: String? = nil, image: Image? = nil, selected: Bool? = nil, destructive: Bool = false,
divider: Bool = false, action: @escaping () -> Void) {
self.title = title
self.icon = icon
+ self.image = image
self.selected = selected
self.destructive = destructive
self.divider = divider
@@ -196,13 +199,19 @@ private struct ContextActions: ViewModifier {
// The binding's setter must be Sendable, but SwiftUI only calls it from the menu, on the
// main thread where the action was made.
nonisolated(unsafe) let action = item.action
- Toggle(isOn: Binding(get: { selected }, set: { _ in action() })) {
- if let icon = item.icon { SwiftUI.Label(item.title, systemImage: icon) } else { Text(item.title) }
- }
+ Toggle(isOn: Binding(get: { selected }, set: { _ in action() })) { menuLabel(item) }
+ } else {
+ Button(role: role, action: item.action) { menuLabel(item) }
+ }
+}
+
+@ViewBuilder private func menuLabel(_ item: MenuItem) -> some View {
+ if let image = item.image {
+ SwiftUI.Label { Text(item.title) } icon: { image }
} else if let icon = item.icon {
- Button(role: role, action: item.action) { SwiftUI.Label(item.title, systemImage: icon) }
+ SwiftUI.Label(item.title, systemImage: icon)
} else {
- Button(item.title, role: role, action: item.action)
+ Text(item.title)
}
}
@@ -235,19 +244,28 @@ public struct ChoicePicker<ID: Hashable>: View {
let options: [(id: ID, label: String)]
var fill: Color
var fitsAvailableWidth: Bool
+ /// A picture before each label, in the menu and on the pill (an agent's logo).
+ var image: ((ID) -> Image?)?
- public init(selection: Binding<ID>, options: [(id: ID, label: String)], fill: Color = .clear, fitsAvailableWidth: Bool = false) {
+ public init(selection: Binding<ID>, options: [(id: ID, label: String)], fill: Color = .clear, fitsAvailableWidth: Bool = false,
+ image: ((ID) -> Image?)? = nil) {
_selection = selection
self.options = options
self.fill = fill
self.fitsAvailableWidth = fitsAvailableWidth
+ self.image = image
}
public var body: some View {
DropdownMenu {
- options.map { option in MenuItem(option.label, selected: option.id == selection) { selection = option.id } }
+ options.map { option in
+ MenuItem(option.label, image: image?(option.id), selected: option.id == selection) { selection = option.id }
+ }
} label: {
HStack(spacing: 6) {
+ if let picture = image?(selection) {
+ picture.resizable().scaledToFit().frame(width: 16, height: 16)
+ }
Text(options.first { $0.id == selection }?.label ?? "Choose").lineLimit(1)
Image(systemName: "chevron.down").font(.caption2.weight(.semibold)).foregroundStyle(Palette.secondary)
}
@@ -304,6 +322,18 @@ public struct SegmentedChoice<ID: Hashable>: View {
}
}
+/// How `CardSection` draws its group: filled (Settings style), or outlined on the page like Grok
+/// Bot's routine cards (the bot details sheet).
+public enum CardStyle: Sendable {
+ case filled, outlined
+}
+
+public extension EnvironmentValues {
+ @Entry var cardStyle: CardStyle = .filled
+ /// How many lines a row's note shows; the details sheet keeps long ones (skill descriptions) to two.
+ @Entry var noteLines: Int? = nil
+}
+
/// Grok Bot's page tabs: plain labels, the chosen one on a light capsule.
public struct TabChoice<ID: Hashable>: View {
@Binding var selection: ID
@@ -408,6 +438,7 @@ public struct CardSection<Content: View, Accessory: View>: View {
let content: Content
/// Trailing controls on the heading's line (add, refresh, clear).
let accessory: Accessory
+ @Environment(\.cardStyle) private var cardStyle
public init(_ title: String? = nil, footer: String? = nil, @ViewBuilder content: () -> Content,
@ViewBuilder accessory: () -> Accessory) {
@@ -434,7 +465,12 @@ public struct CardSection<Content: View, Accessory: View>: View {
_VariadicView.Tree(HairlineRows()) { content }
}
.frame(maxWidth: .infinity, alignment: .leading)
- .background(Palette.surface, in: RoundedRectangle(cornerRadius: 16, style: .continuous))
+ .background(cardStyle == .filled ? Palette.surface : .clear, in: RoundedRectangle(cornerRadius: 16, style: .continuous))
+ .overlay {
+ if cardStyle == .outlined {
+ RoundedRectangle(cornerRadius: 14, style: .continuous).strokeBorder(Palette.border)
+ }
+ }
if let footer {
Text(footer)
.font(.caption)
@@ -484,6 +520,7 @@ public struct ValueRow<Value: View>: View {
let label: String
let detail: String?
let value: Value
+ @Environment(\.noteLines) private var noteLines
public init(_ label: String, detail: String? = nil, @ViewBuilder value: () -> Value) {
self.label = label
@@ -505,6 +542,7 @@ public struct ValueRow<Value: View>: View {
Text(detail)
.font(.caption)
.foregroundStyle(Palette.secondary)
+ .lineLimit(noteLines)
.lineSpacing(2)
.fixedSize(horizontal: false, vertical: true)
}
@@ -594,5 +632,13 @@ extension View {
.padding(.vertical, 7)
.background(fill, in: RoundedRectangle(cornerRadius: 10, style: .continuous))
}
+
+ /// Grok Bot's list cards (routines, the computer switch): an outline on the page, no fill.
+ func outlinedCard(vertical: CGFloat = 12) -> some View {
+ padding(.horizontal, 14)
+ .padding(.vertical, vertical)
+ .frame(maxWidth: .infinity, alignment: .leading)
+ .overlay(RoundedRectangle(cornerRadius: 14, style: .continuous).strokeBorder(Palette.border))
+ }
}
diff --git a/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentIcon.swift b/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentIcon.swift
index 3a44f842..48c4b413 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentIcon.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Marketplace/AgentIcon.swift
@@ -41,6 +41,11 @@ public struct AgentIcon: View {
}
}
+ /// The logo alone, for places that take an `Image` (the system menu).
+ public static func image(registry: String?) -> Image {
+ if let name = registry.map({ "agent-\($0)" }), exists(name) { Image(name, bundle: .module) } else { Image(systemName: "terminal") }
+ }
+
private static func exists(_ name: String) -> Bool {
UIImage(named: name, in: .module, with: nil) != nil
}
diff --git a/apps/ios/Kit/Sources/CodyncUI/Routines/RoutinesView.swift b/apps/ios/Kit/Sources/CodyncUI/Routines/RoutinesView.swift
index a973391c..618eb3ff 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Routines/RoutinesView.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Routines/RoutinesView.swift
@@ -70,18 +70,13 @@ struct RoutinesView: View {
.lineSpacing(3)
.foregroundStyle(Palette.secondary)
.fixedSize(horizontal: false, vertical: true)
- .frame(maxWidth: .infinity, alignment: .leading)
- .padding(14)
- .background(Palette.surface, in: RoundedRectangle(cornerRadius: 16, style: .continuous))
+ .outlinedCard(vertical: 14)
} else {
- VStack(spacing: 0) {
+ VStack(spacing: 8) {
ForEach(routines) { routine in
- if routine.id != routines.first?.id { Hairline() }
- row(routine)
+ row(routine).outlinedCard(vertical: 0)
}
}
- .padding(.horizontal, 14)
- .background(Palette.surface, in: RoundedRectangle(cornerRadius: 16, style: .continuous))
}
}
}
diff --git a/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Actions.swift b/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Actions.swift
index 10690be3..f5f9189f 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Actions.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Actions.swift
@@ -175,6 +175,14 @@ extension BotStore {
perform(replay: true) { _ = try await $0.updateBot(d) }
}
+ /// Whether the bot may see and use the computer's screen.
+ public func setComputer(_ bot: Bot, _ computer: Bool) {
+ var d = BotDraft(bot)
+ d.computer = computer
+ bots[bot.id]?.computer = computer
+ perform(replay: true) { _ = try await $0.updateBot(d) }
+ }
+
/// Whether the bot uses the memory all bots share.
public func setSharedMemory(_ bot: Bot, _ shared: Bool) {
var d = BotDraft(bot)
diff --git a/docs/design/ui-conventions.md b/docs/design/ui-conventions.md
index d2f0a76f..4aa2c6bf 100644
--- a/docs/design/ui-conventions.md
+++ b/docs/design/ui-conventions.md
@@ -94,7 +94,7 @@ Desktop conversations start with the details inspector closed; the title menu op
Preserve the original character avatar design: dotted shading, highlight-only color, silhouettes and animation. Desktop roster avatars remain 30 points and iPhone roster avatars remain 46 points. iPhone shares readable secondary text and message previews; its native navigation remains platform-specific. Terminal avatars already use solid color and the terminal has no persistent details inspector; its secondary text uses the same readable palette.
-The details inspector (`apps/desktop/src/renderer/views/thread/DetailsPanel.tsx`) copies Grok Bot's: share (Create template) and close (X) as round buttons in the corner, in the page color with a soft ring; the bot's 60-point avatar, name and runtime centered on top; then page tabs (`TabChoice`: plain labels, the chosen one on a light capsule) for **Details**, **Memory** and **Settings**, all in one scroll. The chat's `<<` button (in the same ringed style) and the title pill open it. Details shows whether the bot may use the computer (On/Off, changed in Settings) and its Routines; Memory is the memory card, its sections in the same tabs and the add/more actions beside each layer's note; Settings is `BotSettingsForm` (Profile with the avatar row, Agent, Activity, Connectors, Skills), saved as you edit. A group shows its avatar, name, bot count and members instead of tabs. Use 16-point horizontal insets and 28-point section gaps; sections use the `CardSection` look: filled 16-point groups without borders, hairline-split rows, a note under each option. The iPhone's Details sheet (`BotDetailsView`, from the title menu's Details, Settings and Routines) has the same corner buttons, header, tabs and pages, and saves as you edit too.
+The details inspector (`apps/desktop/src/renderer/views/thread/DetailsPanel.tsx`) copies Grok Bot's: share (Create template) and close (X) as round buttons in the corner, in the page color with a soft ring, over a 54-point band that drags the window; the bot's 60-point avatar, name and runtime centered on top; then page tabs (`TabChoice`: plain labels, the chosen one on a light capsule) for **Details**, **Memory** and **Settings**, all in one scroll. The chat's `<<` button (in the same ringed style) and the title pill open it; hovering the pill shows a `>` after the name. Details holds what changes often: Instructions, Agent (the agent with its logo, its model and fast mode), the Use the computer switch and Routines (one card per routine); Settings holds the rest: Profile (avatar row, name), Workspace (computer, workspace, permissions), Activity, Connectors and Skills. Both are parts of `BotSettingsForm` (`part`), saved as you edit; the New bot and editor sheets show all of it. Memory is the memory card, its sections in the same tabs and the add/more actions beside each layer's note. Every group in the panel is Grok Bot's outlined card (an outline on the page, no fill, inputs filled instead), a row with a note puts its control under the note, and long notes (skill descriptions, explanations, a note's description) stop at two lines with an ellipsis. A group shows its avatar, name, bot count and members instead of tabs. Use 16-point horizontal insets and 28-point section gaps; sections use the `CardSection` look: filled 16-point groups without borders, hairline-split rows, a note under each option. The iPhone's Details sheet (`BotDetailsView`, from the title menu's Details, Settings and Routines) has the same corner buttons, header, tabs, pages, outlined cards (`cardStyle`) and two-line notes (`noteLines`), and saves as you edit too.
Routines are a compact grouped list: name, a one-line schedule (or the live run state), and an on/off switch per row; tapping a row opens the same form as +, filled in, with delete and test run beside Save. On the desktop the form card fits its content. The header's chat button asks the bot (puts "I want a routine that " in the composer); + opens the form, where When to run is a type choice and cron is typed directly. The empty state is one line of text. A saved webhook routine's form shows the public URL and key as filled monospaced rows with copy, show/hide and replace-key (confirmed) icon buttons, and one caption on how to send and that deliveries pass through the Codync cloud. Agent metadata uses Runtime and Workspace labels for personal bots, or Project folder for explicitly configured projects; project paths remain selectable and wrap. Personal workspace paths stay out of the default details UI. Keep status and section headings readable in both appearances through `Palette`.
@@ -149,8 +149,8 @@ and states.
[bot collaboration](../features/bot-collaboration.md#notice-data).
- TUI bot settings include **Use computer**, matching the iPhone and desktop apps. The
remote-screen viewer and voice-call UI are not in the TUI.
-- A bot's pages in the TUI match the inspector's tabs: `R` opens Details (Use the computer
- On/Off, then Routines), `M` Memory and `e` Settings, each with the Details / Memory / Settings
+- A bot's pages in the TUI match the inspector's tabs: `R` opens Details (the agent, model and first line of the instructions, which `i` edits in
+ Settings; Use the computer, which `u` switches; then Routines), `M` Memory and `e` Settings, each with the Details / Memory / Settings
line on top; ⇧← ⇧→ moves between them. Settings with unsaved edits asks for ^S (or Esc) first.
### Verification
diff --git a/host/src/tui/manage/routines.rs b/host/src/tui/manage/routines.rs
index cdfc3d0f..1e6b2771 100644
--- a/host/src/tui/manage/routines.rs
+++ b/host/src/tui/manage/routines.rs
@@ -4,7 +4,7 @@ use crossterm::event::{KeyCode, KeyEvent};
use serde_json::{Value, json};
use std::str::FromStr as _;
-use super::super::app::{App, Confirm, ConfirmAct, Editor, Focus, Overlay};
+use super::super::app::{After, App, Confirm, ConfirmAct, Editor, FIELDS, Field, Focus, Overlay};
use super::{Page, Reply, RoutineField, RoutineForm, RoutineList, ctrl, newline, s};
impl App {
@@ -28,6 +28,19 @@ impl App {
let bot = l.bot.clone();
match (k.code, current) {
(KeyCode::Esc | KeyCode::Char('q' | 'R'), _) => return None,
+ // The agent, model and instructions shown above the routines are edited in Settings.
+ (KeyCode::Char('i'), _) => {
+ self.open_page(Page::Settings);
+ if let Some(Overlay::Form(f)) = self.overlays.last_mut() {
+ f.field = FIELDS.iter().position(|x| *x == Field::Instructions).unwrap_or(0);
+ }
+ return None;
+ }
+ // Use the computer, on the Details page above the routines.
+ (KeyCode::Char('u'), _) if !self.screen.is_null() => {
+ let on = self.bots.get(&bot).is_some_and(|b| b.computer);
+ self.call("updateBot", json!({"id": bot, "computer": !on}), After::Nothing);
+ }
(KeyCode::Down | KeyCode::Char('j'), _) => l.cursor = (l.cursor + 1).min(n.saturating_sub(1)),
(KeyCode::Up | KeyCode::Char('k'), _) => l.cursor = l.cursor.saturating_sub(1),
(KeyCode::Char('n'), _) => {
diff --git a/host/src/tui/sheets.rs b/host/src/tui/sheets.rs
index 12807589..25cc1dfc 100644
--- a/host/src/tui/sheets.rs
+++ b/host/src/tui/sheets.rs
@@ -73,10 +73,27 @@ pub fn routines(buf: &mut Buffer, area: Rect, app: &App, l: &RoutineList) {
let title = name_of(app, &l.bot);
let inner = frame_box(buf, r, t.text, t.panel, Some((&title, t.text)));
let mut inner = page_tabs(buf, inner, Page::Details);
+ // What changes often: the agent, its model and the instructions (`i` edits them in Settings).
+ if let Some(b) = app.bots.get(&l.bot).filter(|b| !b.group) {
+ let agent = app
+ .backends
+ .iter()
+ .find(|x| x["id"].as_str() == Some(b.backend.as_str()))
+ .map_or(&*b.backend, |x| s(x, "name"));
+ let model = b.model.as_deref().unwrap_or("default model");
+ let fast = if b.fast_mode { " · fast" } else { "" };
+ put(buf, inner.x, inner.y, inner.width, &format!("{agent} · {model}{fast}"), t.text.patch(t.panel));
+ rput(buf, inner.right(), inner.y, "i edits", t.dim.patch(t.panel));
+ let first = b.description.lines().find(|l| !l.trim().is_empty()).unwrap_or("No standing instructions");
+ let room = usize::from(inner.width);
+ put(buf, inner.x, inner.y + 1, inner.width, &truncate(first.trim(), room), t.secondary.patch(t.panel));
+ inner = Rect::new(inner.x, inner.y + 3, inner.width, inner.height.saturating_sub(3));
+ }
if !app.screen.is_null() {
let on = app.bots.get(&l.bot).is_some_and(|b| b.computer);
put(buf, inner.x, inner.y, inner.width, "Use the computer", t.text.patch(t.panel));
- rput(buf, inner.right(), inner.y, if on { "On" } else { "Off" }, t.secondary.patch(t.panel));
+ let x = rput(buf, inner.right(), inner.y, " u switches", t.dim.patch(t.panel));
+ rput(buf, x, inner.y, if on { "◉ On" } else { "○ Off" }, if on { t.text } else { t.secondary }.patch(t.panel));
inner = Rect::new(inner.x, inner.y + 2, inner.width, inner.height.saturating_sub(2));
}
put(buf, inner.x, inner.y, inner.width, "Routines", t.bold.patch(t.panel));