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
feat: show a bot's details as one page with Details, Memory and Settings tabs
leepokai208d931b7459
diff --git a/apps/desktop/src/renderer/components/Controls.tsx b/apps/desktop/src/renderer/components/Controls.tsxindex cd1b3047..15d07d9b 100644--- a/apps/desktop/src/renderer/components/Controls.tsx+++ b/apps/desktop/src/renderer/components/Controls.tsx@@ -101,6 +101,19 @@ export function SegmentedChoice<T extends string>({ selection, options, onChange)}+/** Grok Bot's page tabs: plain labels, the chosen one on a light capsule. */+export function TabChoice<T extends string>({ label, selection, options, onChange }: { label: string; selection: T; options: { id: T; label: string }[]; onChange: (id: T) => void }) {+ return (+ <div className="tab-choice" role="tablist" aria-label={label}>+ {options.map((o) => (+ <button key={o.id} role="tab" aria-selected={o.id === selection} className={`tab-choice-option ${o.id === selection ? 'on' : ''}`} onClick={() => onChange(o.id)}>+ {o.label}+ </button>+ ))}+ </div>+ )+}+/** 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 (@@ -137,9 +150,9 @@ export function CardSection({ title, footer, accessory, children }: { title?: stconst rows = Children.toArray(children)return (<section className="card-section">- {title ? (+ {title || accessory ? (<div className="card-section-title">- <span style={{ ...font(13, 'semibold'), color: 'var(--text)' }}>{title}</span>+ {title ? <span style={{ ...font(13, 'semibold'), color: 'var(--text)' }}>{title}</span> : null}<span style={{ flex: 1 }} />{accessory}</div>diff --git a/apps/desktop/src/renderer/components/controls.css b/apps/desktop/src/renderer/components/controls.cssindex 9818ed9b..18af8eb1 100644--- a/apps/desktop/src/renderer/components/controls.css+++ b/apps/desktop/src/renderer/components/controls.css@@ -132,6 +132,28 @@color: var(--text);}+.tab-choice {+ display: flex;+ justify-content: center;+ gap: 2px;+}+.tab-choice-option {+ height: calc(24px * var(--scale));+ padding: 0 calc(10px * var(--scale));+ border-radius: 999px;+ font-size: calc(13px * var(--scale));+ color: var(--secondary);+ white-space: nowrap;+ transition: background-color var(--hover), color var(--hover);+}+.tab-choice-option:hover {+ color: var(--text);+}+.tab-choice-option.on {+ background: var(--chat-button);+ color: var(--text);+}+.choice-row {display: flex;align-items: center;diff --git a/apps/desktop/src/renderer/views/bots/BotEditorView.tsx b/apps/desktop/src/renderer/views/bots/BotEditorView.tsxindex 1395ac4b..9775781c 100644--- a/apps/desktop/src/renderer/views/bots/BotEditorView.tsx+++ b/apps/desktop/src/renderer/views/bots/BotEditorView.tsx@@ -13,7 +13,6 @@ import { AgentModelPicker } from './AgentModelPicker'import { errorText, fillDefaults, isValid, lastPathComponent, normalized, usePlugins, type Plugins } from './drafts'import { FormSheet } from '../marketplace/pieces'import { SkillSheet, type SkillRef } from '../marketplace/SkillSheet'-import { MemoryCard } from './MemoryView'import { AnchoredPanel, AutoTextArea, Field, SwitchRow } from './parts'import './bots.css'@@ -90,7 +89,7 @@ export function BotSettingsPanel({ botId }: { botId: string }) {return draft ? <BotSettingsForm draft={draft} onChange={change} error={error} plugins={plugins} /> : null}-/** Bot settings: a big avatar (Grok Bot's), then sections in the Settings style (`CardSection`). */+/** Bot settings, in sections in the Settings style (`CardSection`). */function BotSettingsForm({ draft, onChange, error, plugins }: {draft: BotDraftonChange: (update: (d: BotDraft) => BotDraft) => void@@ -117,18 +116,17 @@ function BotSettingsForm({ draft, onChange, error, plugins }: {return (<div className="bot-form"><div className="bot-form-content">- <div style={{ display: 'flex', justifyContent: 'center' }}>- <button ref={avatarRef} className="avatar-button" title="Edit Bot avatar" aria-label="Edit Bot avatar" onClick={() => setPickingAvatar((p) => !p)}>- <CharacterAvatar shape={draft.avatarShape} color={draft.avatarColor} size={56} />- </button>- <AnchoredPanel open={pickingAvatar} onClose={() => setPickingAvatar(false)} anchor={avatarRef}>- <div style={{ padding: 14, width: 300 }}>- <AvatarPicker shape={draft.avatarShape} color={draft.avatarColor} onShape={(s) => set('avatarShape', s)} onColor={(c) => set('avatarColor', c)} />- </div>- </AnchoredPanel>- </div>-<CardSection title="Profile">+ <ValueRow label="Avatar">+ <button ref={avatarRef} className="avatar-button small" title="Edit Bot avatar" aria-label="Edit Bot avatar" onClick={() => setPickingAvatar((p) => !p)}>+ <CharacterAvatar shape={draft.avatarShape} color={draft.avatarColor} size={24} />+ </button>+ <AnchoredPanel open={pickingAvatar} onClose={() => setPickingAvatar(false)} anchor={avatarRef}>+ <div style={{ padding: 14, width: 300 }}>+ <AvatarPicker shape={draft.avatarShape} color={draft.avatarColor} onShape={(s) => set('avatarShape', s)} onColor={(c) => set('avatarColor', c)} />+ </div>+ </AnchoredPanel>+ </ValueRow>{/* A new bot is named from its first conversations (Grok Bot's flow); rename it any time after. */}{draft.id ? (<Field label="Name">@@ -251,8 +249,6 @@ function BotSettingsForm({ draft, onChange, error, plugins }: {onChange={(ids) => set('skills', ids)}onInfo={(s) => setViewingSkill({ id: s.id, name: s.name, description: s.detail })}/>- {draft.id ? <MemoryCard botId={draft.id} /> : null}-{error ? <span className="fade-in" style={{ ...font('footnote'), color: 'var(--danger)' }}>{error}</span> : null}</div><FormSheet open={viewingSkill !== null} onClose={() => setViewingSkill(null)}>diff --git a/apps/desktop/src/renderer/views/bots/MemoryView.tsx b/apps/desktop/src/renderer/views/bots/MemoryView.tsxindex 4f9bf33b..8859a291 100644--- a/apps/desktop/src/renderer/views/bots/MemoryView.tsx+++ b/apps/desktop/src/renderer/views/bots/MemoryView.tsx@@ -1,5 +1,5 @@import { useEffect, useMemo, useState } from 'react'-import { Button, CardSection, DropdownMenu, IconButton, SegmentedChoice, Switch } from '../../components/Controls'+import { Button, CardSection, DropdownMenu, IconButton, Switch, TabChoice } from '../../components/Controls'import { Icon } from '../../components/Icon'import { Dialog, ModalHeader, Sheet } from '../../components/Overlay'import { useModel } from '../../lib/observable'@@ -35,49 +35,54 @@ export function MemoryCard({ botId }: { botId: string }) {}return <>- <CardSection title="Memory" accessory={layer ? <div className="memory-header-actions">- <IconButton title="Add memory" icon="plus" onClick={() => setDraft({ text: '' })} disabled={memory.busy} />- <DropdownMenu className="icon-button memory-menu" title="More" items={() => [- { title: 'Refresh', icon: 'arrow.clockwise', action: () => void memory.load() },- { title: 'Forget everything here', icon: 'trash', destructive: true, divider: true, action: () => setConfirmClear(true) },- ]}><Icon name="ellipsis" size={14} weight="medium" /></DropdownMenu>- </div> : null}>- <SegmentedChoice selection={section} options={sections} onChange={setSection} />- {memory.error && <p role="alert" className="memory-error">{memory.error}</p>}- {!view && !memory.error && <p className="memory-muted">Loading memory…</p>}- {view && bot && section === 'yours' && <Switch on={bot.sharedMemory} disabled={memory.busy} onChange={(on) => host.setSharedMemory(bot, on)}>- Use what your bots share- </Switch>}- {layer && [- <p key="note" className="memory-muted">{section === 'yours'- ? 'Your name, time zone, people and lasting preferences, shared by your bots.'- : 'What this bot learned about you.'} {layer.used} of {layer.cap} in use.</p>,- ...(layer.entries.length ? [] : [<div key="empty" className="memory-empty">- <Icon name="brain" size={20} color="var(--tertiary)" />- <span>{section === 'yours' ? 'Nothing shared yet.' : 'Nothing yet. What this bot learns about you shows up here, and you can change any of it.'}</span>- </div>]),- ...layer.entries.map((entry) => <EntryRow key={entry.id} entry={entry} memory={memory} edit={() => setDraft({ id: entry.id, text: entry.text })} />),- ...(view?.files ? fileRows(memory, view.files, section === 'yours', setFile) : []),- ]}- {view && section === 'dreams' && [- <p key="note" className="memory-muted">Between chats the bot tidies its memory from your own words. Each run can be undone.</p>,- ...(view.dreams.length ? [] : [<div key="empty" className="memory-empty"><Icon name="moon" size={20} color="var(--tertiary)" /><span>No dreams yet.</span></div>]),- ...view.dreams.map((dream) => <div className="memory-item fade-in" key={dream.id}>- <div className="memory-content">- <strong>{relativeTime.day(dream.at)}{dream.undone ? ' · undone' : ''}</strong>- {dream.added.map((c) => <span key={`a${c.id}`}>+ {c.text}</span>)}- {dream.archived.map((c) => <span key={`r${c.id}`} className="memory-archived">− {c.text}</span>)}- {(dream.files ?? []).map((f) => <span key={`f${f.version}`} className="memory-muted">Added to {f.name}</span>)}- </div>- {!dream.undone && <IconButton title="Undo this dream" icon="arrow.uturn.backward" disabled={memory.busy} onClick={() => void memory.mutate('undoDream', { id: dream.id })} />}- </div>),- ]}- {view?.projectMemory && section === 'project' && <div className="memory-content">- <p className="memory-muted">The project folder's own notes, kept by Claude Code. Read-only here.</p>- <small className="memory-muted">{view.projectMemory.path}</small>- <pre className="memory-history">{view.projectMemory.text}</pre>- </div>}- </CardSection>+ <div className="memory-panel">+ <TabChoice label="Memory" selection={section} options={sections} onChange={setSection} />+ <CardSection>+ {memory.error && <p role="alert" className="memory-error">{memory.error}</p>}+ {!view && !memory.error && <p className="memory-muted">Loading memory…</p>}+ {view && bot && section === 'yours' && <Switch on={bot.sharedMemory} disabled={memory.busy} onChange={(on) => host.setSharedMemory(bot, on)}>+ Use what your bots share+ </Switch>}+ {layer && [+ <div key="note" className="memory-layer-note">+ <p className="memory-muted">{section === 'yours'+ ? 'Your name, time zone, people and lasting preferences, shared by your bots.'+ : 'What this bot learned about you.'} {layer.used} of {layer.cap} in use.</p>+ <div className="memory-header-actions">+ <IconButton title="Add memory" icon="plus" onClick={() => setDraft({ text: '' })} disabled={memory.busy} />+ <DropdownMenu className="icon-button memory-menu" title="More" items={() => [+ { title: 'Refresh', icon: 'arrow.clockwise', action: () => void memory.load() },+ { title: 'Forget everything here', icon: 'trash', destructive: true, divider: true, action: () => setConfirmClear(true) },+ ]}><Icon name="ellipsis" size={14} weight="medium" /></DropdownMenu>+ </div>+ </div>,+ ...(layer.entries.length ? [] : [<div key="empty" className="memory-empty">+ <Icon name="brain" size={20} color="var(--tertiary)" />+ <span>{section === 'yours' ? 'Nothing shared yet.' : 'Nothing yet. What this bot learns about you shows up here, and you can change any of it.'}</span>+ </div>]),+ ...layer.entries.map((entry) => <EntryRow key={entry.id} entry={entry} memory={memory} edit={() => setDraft({ id: entry.id, text: entry.text })} />),+ ...(view?.files ? fileRows(memory, view.files, section === 'yours', setFile) : []),+ ]}+ {view && section === 'dreams' && [+ <p key="note" className="memory-muted">Between chats the bot tidies its memory from your own words. Each run can be undone.</p>,+ ...(view.dreams.length ? [] : [<div key="empty" className="memory-empty"><Icon name="moon" size={20} color="var(--tertiary)" /><span>No dreams yet.</span></div>]),+ ...view.dreams.map((dream) => <div className="memory-item fade-in" key={dream.id}>+ <div className="memory-content">+ <strong>{relativeTime.day(dream.at)}{dream.undone ? ' · undone' : ''}</strong>+ {dream.added.map((c) => <span key={`a${c.id}`}>+ {c.text}</span>)}+ {dream.archived.map((c) => <span key={`r${c.id}`} className="memory-archived">− {c.text}</span>)}+ {(dream.files ?? []).map((f) => <span key={`f${f.version}`} className="memory-muted">Added to {f.name}</span>)}+ </div>+ {!dream.undone && <IconButton title="Undo this dream" icon="arrow.uturn.backward" disabled={memory.busy} onClick={() => void memory.mutate('undoDream', { id: dream.id })} />}+ </div>),+ ]}+ {view?.projectMemory && section === 'project' && <div className="memory-content">+ <p className="memory-muted">The project folder's own notes, kept by Claude Code. Read-only here.</p>+ <small className="memory-muted">{view.projectMemory.path}</small>+ <pre className="memory-history">{view.projectMemory.text}</pre>+ </div>}+ </CardSection>+ </div><Sheet open={draft !== null} onClose={() => setDraft(null)} width={520}><ModalHeader title={draft?.id ? 'Edit memory' : section === 'yours' ? 'Add to what your bots share' : 'Add memory'} />{draft && <div className="memory-editor">diff --git a/apps/desktop/src/renderer/views/bots/bots.css b/apps/desktop/src/renderer/views/bots/bots.cssindex ac7c1294..615dafeb 100644--- a/apps/desktop/src/renderer/views/bots/bots.css+++ b/apps/desktop/src/renderer/views/bots/bots.css@@ -34,6 +34,10 @@ textarea.field-box {border-radius: 20px;display: flex;}+.avatar-button.small {+ padding: 5px;+ border-radius: 10px;+}/* A selectable avatar shape or color, ringed when chosen. */.swatch {diff --git a/apps/desktop/src/renderer/views/bots/memory.css b/apps/desktop/src/renderer/views/bots/memory.cssindex 18c9e562..d1bcc892 100644--- a/apps/desktop/src/renderer/views/bots/memory.css+++ b/apps/desktop/src/renderer/views/bots/memory.css@@ -1,3 +1,7 @@+.memory-panel { display: flex; flex-direction: column; gap: 10px; }+.memory-panel > .tab-choice { flex-wrap: wrap; }+.memory-layer-note { display: flex; align-items: flex-start; gap: 8px; }+.memory-layer-note > p { flex: 1; min-width: 0; }.memory-header-actions { display: flex; align-items: center; gap: 2px; }.memory-menu { width: 28px; height: 28px; border-radius: 8px; }.memory-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 12px; text-align: center; color: var(--secondary); line-height: 1.45; }diff --git a/apps/desktop/src/renderer/views/thread/DetailsPanel.tsx b/apps/desktop/src/renderer/views/thread/DetailsPanel.tsxindex 53f61628..37b5fc16 100644--- a/apps/desktop/src/renderer/views/thread/DetailsPanel.tsx+++ b/apps/desktop/src/renderer/views/thread/DetailsPanel.tsx@@ -1,102 +1,109 @@-import { useState, type ReactNode } from 'react'-import { folderName, isGroup, isWorking, type Bot } from '@shared/models'+import { isGroup, isWorking, type Bot } from '@shared/models'import { AgentIcon } from '../../components/AgentIcon'-import { BotAvatar } from '../../components/Avatar'-import { CardSection, IconButton } from '../../components/Controls'+import { BotAvatar, GroupAvatar } from '../../components/Avatar'+import { CardSection, IconButton, TabChoice, ValueRow } from '../../components/Controls'import { Icon } from '../../components/Icon'import { font } from '../../lib/fonts'import { useStore } from '../../store/context'import { BotSettingsPanel } from '../bots/BotEditorView'-import { ComputerBadge } from '../ComputerBadge'+import { MemoryCard } from '../bots/MemoryView'import { RoutinesView } from '../routines/RoutinesView'import { MacChatButton } from './MacChatButton'import '../bots/bots.css'+import './details-panel.css'-const isMac = window.codync.platform === 'darwin'+export type DetailsTab = 'details' | 'memory' | 'settings'-/** The inspector beside a conversation: the computer, the agent, and the bot's settings. */-export function DetailsPanel({ botId, routineId, editing, setEditing, editGroup, share, close }: {+const TABS: { id: DetailsTab; label: string }[] = [+ { id: 'details', label: 'Details' },+ { id: 'memory', label: 'Memory' },+ { id: 'settings', label: 'Settings' },+]++/** The inspector beside a conversation (Grok Bot's): who the bot is, then its details, memory and settings. */+export function DetailsPanel({ botId, routineId, tab, setTab, editGroup, share, close }: {botId: stringroutineId: string | null- editing: boolean- setEditing: (on: boolean) => void+ tab: DetailsTab+ setTab: (tab: DetailsTab) => voideditGroup: () => voidshare: () => voidclose: () => void}) {const store = useStore()const bot = store.bots.get(botId) ?? null- const [returnedFromSettings, setReturnedFromSettings] = useState(false)- let header: ReactNode- if (editing) {- header = (- <>- <RoundButton label="Back to details" symbol="chevron.left" action={() => {- setReturnedFromSettings(true)- setEditing(false)- }} />- <PanelTitle>Settings</PanelTitle>- <span style={{ flex: 1 }} />- </>- )- } else if (bot && isGroup(bot)) {- header = (- <>- <PanelTitle>Members</PanelTitle>- <span style={{ ...font(13), color: 'var(--tertiary)', flex: 1 }}>{bot.members.length}</span>- </>- )- } else {- header = (- <>- <PanelTitle>Details</PanelTitle>- <span style={{ flex: 1 }} />- <RoundButton label="Create template" symbol="square.and.arrow.up" action={share} />- <RoundButton label="Bot settings" symbol="gearshape" action={() => setEditing(true)} />- </>- )- }+ const group = !!bot && isGroup(bot)return (- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' }}>- <div style={{ display: 'flex', alignItems: 'center', gap: 8, height: 54, padding: '0 12px', flex: 'none' }}>- {header}- <RoundButton label="Close details" symbol="chevron.right.2" action={close} />+ <div className="details-panel">+ <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} /></div>- <div style={{ flex: 1, minHeight: 0, position: 'relative', overflow: 'hidden' }}>- {bot && isGroup(bot) ? (+ <div className="details-scroll">+ {bot ? <Identity bot={bot} /> : null}+ {bot && group ? (<GroupMembersList group={bot} editGroup={editGroup} />- ) : editing ? (- <div className="panel-slide from-trailing" style={{ height: '100%' }}>- <BotSettingsPanel botId={botId} />- </div>) : (- <div className={returnedFromSettings ? 'panel-slide from-leading' : undefined} style={{ height: '100%', overflowY: 'auto' }}>- <div style={{ display: 'flex', flexDirection: 'column', gap: 28, padding: '4px 16px 24px' }}>- <ComputerSummary botId={botId} />- <RoutinesView botId={botId} initialId={routineId} />- {bot ? <AgentSummary bot={bot} /> : null}+ <>+ <TabChoice label="Conversation details" selection={tab} options={TABS} onChange={setTab} />+ <div key={tab} className="details-tab fade-in">+ {tab === 'details' ? (+ <>+ {bot ? <ComputerUse bot={bot} /> : null}+ <RoutinesView botId={botId} initialId={routineId} />+ </>+ ) : tab === 'memory' ? (+ <MemoryCard botId={botId} />+ ) : (+ <BotSettingsPanel botId={botId} />+ )}</div>- </div>+ </>)}</div></div>)}-function PanelTitle({ children }: { children: ReactNode }) {- return <span style={{ ...font(15, 'semibold'), color: 'var(--text)', paddingLeft: 4 }}>{children}</span>+/** The bot's avatar and name, and what runs it (a group: how many bots it has). */+function Identity({ bot }: { bot: Bot }) {+ const store = useStore()+ const group = isGroup(bot)+ return (+ <div className="details-identity">+ {group ? <GroupAvatar members={store.members(bot)} size={60} /> : <BotAvatar bot={bot} size={60} />}+ <span className="details-name">{bot.name}</span>+ <span className="details-subtitle">+ {group ? (+ `${bot.members.length} ${bot.members.length === 1 ? 'bot' : 'bots'}`+ ) : (+ <>+ <AgentIcon registry={store.hello?.backends.find((b) => b.id === bot.backend)?.registry ?? bot.backend} size={12} />+ {store.backendName(bot.backend)}+ {bot.model ? ` · ${bot.model}` : null}+ </>+ )}+ </span>+ </div>+ )}-/** A single circular surface, shared with the floating transcript controls. */-function RoundButton({ label, symbol, action }: { label: string; symbol: string; action: () => void }) {- return <MacChatButton title={label} icon={symbol} direction={symbol === 'chevron.right.2' ? [1, 0] : [0, 0]} onClick={action} />+/** Whether this bot may use the computer; it's changed in Settings. */+function ComputerUse({ bot }: { bot: Bot }) {+ const store = useStore()+ if (!store.screen) return null+ return (+ <CardSection title="Computer">+ <ValueRow label="Use the computer">{bot.computer ? 'On' : 'Off'}</ValueRow>+ </CardSection>+ )}/** A group's bots (Grok Bot's member list); clicking one opens its own chat. */function GroupMembersList({ group, editGroup }: { group: Bot; editGroup: () => void }) {const store = useStore()return (- <div style={{ height: '100%', overflowY: 'auto', padding: '0 20px' }}>+ <div className="details-members">{store.members(group).map((bot) => (<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)}>@@ -118,65 +125,3 @@ function GroupMembersList({ group, editGroup }: { group: Bot; editGroup: () => v</div>)}--function ComputerSummary({ botId }: { botId: string }) {- const store = useStore()- const screen = store.screen- const ready = !store.isOffline && !!screen?.enabled && screen.connected && screen.capture- const symbol = !screen?.enabled ? 'power' : !screen.connected ? 'arrow.triangle.2.circlepath' : !screen.capture ? 'exclamationmark.circle' : screen.agentBot === botId ? 'cursorarrow.motionlines' : 'checkmark.circle'- const status = !screen?.enabled- ? 'Remote screen is off'- : !screen.connected- ? 'Connecting to computer…'- : !screen.capture- ? 'Screen recording permission needed'- : screen.agentBot === botId- ? `This bot is using your ${isMac ? 'Mac' : 'computer'}`- : 'Ready to connect'- return (- <div style={{ display: 'flex', flexDirection: 'column', gap: 16, padding: 16, background: 'var(--surface)', borderRadius: 16 }}>- <div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>- <ComputerBadge computer={store.computer} size={32} />- <div style={{ display: 'flex', flexDirection: 'column', gap: 4, minWidth: 0 }}>- <span style={{ ...font(15, 'medium'), color: 'var(--text)', overflow: 'hidden', display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical' }}>{store.hostName}</span>- <span style={{ ...font(13), color: 'var(--secondary)' }}>Remote screen</span>- </div>- </div>- {!store.isOffline ? (- <span style={{ display: 'flex', alignItems: 'center', gap: 6, ...font(13), color: 'var(--text)' }}>- <Icon name={symbol} size={13} />- {status}- </span>- ) : null}- {ready ? <div style={{ ...font(12), color: 'var(--secondary)', marginTop: -8 }}>View and control this {isMac ? 'Mac' : 'computer'} from your iPhone.</div> : null}- </div>- )-}--function InfoRow({ label, children, title }: { label: string; children: ReactNode; title?: string }) {- return (- <div style={{ display: 'flex', alignItems: 'center', gap: 12, ...font(13) }}>- <span style={{ color: 'var(--secondary)' }}>{label}</span>- <span style={{ flex: 1, minWidth: 8 }} />- <span title={title} style={{ color: 'var(--text)', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', display: 'flex', alignItems: 'center', gap: 6, minWidth: 0 }}>- {children}- </span>- </div>- )-}--function AgentSummary({ bot }: { bot: Bot }) {- const store = useStore()- return (- <CardSection title="Agent" footer={bot.description || null}>- <InfoRow label="Runtime">- <AgentIcon registry={store.hello?.backends.find((b) => b.id === bot.backend)?.registry ?? bot.backend} size={14} />- <span>{store.backendName(bot.backend)}</span>- </InfoRow>- <InfoRow label={bot.managedWorkspace ? 'Workspace' : 'Folder'} title={bot.managedWorkspace ? 'Personal workspace, managed by Codync' : bot.cwd}>- {bot.managedWorkspace ? 'Personal' : folderName(bot)}- </InfoRow>- {bot.model ? <InfoRow label="Model">{bot.model}</InfoRow> : null}- </CardSection>- )-}diff --git a/apps/desktop/src/renderer/views/thread/ThreadView.tsx b/apps/desktop/src/renderer/views/thread/ThreadView.tsxindex 4cc1a462..dd83d04e 100644--- a/apps/desktop/src/renderer/views/thread/ThreadView.tsx+++ b/apps/desktop/src/renderer/views/thread/ThreadView.tsx@@ -12,7 +12,7 @@ import { BotConversationView, BotMessageRow } from './BotConversation'import { ChatRow, TimeSeparator, WorkingIndicator } from './ChatRows'import { Composer } from './Composer'import { ChatSidePanel } from './ChatSidePanel'-import { DetailsPanel } from './DetailsPanel'+import { DetailsPanel, type DetailsTab } from './DetailsPanel'import { RepliesView } from './RepliesView'import { TraceView } from './TraceView'import { useReading } from './reading'@@ -40,7 +40,7 @@ export function ThreadView({ botId }: { botId: string }) {const [editingGroup, setEditingGroup] = useState(false)const [templateDraft, setTemplateDraft] = useState<BotDraft | null>(null)const [showSettings, setShowSettings] = useState(false)- const [editingDetails, setEditingDetails] = useState(false)+ const [detailsTab, setDetailsTab] = useState<DetailsTab>('details')const [compactDetails, setCompactDetails] = useState(false)const [calling, setCalling] = useState(false)const [callSpeaking, setCallSpeaking] = useState(false)@@ -97,7 +97,7 @@ export function ThreadView({ botId }: { botId: string }) {const presentRoutine = (id: string | null) => {setRoutineId(id)setRoutineRequest((r) => r + 1)- setEditingDetails(false)+ setDetailsTab('details')setOpenThread(null)setShowSettings(true)if (!wide) setCompactDetails(true)@@ -108,8 +108,8 @@ export function ThreadView({ botId }: { botId: string }) {key={routineRequest}botId={botId}routineId={routineId}- editing={editingDetails}- setEditing={setEditingDetails}+ tab={detailsTab}+ setTab={setDetailsTab}editGroup={() => setEditingGroup(true)}share={() => {setCompactDetails(false)@@ -130,7 +130,7 @@ export function ThreadView({ botId }: { botId: string }) {<div className="top-chrome-row"><span style={{ flex: 1 }} />{(!showSettings || openThread || !wide) && !compactDetails ? (- <MacChatButton title="Conversation details" icon="chevron.left.2" direction={[-1, 0]} onClick={toggleDetails} />+ <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. */}diff --git a/apps/desktop/src/renderer/views/thread/chat-controls.css b/apps/desktop/src/renderer/views/thread/chat-controls.cssindex 429e1e51..5039f445 100644--- a/apps/desktop/src/renderer/views/thread/chat-controls.css+++ b/apps/desktop/src/renderer/views/thread/chat-controls.css@@ -39,6 +39,12 @@.mac-chat-button:active > * {translate: calc(var(--dx) * 1.5px) calc(var(--dy) * 1.5px);}+/* Grok Bot's details buttons (open, share, close): the page color, ringed by a soft shadow. */+.mac-chat-button.ringed {+ background: var(--background);+ color: var(--text);+ box-shadow: 0 0 0 1px var(--chrome-stroke), 0 1px 2px rgba(0, 0, 0, 0.04);+}@media (prefers-reduced-motion: reduce) {.mac-chat-button:hover > *,.mac-chat-button:active > * {diff --git a/apps/desktop/src/renderer/views/thread/details-panel.css b/apps/desktop/src/renderer/views/thread/details-panel.cssnew file mode 100644index 00000000..a8b331e6--- /dev/null+++ b/apps/desktop/src/renderer/views/thread/details-panel.css@@ -0,0 +1,68 @@+/* The inspector beside a conversation, laid out like Grok Bot's: actions in the corner, the bot+ centered on top, page tabs under it, and one scroll for all of it. */+.details-panel {+ position: relative;+ height: 100%;+ background: var(--background);+}++.details-actions {+ position: absolute;+ top: 11px;+ right: 11px;+ z-index: 1;+ display: flex;+ gap: 8px;+}++.details-scroll {+ height: 100%;+ overflow-y: auto;+ display: flex;+ flex-direction: column;+ padding-bottom: 24px;+}++.details-identity {+ display: flex;+ flex-direction: column;+ align-items: center;+ padding: 62px 20px 18px;+ text-align: center;+}+.details-name {+ margin-top: 14px;+ font-size: calc(16px * var(--scale));+ font-weight: 600;+ color: var(--text);+ text-wrap: balance;+ overflow-wrap: anywhere;+}+.details-subtitle {+ margin-top: 4px;+ display: flex;+ align-items: center;+ gap: 5px;+ font-size: calc(12px * var(--scale));+ color: var(--secondary);+}++.details-tab {+ display: flex;+ flex-direction: column;+ gap: 28px;+ padding: 20px 16px 0;+}+/* The settings form scrolls with the panel, not on its own. */+.details-tab .bot-form {+ height: auto;+ overflow: visible;+ background: none;+}+.details-tab .bot-form-content {+ padding: 0;+}++.details-members {+ padding: 0 20px;+}diff --git a/apps/ios/Kit/Sources/CodyncUI/Bots/BotDetailsView.swift b/apps/ios/Kit/Sources/CodyncUI/Bots/BotDetailsView.swiftnew file mode 100644index 00000000..7fd8630d--- /dev/null+++ b/apps/ios/Kit/Sources/CodyncUI/Bots/BotDetailsView.swift@@ -0,0 +1,139 @@+import CodyncKit+import SwiftUI++/// The details sheet's pages, as on the desktop inspector.+enum DetailsTab: Hashable {+ case details, memory, settings+}++/// What to open the details sheet on.+struct DetailsRequest: Identifiable {+ let id = UUID()+ var tab: DetailsTab = .details+ /// A routine to open in its editor (Details page).+ var routineId: String?+}++/// A bot's details (Grok Bot's): who it is, then its details, memory and settings. Settings save+/// as you edit.+struct BotDetailsView: View {+ let botId: String+ let routineId: String?+ @State var tab: DetailsTab+ @Environment(BotStore.self) private var model+ @Environment(\.dismissModal) private var dismiss+ @State private var draft: BotDraft?+ @State private var saveError: String?+ @State private var saving: Task<Void, Never>?+ @State private var template: EditorRequest?++ init(botId: String, request: DetailsRequest) {+ self.botId = botId+ routineId = request.routineId+ _tab = State(initialValue: request.tab)+ }++ private var bot: Bot? { model.bots[botId] }++ var body: some View {+ ScrollView {+ VStack(spacing: 0) {+ if let bot { identity(bot) }+ TabChoice(selection: $tab, options: [(.details, "Details"), (.memory, "Memory"), (.settings, "Settings")])+ .padding(.top, 18)+ page.padding(.top, 20)+ }+ .padding(.horizontal, 20)+ .padding(.bottom, 24)+ }+ .scrollDismissesKeyboard(.interactively)+ .background(Palette.background)+ .overlay(alignment: .topTrailing) { actions }+ .task(id: botId) { draft = bot.map(BotDraft.init) }+ .onChange(of: draft) { _, draft in autosave(draft) }+ .codyncSheet(item: $template) { BotTemplateView(draft: $0.draft) }+ }++ private var actions: some View {+ HStack(spacing: 8) {+ if let bot {+ cornerButton("Create template", "square.and.arrow.up") { template = EditorRequest(BotDraft(bot)) }+ }+ cornerButton("Close details", "xmark") { dismiss() }+ }+ .padding(.top, 14)+ .padding(.trailing, 14)+ }++ /// Grok Bot's corner buttons: the page color, ringed by a soft shadow.+ private func cornerButton(_ title: String, _ symbol: String, action: @escaping () -> Void) -> some View {+ Button(action: action) {+ Image(systemName: symbol)+ .font(.system(size: 15, weight: .medium))+ .foregroundStyle(Palette.text)+ .frame(width: 36, height: 36)+ .background(Palette.background, in: Circle())+ .shadow(color: .black.opacity(0.12), radius: 0.5)+ .shadow(color: .black.opacity(0.04), radius: 2, y: 1)+ }+ .buttonStyle(.plain)+ .accessibilityLabel(title)+ .help(title)+ }++ /// The bot's avatar and name, and what runs it.+ private func identity(_ bot: Bot) -> some View {+ VStack(spacing: 4) {+ CharacterAvatar(bot: bot, size: 72)+ .padding(.bottom, 10)+ Text(bot.name)+ .font(.title3.weight(.semibold))+ .foregroundStyle(Palette.text)+ .multilineTextAlignment(.center)+ HStack(spacing: 5) {+ AgentIcon(registry: model.hello?.backends.first { $0.id == bot.backend }?.registry ?? bot.backend, size: 13)+ Text(bot.model.map { "\(model.backendName(bot.backend)) · \($0)" } ?? model.backendName(bot.backend))+ }+ .font(.footnote)+ .foregroundStyle(Palette.secondary)+ }+ .frame(maxWidth: .infinity)+ .padding(.top, 64)+ }++ @ViewBuilder private var page: some 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")+ }+ }+ RoutinesView(botId: botId, initialId: routineId) { dismiss() }+ }+ case .memory:+ MemoryCard(botId: botId)+ case .settings:+ if let draft = Binding($draft) {+ BotSettingsForm(draft: draft, error: saveError, scrolls: false)+ }+ }+ }++ /// Saves a moment after the last change, like the desktop inspector.+ private func autosave(_ draft: BotDraft?) {+ saving?.cancel()+ guard let draft, let bot, draft != BotDraft(bot), draft.isValid else { return }+ saving = Task {+ try? await Task.sleep(for: .milliseconds(600))+ guard !Task.isCancelled else { return }+ do {+ _ = try await model.save(draft.normalized)+ saveError = nil+ } catch {+ saveError = error.localizedDescription+ }+ }+ }+}diff --git a/apps/ios/Kit/Sources/CodyncUI/Bots/BotEditorView.swift b/apps/ios/Kit/Sources/CodyncUI/Bots/BotEditorView.swiftindex 66603288..154f709d 100644--- a/apps/ios/Kit/Sources/CodyncUI/Bots/BotEditorView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Bots/BotEditorView.swift@@ -73,153 +73,169 @@ public struct BotEditorView: View {}}-/// Bot settings: a big avatar (Grok Bot's), then sections in the Settings style (`CardSection`).+/// Bot settings, in sections in the Settings style (`CardSection`). `scrolls` is off where a+/// surrounding view scrolls (the details sheet).struct BotSettingsForm: View {@Binding var draft: BotDraftlet error: String?var computers: [(id: ComputerID, label: String)] = []var computer: Binding<ComputerID>?+ var scrolls = true@Environment(BotStore.self) private var model@Environment(\.accessibilityReduceMotion) private var reduceMotion@State private var pickingFolder = false+ @State private var pickingAvatar = false@State private var viewingSkill: SkillRef?var body: some View {- ScrollView {- VStack(alignment: .leading, spacing: 30) {- VStack(spacing: 16) {- CharacterAvatar(shape: draft.avatarShape, color: draft.avatarColor, size: 96)- .padding(18)- .background(Palette.bubbleAgent, in: RoundedRectangle(cornerRadius: 24, style: .continuous))- AvatarPicker(shape: $draft.avatarShape, color: $draft.avatarColor)- }- .frame(maxWidth: .infinity)+ Group {+ if scrolls {+ ScrollView { sections.padding(20) }+ .scrollDismissesKeyboard(.interactively)+ } else {+ sections+ }+ }+ .font(.body)+ .background(Palette.background)+ .task { await model.refreshPlugins() }+ .codyncSheet(item: $viewingSkill) { SkillSheet(skill: $0) }+ .codyncSheet(isPresented: $pickingFolder) {+ FolderPicker(start: draft.cwd.isEmpty ? model.hello?.home : draft.cwd) {+ draft.cwd = $0+ pickingFolder = false+ }+ }+ }- CardSection("Profile") {- // A new bot is named from its first conversations (Grok Bot's flow); rename it any time after.- if draft.id != nil {- Field("Name") {- TextField("Name", text: $draft.name).fieldBox()+ private var sections: some View {+ VStack(alignment: .leading, spacing: 30) {+ CardSection("Profile") {+ VStack(alignment: .leading, spacing: 12) {+ Button {+ withAnimation(Motion.reduced(Motion.layout, reduceMotion)) { pickingAvatar.toggle() }+ } label: {+ ValueRow("Avatar") {+ CharacterAvatar(shape: draft.avatarShape, color: draft.avatarColor, size: 28)+ .padding(5)+ .background(Palette.bubbleAgent, in: RoundedRectangle(cornerRadius: 10, style: .continuous))}+ .contentShape(Rectangle())}- 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()+ .buttonStyle(.plain)+ .accessibilityLabel("Edit Bot avatar")+ if pickingAvatar {+ AvatarPicker(shape: $draft.avatarShape, color: $draft.avatarColor)+ .transition(.opacity.combined(with: .move(edge: .top)))+ }+ }+ // A new bot is named from its first conversations (Grok Bot's flow); rename it any time after.+ if draft.id != nil {+ Field("Name") {+ 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()+ }+ }- CardSection("Agent") {- VStack(alignment: .leading, spacing: 6) {- ValueRow("Computer") {- if let computer {- ChoicePicker(selection: computer, options: computers, fitsAvailableWidth: true)- .accessibilityLabel("Computer")- } else {- Text(model.hostName).lineLimit(1)- }- }- if computer != nil, model.connection != .online {- Text("Connect this computer to create the bot, or choose another computer.")- .font(.caption).foregroundStyle(Palette.warning)+ CardSection("Agent") {+ VStack(alignment: .leading, spacing: 6) {+ ValueRow("Computer") {+ if let computer {+ ChoicePicker(selection: computer, options: computers, fitsAvailableWidth: true)+ .accessibilityLabel("Computer")+ } else {+ Text(model.hostName).lineLimit(1)}}- 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 computer != nil, model.connection != .online {+ Text("Connect this computer to create the bot, or choose another computer.")+ .font(.caption).foregroundStyle(Palette.warning)}- 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.") {- DropdownMenu {- [- MenuItem("Personal workspace", selected: draft.cwd.isEmpty) {- withAnimation(Motion.reduced(Motion.layout, reduceMotion)) { draft.cwd = "" }- },- MenuItem("Choose project folder…", selected: !draft.cwd.isEmpty) {- withAnimation(Motion.reduced(Motion.layout, reduceMotion)) { pickingFolder = true }- },- ]- } label: {- HStack(spacing: 6) {- Text(draft.cwd.isEmpty ? "Personal" : (draft.cwd as NSString).lastPathComponent).lineLimit(1)- Image(systemName: "chevron.down").font(.caption2.weight(.semibold)).foregroundStyle(Palette.secondary)- }- .foregroundStyle(Palette.text)- .outlinedPill()- }- .help(draft.cwd.isEmpty ? "A persistent workspace allocated for this bot" : draft.cwd)+ }+ 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")])}- ValueRow("Permissions", detail: draft.permission == "auto"- ? "Tool requests are approved automatically. Your agent's own settings (like Claude Code's permission rules) still apply."- : "You'll get an approval card and a notification whenever the agent asks.") {- ChoicePicker(selection: $draft.permission, options: [("ask", "Ask me"), ("auto", "Approve automatically")])+ 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()}}-- 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 {- 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- ? "Let this bot see the screen and use the mouse and keyboard. You can watch and take over from your phone."- : model.screen?.computerUse == true- ? "Let this bot see the screen and use the mouse and keyboard."- : "Let this bot see the screen and use the mouse and keyboard. On that computer, open Codync → Settings → Computer access to set up permissions first.",- isOn: Binding(get: { draft.computer ?? false }, set: { draft.computer = $0 }))+ 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.") {+ DropdownMenu {+ [+ MenuItem("Personal workspace", selected: draft.cwd.isEmpty) {+ withAnimation(Motion.reduced(Motion.layout, reduceMotion)) { draft.cwd = "" }+ },+ MenuItem("Choose project folder…", selected: !draft.cwd.isEmpty) {+ withAnimation(Motion.reduced(Motion.layout, reduceMotion)) { pickingFolder = true }+ },+ ]+ } label: {+ HStack(spacing: 6) {+ Text(draft.cwd.isEmpty ? "Personal" : (draft.cwd as NSString).lastPathComponent).lineLimit(1)+ Image(systemName: "chevron.down").font(.caption2.weight(.semibold)).foregroundStyle(Palette.secondary)+ }+ .foregroundStyle(Palette.text)+ .outlinedPill()}+ .help(draft.cwd.isEmpty ? "A persistent workspace allocated for this bot" : draft.cwd)}-- PluginToggles(- title: "Connectors",- empty: "No connectors yet. Add GitHub, Linear, Notion and more from Extensions.",- items: model.installedConnectors.map { ($0.id, $0.name, $0.command ?? $0.url ?? "") },- selection: Binding(get: { draft.connectors ?? [] }, set: { draft.connectors = $0 })- )- PluginToggles(- title: "Skills",- empty: "No skills yet. Get some from Extensions, or write your own.",- items: model.installedSkills.map { ($0.id, $0.name, $0.description) },- selection: Binding(get: { draft.skills ?? [] }, set: { draft.skills = $0 }),- info: { id in viewingSkill = model.installedSkills.first { $0.id == id }.map(SkillRef.init) }- )- if let id = draft.id {- MemoryCard(botId: id)+ ValueRow("Permissions", detail: draft.permission == "auto"+ ? "Tool requests are approved automatically. Your agent's own settings (like Claude Code's permission rules) still apply."+ : "You'll get an approval card and a notification whenever the agent asks.") {+ ChoicePicker(selection: $draft.permission, options: [("ask", "Ask me"), ("auto", "Approve automatically")])}+ }- if let error {- Text(error).font(.footnote).foregroundStyle(Palette.danger)+ 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 {+ 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+ ? "Let this bot see the screen and use the mouse and keyboard. You can watch and take over from your phone."+ : model.screen?.computerUse == true+ ? "Let this bot see the screen and use the mouse and keyboard."+ : "Let this bot see the screen and use the mouse and keyboard. On that computer, open Codync → Settings → Computer access to set up permissions first.",+ isOn: Binding(get: { draft.computer ?? false }, set: { draft.computer = $0 }))}}- .padding(20)- }- .font(.body)- .scrollDismissesKeyboard(.interactively)- .background(Palette.background)- .task { await model.refreshPlugins() }- .codyncSheet(item: $viewingSkill) { SkillSheet(skill: $0) }- .codyncSheet(isPresented: $pickingFolder) {- FolderPicker(start: draft.cwd.isEmpty ? model.hello?.home : draft.cwd) {- draft.cwd = $0- pickingFolder = false++ PluginToggles(+ title: "Connectors",+ empty: "No connectors yet. Add GitHub, Linear, Notion and more from Extensions.",+ items: model.installedConnectors.map { ($0.id, $0.name, $0.command ?? $0.url ?? "") },+ selection: Binding(get: { draft.connectors ?? [] }, set: { draft.connectors = $0 })+ )+ PluginToggles(+ title: "Skills",+ empty: "No skills yet. Get some from Extensions, or write your own.",+ items: model.installedSkills.map { ($0.id, $0.name, $0.description) },+ selection: Binding(get: { draft.skills ?? [] }, set: { draft.skills = $0 }),+ info: { id in viewingSkill = model.installedSkills.first { $0.id == id }.map(SkillRef.init) }+ )+ if let error {+ Text(error).font(.footnote).foregroundStyle(Palette.danger)}}}diff --git a/apps/ios/Kit/Sources/CodyncUI/Bots/BotTemplateView.swift b/apps/ios/Kit/Sources/CodyncUI/Bots/BotTemplateView.swiftindex d1679c6a..a9181199 100644--- a/apps/ios/Kit/Sources/CodyncUI/Bots/BotTemplateView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Bots/BotTemplateView.swift@@ -56,7 +56,6 @@ struct BotTemplateView: View {}.padding([.horizontal, .bottom], 24)}- .frame(width: 560, height: 540).background(Palette.background)}}diff --git a/apps/ios/Kit/Sources/CodyncUI/Bots/MemoryView.swift b/apps/ios/Kit/Sources/CodyncUI/Bots/MemoryView.swiftindex f0dfb2de..57db33c6 100644--- a/apps/ios/Kit/Sources/CodyncUI/Bots/MemoryView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Bots/MemoryView.swift@@ -15,18 +15,12 @@ struct MemoryCard: View {private var bot: Bot? { host.bots[botId] }var body: some View {- CardSection("Memory") {- if let memory { contents(memory) }- else { Text("Loading memory…").foregroundStyle(Palette.secondary) }- } accessory: {- if let memory, section == .yours || section == .bot {- HStack(spacing: 2) {- IconButton("Add memory", systemImage: "plus") {- withAnimation(Motion.layout) { editor = MemoryEditTarget(entry: nil, shared: section == .yours, text: "") }- }- .disabled(memory.busy)- moreMenu(memory)- }+ VStack(spacing: 10) {+ TabChoice(selection: Binding(get: { section }, set: { value in withAnimation(Motion.layout) { section = value } }),+ options: sections(memory?.view))+ CardSection {+ if let memory { contents(memory) }+ else { Text("Loading memory…").foregroundStyle(Palette.secondary) }}}// Memory changes anywhere move the bot's `memoryRev`: fetch again.@@ -47,8 +41,6 @@ struct MemoryCard: View {}@ViewBuilder private func contents(_ memory: MemoryStore) -> some View {- SegmentedChoice(selection: Binding(get: { section }, set: { value in withAnimation(Motion.layout) { section = value } }),- options: sections(memory.view))if let error = memory.error { Text(error).foregroundStyle(Palette.danger).textSelection(.enabled) }if let view = memory.view {switch section {@@ -73,8 +65,16 @@ struct MemoryCard: View {Toggle("Use what your bots share", isOn: Binding(get: { bot.sharedMemory ?? view.shared }, set: { host.setSharedMemory(bot, $0) })).toggleStyle(.codync)}- Text("\(shared ? "Your name, time zone, people and lasting preferences, shared by your bots." : "What this bot learned about you.") \(layer.used) of \(layer.cap) in use.")- .font(.footnote).foregroundStyle(Palette.secondary)+ HStack(alignment: .top, spacing: 8) {+ Text("\(shared ? "Your name, time zone, people and lasting preferences, shared by your bots." : "What this bot learned about you.") \(layer.used) of \(layer.cap) in use.")+ .font(.footnote).foregroundStyle(Palette.secondary)+ .frame(maxWidth: .infinity, alignment: .leading)+ IconButton("Add memory", systemImage: "plus") {+ withAnimation(Motion.layout) { editor = MemoryEditTarget(entry: nil, shared: shared, text: "") }+ }+ .disabled(memory.busy)+ moreMenu(memory)+ }if layer.entries.isEmpty {empty("brain", shared ? "Nothing shared yet." : "Nothing yet. What this bot learns about you shows up here, and you can change any of it.")}diff --git a/apps/ios/Kit/Sources/CodyncUI/Controls.swift b/apps/ios/Kit/Sources/CodyncUI/Controls.swiftindex 216d9731..a871ea4f 100644--- a/apps/ios/Kit/Sources/CodyncUI/Controls.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Controls.swift@@ -304,6 +304,43 @@ public struct SegmentedChoice<ID: Hashable>: View {}}+/// Grok Bot's page tabs: plain labels, the chosen one on a light capsule.+public struct TabChoice<ID: Hashable>: View {+ @Binding var selection: ID+ let options: [(id: ID, label: String)]+ @Namespace private var pill+ @Environment(\.accessibilityReduceMotion) private var reduceMotion++ public init(selection: Binding<ID>, options: [(id: ID, label: String)]) {+ _selection = selection+ self.options = options+ }++ public var body: some View {+ HStack(spacing: 2) {+ ForEach(options, id: \.id) { option in+ let on = option.id == selection+ Button {+ withAnimation(Motion.reduced(Motion.morph, reduceMotion)) { selection = option.id }+ } label: {+ Text(option.label)+ .font(.subheadline)+ .foregroundStyle(on ? Palette.text : Palette.secondary)+ .lineLimit(1)+ .padding(.horizontal, 12)+ .padding(.vertical, 6)+ .background {+ if on { Capsule().fill(Palette.bubbleAgent).matchedGeometryEffect(id: "pill", in: pill) }+ }+ .contentShape(Capsule())+ }+ .buttonStyle(.plain)+ .accessibilityAddTraits(on ? .isSelected : [])+ }+ }+ }+}+/// A list of choices, one per row with a checkmark: the replacement for `.inline` pickers.public struct ChoiceList<ID: Hashable>: View {@Binding var selection: IDdiff --git a/apps/ios/Kit/Sources/CodyncUI/Routines/RoutinesView.swift b/apps/ios/Kit/Sources/CodyncUI/Routines/RoutinesView.swiftindex cd0eb7d5..a973391c 100644--- a/apps/ios/Kit/Sources/CodyncUI/Routines/RoutinesView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Routines/RoutinesView.swift@@ -5,7 +5,8 @@ import SwiftUIstruct RoutinesView: View {let botId: Stringvar initialId: String?- var close: (() -> Void)?+ /// Goes back to the chat once a request to the bot is in the composer.+ var leave: (() -> Void)?@Environment(BotStore.self) private var model@Environment(\.accessibilityReduceMotion) private var reduceMotion@State private var routines: [Routine] = []@@ -18,17 +19,16 @@ struct RoutinesView: View {@State private var loadError: String?var body: some View {- VStack(alignment: .leading, spacing: close == nil ? 10 : 16) {+ VStack(alignment: .leading, spacing: 10) {HStack {Text("Routines")- .font(.system(size: 13, weight: .semibold))+ .font(.system(size: 15, weight: .semibold)).foregroundStyle(Palette.text).padding(.leading, 2)Spacer(minLength: 0)askInChatIconButton("Set up a routine", systemImage: "plus") { open(nil) }.disabled(model.isOffline)- if let close { IconButton("Close routines", systemImage: "xmark", action: close) }}if let loadError { Text(loadError).font(.caption).foregroundStyle(Palette.danger) }if let error { Text(error).font(.caption).foregroundStyle(.red).textSelection(.enabled) }@@ -142,7 +142,7 @@ struct RoutinesView: View {private func edit(_ text: String) {animate {model.routineDrafts[botId] = text- close?()+ leave?()}}private func action(_ method: String, _ routine: Routine, enabled: Bool? = nil) {diff --git a/apps/ios/Kit/Sources/CodyncUI/Thread/ThreadView.swift b/apps/ios/Kit/Sources/CodyncUI/Thread/ThreadView.swiftindex 6220c433..59b17569 100644--- a/apps/ios/Kit/Sources/CodyncUI/Thread/ThreadView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Thread/ThreadView.swift@@ -15,16 +15,12 @@ public struct ThreadView: View {@State var openThread: ThreadTarget?@State var botChat: BotChatTarget?@State var editingGroup = false- @State var editing: EditorRequest?- @State var templateRequest: EditorRequest?+ @State var details: DetailsRequest?@State var confirmNewSession = false@State var confirmDelete: Bot?@State var calling = false@State var callSpeaking = false@State var interruptCall: (() -> Void)?- @State var showRoutines = false- @State var routineId: String?- @State var routineRequest = UUID()/// The chat stays on the newest message until the reader scrolls away.@State var following = true@State var loadingEarlier = false@@ -84,11 +80,8 @@ public struct ThreadView: View {TraceView(botId: botId)}.codyncSheet(item: $botChat) { BotConversationView(botId: botId, peerId: $0.id) }- .codyncSheet(item: $templateRequest) { request in- BotTemplateView(draft: request.draft)- }- .codyncSheet(item: $editing) { request in- BotEditorView(draft: request.draft)+ .codyncSheet(item: $details) { request in+ BotDetailsView(botId: botId, request: request)}.codyncSheet(isPresented: $editingGroup) {GroupEditorView(group: bot)@@ -97,13 +90,6 @@ public struct ThreadView: View {message: "The conversation stays here, but the agent starts with a fresh context.") {[DialogAction("New session") { model.newSession(botId) }]}- .codyncSheet(isPresented: $showRoutines) {- ScrollView {- RoutinesView(botId: botId, initialId: routineId) {- withAnimation(Motion.reduced(Motion.layout, reduceMotion)) { showRoutines = false }- }.padding(20)- }- }.deleteBotConfirmation($confirmDelete) { dismiss() }}@@ -198,9 +184,7 @@ public struct ThreadView: View {func openRoutine(_ id: String?) {withAnimation(Motion.reduced(Motion.layout, reduceMotion)) {- routineId = id- routineRequest = UUID()- presentRoutine()+ details = DetailsRequest(tab: .details, routineId: id)}}@@ -213,9 +197,7 @@ public struct ThreadView: View {return items}if let bot {- items.append(MenuItem("Edit profile", icon: "pencil") {- editProfile(bot)- })+ items.append(MenuItem("Settings", icon: "gearshape") { openSettings() })items.append(MenuItem(bot.pinned ? "Unpin" : "Pin", icon: "pin") { model.setPinned(bot, !bot.pinned) })}items.append(MenuItem("Routines", icon: "clock.arrow.circlepath") {@@ -438,7 +420,7 @@ extension ThreadView {}private func openDetails() {- if bot?.isGroup == true { editingGroup = true } else if let bot { editing = EditorRequest(BotDraft(bot)) }+ if bot?.isGroup == true { editingGroup = true } else { details = DetailsRequest() }}/// Opens the computer's screen; pulses while this bot is operating it (watch, then take over).@@ -450,11 +432,7 @@ extension ThreadView {.symbolEffect(.pulse, options: .repeating, isActive: operating)}- func presentRoutine() {- showRoutines = true- }-- func editProfile(_ bot: Bot) {- editing = EditorRequest(BotDraft(bot))+ func openSettings() {+ details = DetailsRequest(tab: .settings)}}diff --git a/apps/ios/WhatsNew.md b/apps/ios/WhatsNew.mdindex 125b9622..9ede2b30 100644--- a/apps/ios/WhatsNew.md+++ b/apps/ios/WhatsNew.md@@ -15,6 +15,7 @@ a version without one gets a generic "Bug fixes and improvements" line. Delete o- 原本的記憶會自動搬過來。- 對話太長時,bot 會先摘要較早的內容,摘要可以在聊天裡展開;摘要也不夠用時,會改用一張卡片開新對話,你可以先編輯它要帶過去的內容,或選擇保留原本的對話。- bot 可以把較長的細節寫成筆記(每個主題一份),在記憶裡就能閱讀、編輯、刪除或還原任何一個版本;bot 改了筆記時,聊天裡會顯示改了哪些地方,一鍵就能復原。+- bot 的詳細資料重新整理成一頁:上方是 bot 的頭像和名字,下面分成「詳細資料」、「記憶」、「設定」三個分頁,設定改了就自動儲存;也能從這裡把 bot 分享成範本。### en-US@@ -24,6 +25,7 @@ a version without one gets a generic "Bug fixes and improvements" line. Delete o- Your existing memory moves over automatically.- When a chat runs long, the bot summarizes the earlier part, and you can open the summary in the chat. When that's no longer enough, a card offers a fresh conversation: edit what it carries over, or keep the current one.- Bots can keep longer notes, one topic each. Read, edit, delete or bring back any version from memory, and when a bot changes a note, the chat shows what changed with a one-tap undo.+- A bot's details are one page now: its avatar and name on top, then Details, Memory and Settings tabs. Settings save as you edit, and you can share the bot as a template from here.## 2.17.5diff --git a/docs/design/ui-conventions.md b/docs/design/ui-conventions.mdindex adc5d033..d2f0a76f 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 opPreserve 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`) uses a compact device summary instead of an empty screen preview. Keep the computer name, remote-screen state, and iPhone hint together; show the hint only when screen capture is ready. Use 16-point horizontal insets and 28-point section gaps. Its sections (computer, Routines, Agent) and the Settings tab (`BotSettingsForm`: Profile, Agent, Activity, Connectors, Skills, Memory) use the `CardSection` look: filled 16-point groups without borders, hairline-split rows, a note under each option.+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.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,6 +149,9 @@ and states.[bot collaboration](../features/bot-collaboration.md#notice-data).- TUI bot settings include **Use computer**, matching the iPhone and desktop apps. Theremote-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+ line on top; ⇧← ⇧→ moves between them. Settings with unsaved edits asks for ^S (or Esc) first.### Verificationdiff --git a/host/src/tui/app/forms.rs b/host/src/tui/app/forms.rsindex 0b9d24e3..4db74151 100644--- a/host/src/tui/app/forms.rs+++ b/host/src/tui/app/forms.rs@@ -8,6 +8,7 @@ use super::{After, AgentPicker, App, Bot, COLORS, Editor, FIELDS, Field, Form, GroupField, GroupForm, Overlay, SHAPES, Toggle,cycle, merge_toggles,};+use crate::tui::manage::Page;impl App {pub(super) fn open_pair(&mut self) {@@ -107,7 +108,7 @@ impl App {}}- pub(super) fn edit_bot(&mut self) {+ pub(in crate::tui) fn edit_bot(&mut self) {let Some(b) = self.bot().cloned() else { return };if b.group {self.overlays.push(Overlay::Group(GroupForm {@@ -142,9 +143,11 @@ impl App {sub: 0,error: None,saving: false,+ opened: Value::Null,};merge_toggles(&mut f.connectors, &self.market.0, false);merge_toggles(&mut f.skills, &self.market.1, false);+ f.opened = f.body();self.want_models(&b.backend);self.overlays.push(Overlay::Form(Box::new(f)));self.call("connectors", json!({}), After::Connectors);@@ -183,6 +186,7 @@ impl App {sub: 0,error: None,saving: false,+ opened: Value::Null,};self.want_models(&f.backend);self.overlays.push(Overlay::Form(Box::new(f)));@@ -191,6 +195,16 @@ impl App {}pub(super) fn form_key(&mut self, mut f: Box<Form>, k: KeyEvent) -> Option<Overlay> {+ if f.bot_id.is_some()+ && let Some(page) = Page::Settings.step(k)+ {+ if f.dirty() {+ f.error = Some("Save with ^S first, or Esc to drop the changes.".into());+ return Some(Overlay::Form(f));+ }+ self.open_page(page);+ return None;+ }let ctrl = k.modifiers.contains(KeyModifiers::CONTROL);let field = f.current();match k.code {@@ -334,23 +348,7 @@ impl App {f.error = Some("Give the bot a name.".into());return;}- let model = f.model.text.trim();- let mut body = json!({- "name": f.name.text.trim(),- "description": f.instructions.text.trim(),- "backend": f.backend,- "cwd": f.cwd,- "permission": if f.auto { "auto" } else { "ask" },- "model": if model.is_empty() { Value::Null } else { model.into() },- "modelOptions": f.model_options().cloned().unwrap_or_default(),- "fastMode": f.fast,- "notify": f.notify,- "computer": f.computer,- "avatarColor": COLORS[f.color],- "avatarShape": SHAPES[f.shape],- "connectors": f.connectors.iter().filter(|t| t.on).map(|t| t.id.clone()).collect::<Vec<_>>(),- "skills": f.skills.iter().filter(|t| t.on).map(|t| t.id.clone()).collect::<Vec<_>>(),- });+ let mut body = f.body();f.saving = true;f.error = None;match &f.bot_id {@@ -363,6 +361,34 @@ impl App {}}+impl Form {+ /// The bot as this form would save it.+ fn body(&self) -> Value {+ let model = self.model.text.trim();+ json!({+ "name": self.name.text.trim(),+ "description": self.instructions.text.trim(),+ "backend": self.backend,+ "cwd": self.cwd,+ "permission": if self.auto { "auto" } else { "ask" },+ "model": if model.is_empty() { Value::Null } else { model.into() },+ "modelOptions": self.model_options().cloned().unwrap_or_default(),+ "fastMode": self.fast,+ "notify": self.notify,+ "computer": self.computer,+ "avatarColor": COLORS[self.color],+ "avatarShape": SHAPES[self.shape],+ "connectors": self.connectors.iter().filter(|t| t.on).map(|t| t.id.clone()).collect::<Vec<_>>(),+ "skills": self.skills.iter().filter(|t| t.on).map(|t| t.id.clone()).collect::<Vec<_>>(),+ })+ }++ /// Whether anything changed since the form opened.+ pub fn dirty(&self) -> bool {+ self.body() != self.opened+ }+}+const NAMES: [&str; 24] = ["Ada", "Rex", "Mia", "Sol", "Kit", "Oli", "Ivy", "Max", "Zoe", "Leo", "Ari", "Bea", "Cal", "Dot", "Eli", "Fay","Gus", "Hal", "Ida", "Jin", "Kai", "Lux", "Nia", "Otto",diff --git a/host/src/tui/app/overlay_keys.rs b/host/src/tui/app/overlay_keys.rsindex 4d9b7081..7d75673b 100644--- a/host/src/tui/app/overlay_keys.rs+++ b/host/src/tui/app/overlay_keys.rs@@ -49,7 +49,7 @@ impl App {Action::NewGroup => self.new_group(),Action::Market => self.open_market(),Action::Memory => self.open_memory(),- Action::Routines => self.open_routines(),+ Action::Details => self.open_routines(),Action::RefreshAgents => self.call("refreshBackends", json!({}), After::Backends),Action::Pair => self.open_pair(),Action::Usage => self.overlays.push(Overlay::Usage),diff --git a/host/src/tui/app/ui.rs b/host/src/tui/app/ui.rsindex db318915..2143187e 100644--- a/host/src/tui/app/ui.rs+++ b/host/src/tui/app/ui.rs@@ -50,7 +50,7 @@ pub enum Action {NewGroup,Market,Memory,- Routines,+ Details,RefreshAgents,Pair,Usage,@@ -67,7 +67,7 @@ pub const ACTIONS: [(&str, &str, Action); 12] = [("New group chat…", "m", Action::NewGroup),("Extensions: agents, connectors, skills…", "A", Action::Market),("Memory of this bot…", "M", Action::Memory),- ("Routines of this bot…", "R", Action::Routines),+ ("Details of this bot…", "R", Action::Details),("Refresh agents", "", Action::RefreshAgents),("Pair a phone…", "P", Action::Pair),("Usage", "U", Action::Usage),@@ -203,6 +203,8 @@ pub struct Form {pub sub: usize,pub error: Option<String>,pub saving: bool,+ /// The settings as opened, to tell edits apart.+ pub opened: serde_json::Value,}impl Form {diff --git a/host/src/tui/manage/memory.rs b/host/src/tui/manage/memory.rsindex 891a6b96..ac68faee 100644--- a/host/src/tui/manage/memory.rs+++ b/host/src/tui/manage/memory.rs@@ -2,8 +2,8 @@//! log, and its project folder's own memory, driven from the keyboard.use super::super::app::{App, Confirm, ConfirmAct, Editor, Overlay};-use super::Reply;use super::s;+use super::{Page, Reply};use crossterm::event::{KeyCode, KeyEvent};use serde_json::{Value, json};@@ -178,6 +178,10 @@ impl App {}return Some(Overlay::Memory(m));}+ if let Some(page) = Page::Memory.step(k) {+ self.open_page(page);+ return None;+ }let rows = m.rows();let selected = rows.get(m.cursor).cloned();let entry = selected.as_ref().filter(|_| m.section.shared().is_some());diff --git a/host/src/tui/manage/mod.rs b/host/src/tui/manage/mod.rsindex 9393aba3..aa840754 100644--- a/host/src/tui/manage/mod.rs+++ b/host/src/tui/manage/mod.rs@@ -11,6 +11,7 @@ mod bot_chat;mod fields;mod market;mod memory;+mod pages;mod replies;mod routines;mod skill;@@ -18,6 +19,7 @@ mod skill;pub use analytics::AnalyticsSheet;pub use fields::{handoff_fields, memory_file_fields};pub use memory::{MemoryMode, MemorySheet, Section};+pub use pages::Page;pub use routines::local_zone;pub use skill::SkillSheet;diff --git a/host/src/tui/manage/pages.rs b/host/src/tui/manage/pages.rsnew file mode 100644index 00000000..91cc0179--- /dev/null+++ b/host/src/tui/manage/pages.rs@@ -0,0 +1,69 @@+//! A bot's three pages, as in the desktop inspector and the iPhone's details: Details (whether it+//! may use the computer, and its routines), Memory and Settings. Shift+←→ moves between them.++use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};++use super::super::app::App;++#[derive(Clone, Copy, PartialEq, Eq, Debug)]+pub enum Page {+ Details,+ Memory,+ Settings,+}++impl Page {+ pub const ALL: [Self; 3] = [Self::Details, Self::Memory, Self::Settings];++ pub fn label(self) -> &'static str {+ match self {+ Self::Details => "Details",+ Self::Memory => "Memory",+ Self::Settings => "Settings",+ }+ }++ /// The page shift+← or shift+→ moves to from this one.+ pub fn step(self, k: KeyEvent) -> Option<Self> {+ if !k.modifiers.contains(KeyModifiers::SHIFT) {+ return None;+ }+ let i = Self::ALL.iter().position(|p| *p == self)?;+ let next = match k.code {+ KeyCode::Left => i.checked_sub(1)?,+ KeyCode::Right => i + 1,+ _ => return None,+ };+ Self::ALL.get(next).copied()+ }+}++impl App {+ /// Opens `page` of the bot in view, in place of the page it came from.+ pub(in crate::tui) fn open_page(&mut self, page: Page) {+ match page {+ Page::Details => self.open_routines(),+ Page::Memory => self.open_memory(),+ Page::Settings => self.edit_bot(),+ }+ }+}++#[cfg(test)]+mod tests {+ use super::*;++ #[test]+ fn shift_arrows_move_between_pages_and_stop_at_the_ends() {+ let key = |code| KeyEvent::new(code, KeyModifiers::SHIFT);+ assert_eq!(Page::Details.step(key(KeyCode::Right)), Some(Page::Memory));+ assert_eq!(Page::Memory.step(key(KeyCode::Left)), Some(Page::Details));+ assert_eq!(Page::Settings.step(key(KeyCode::Right)), None);+ assert_eq!(Page::Details.step(key(KeyCode::Left)), None);+ assert_eq!(+ Page::Memory.step(KeyEvent::new(KeyCode::Right, KeyModifiers::NONE)),+ None,+ "plain → is the page's own"+ );+ }+}diff --git a/host/src/tui/manage/routines.rs b/host/src/tui/manage/routines.rsindex e4e77851..cdfc3d0f 100644--- a/host/src/tui/manage/routines.rs+++ b/host/src/tui/manage/routines.rs@@ -5,7 +5,7 @@ use serde_json::{Value, json};use std::str::FromStr as _;use super::super::app::{App, Confirm, ConfirmAct, Editor, Focus, Overlay};-use super::{Reply, RoutineField, RoutineForm, RoutineList, ctrl, newline, s};+use super::{Page, Reply, RoutineField, RoutineForm, RoutineList, ctrl, newline, s};impl App {pub fn open_routines(&mut self) {@@ -19,6 +19,10 @@ impl App {}pub(in crate::tui) fn routines_key(&mut self, mut l: RoutineList, k: KeyEvent) -> Option<Overlay> {+ if let Some(page) = Page::Details.step(k) {+ self.open_page(page);+ return None;+ }let n = l.items.as_ref().map_or(0, Vec::len);let current = l.items.as_ref().and_then(|v| v.get(l.cursor)).cloned();let bot = l.bot.clone();diff --git a/host/src/tui/sheets.rs b/host/src/tui/sheets.rsindex e7a2c625..12807589 100644--- a/host/src/tui/sheets.rs+++ b/host/src/tui/sheets.rs@@ -13,7 +13,7 @@ pub use memory_view::draw as memory;use super::app::{App, Editor};use super::manage::{- AgentSetup, Fields, Market, RoutineField, RoutineForm, RoutineList, Row, SetupRow, Submit, TABS, Tab,+ AgentSetup, Fields, Market, Page, RoutineField, RoutineForm, RoutineList, Row, SetupRow, Submit, TABS, Tab,};use super::md::truncate;use super::view::{@@ -54,11 +54,32 @@ fn name_of(app: &App, bot: &str) -> String {app.bots.get(bot).map_or_else(String::new, |b| b.name.clone())}+/// A bot's pages on the top line (Details, Memory, Settings) with this one marked; returns the+/// area under it.+pub fn page_tabs(buf: &mut Buffer, inner: Rect, current: Page) -> Rect {+ let t = theme();+ let mut x = inner.x;+ for page in Page::ALL {+ let style = if page == current { t.text.patch(t.sel) } else { t.secondary.patch(t.panel) };+ x = put(buf, x, inner.y, inner.right().saturating_sub(x), &format!(" {} ", page.label()), style) + 1;+ }+ rput(buf, inner.right(), inner.y, "⇧←→ page", t.dim.patch(t.panel));+ Rect::new(inner.x, inner.y + 2, inner.width, inner.height.saturating_sub(2))+}+pub fn routines(buf: &mut Buffer, area: Rect, app: &App, l: &RoutineList) {let t = theme();- let r = centered(area, 90, 24);- let title = format!("{}'s routines", name_of(app, &l.bot));+ let r = centered(area, 90, 28);+ 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);+ 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));+ 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));let list_h = usize::from(inner.height.saturating_sub(3)) / 2;match &l.items {None => {diff --git a/host/src/tui/sheets/memory_view.rs b/host/src/tui/sheets/memory_view.rsindex 571cab1a..b43b9bc5 100644--- a/host/src/tui/sheets/memory_view.rs+++ b/host/src/tui/sheets/memory_view.rs@@ -1,16 +1,19 @@//! A bot's memory: about you, this bot's own, its dreams and its project's memory.-use super::{App, Buffer, Rect, centered, footer, frame_box, input_line, name_of, put, row, s, theme, u, window};-use crate::tui::manage::{MemoryMode, MemorySheet, Section};+use super::{+ App, Buffer, Rect, centered, footer, frame_box, input_line, name_of, page_tabs, put, row, s, theme, u, window,+};+use crate::tui::manage::{MemoryMode, MemorySheet, Page, Section};use crate::tui::view::when;use ratatui::widgets::{Paragraph, Widget, Wrap};use serde_json::Value;pub fn draw(buf: &mut Buffer, area: Rect, app: &App, memory: &MemorySheet) {let palette = theme();- let rect = centered(area, 100, 30);- let title = format!("{} · Memory", name_of(app, &memory.bot));+ let rect = centered(area, 100, 32);+ let title = name_of(app, &memory.bot);let inner = frame_box(buf, rect, palette.text, palette.panel, Some((&title, palette.text)));+ let inner = page_tabs(buf, inner, Page::Memory);tabs(buf, inner, memory);let body = Rect::new(inner.x, inner.y + 2, inner.width, inner.height.saturating_sub(5));let keys = match &memory.mode {diff --git a/host/src/tui/view/forms.rs b/host/src/tui/view/forms.rsindex 59e402e5..845e137e 100644--- a/host/src/tui/view/forms.rs+++ b/host/src/tui/view/forms.rs@@ -5,7 +5,9 @@ use ratatui::layout::{Position, Rect};use ratatui::style::{Modifier, Style};use super::super::app::{App, COLORS, Editor, FIELDS, Field, Form, GroupField, GroupForm, SHAPES, tilde};+use super::super::manage::Page;use super::super::md::{truncate, width as w};+use super::super::sheets::page_tabs;use super::buffer::{centered, frame_box, put, put_line, restyle, rput, u};use super::chat::composer_lines;use super::overlay::input_line;@@ -14,12 +16,13 @@ use super::style::{FACE, avatar, bot_color, face_style, theme};pub(super) fn form_view(buf: &mut Buffer, area: Rect, app: &App, f: &Form) {let t = theme();- let r = centered(area, 88, 32);+ let r = centered(area, 88, if f.bot_id.is_some() { 34 } else { 32 });let title = match &f.bot_id {- Some(_) => format!("Edit {}", f.name.text),+ Some(id) => app.bots.get(id).map_or_else(|| f.name.text.clone(), |b| b.name.clone()),None => "New bot · 2/2 name and looks".into(),};let inner = frame_box(buf, r, t.text, t.panel, Some((&title, t.text)));+ let inner = if f.bot_id.is_some() { page_tabs(buf, inner, Page::Settings) } else { inner };let wide = inner.width >= 70;let fx = if wide { inner.x + 18 } else { inner.x };if wide {diff --git a/host/src/tui/view/help.rs b/host/src/tui/view/help.rsindex eaf7a4f9..73b76a83 100644--- a/host/src/tui/view/help.rs+++ b/host/src/tui/view/help.rs@@ -9,7 +9,7 @@ use super::buffer::{centered, frame_box, put, u};use super::overlay::field_line;use super::style::theme;-const HELP: [(&str, &str, &str); 59] = [+const HELP: [(&str, &str, &str); 60] = [("MOVE", "j k ↑ ↓", "next / previous bot"),("MOVE", "[ ]", "previous / next bot"),("MOVE", "1…9", "jump to bot 1–9"),@@ -49,12 +49,13 @@ const HELP: [(&str, &str, &str); 59] = [("TYPE", "/", "commands: /fast, /new, skills"),("BOTS", "n", "new bot"),("BOTS", "m", "new group chat"),- ("BOTS", "e", "edit bot or group"),+ ("BOTS", "e", "settings, or edit a group"),("BOTS", "p", "pin / unpin"),("BOTS", "J K", "move bot down / up"),("BOTS", "S", "new session"),("BOTS", "M", "memory"),- ("BOTS", "R", "routines"),+ ("BOTS", "R", "details: routines, computer"),+ ("BOTS", "⇧← ⇧→", "between details, memory, settings"),("BOTS", "A", "extensions, sign-in"),("BOTS", "x", "delete bot or group"),("VIEW", "t", "trace pane"),