Refine settings panel layout and controls (#2676)

This commit is contained in:
Jinjing
2026-05-23 01:16:46 -07:00
committed by GitHub
parent 102cc09622
commit a50a97670f
40 changed files with 1636 additions and 1600 deletions
@@ -42,6 +42,7 @@ function createSettings(overrides: Partial<GlobalSettings> = {}): GlobalSettings
editorAutoSave: false,
editorAutoSaveDelayMs: 1000,
editorMinimapEnabled: false,
markdownReviewToolsEnabled: true,
terminalFontSize: 14,
terminalFontFamily: 'JetBrains Mono',
terminalFontWeight: 500,
+1
View File
@@ -35,6 +35,7 @@ function createSettings(overrides: Partial<GlobalSettings> = {}): GlobalSettings
editorAutoSave: false,
editorAutoSaveDelayMs: 1000,
editorMinimapEnabled: false,
markdownReviewToolsEnabled: true,
terminalFontSize: 14,
terminalFontFamily: 'JetBrains Mono',
terminalFontWeight: 500,
@@ -23,7 +23,7 @@ export function ShortcutKeyCombo({
const isMac = navigator.userAgent.includes('Mac')
return (
<div className={cn('flex items-center gap-1', className)}>
<span className={cn('inline-flex items-center gap-1', className)}>
{keys.map((key, index) => (
<React.Fragment key={`${key}-${index}`}>
<KeyCap label={key} />
@@ -34,6 +34,6 @@ export function ShortcutKeyCombo({
) : null}
</React.Fragment>
))}
</div>
</span>
)
}
@@ -112,7 +112,7 @@ function GitHubRateLimitRows({
snapshot: GitHubRateLimitSnapshot
}): React.JSX.Element {
return (
<div className="flex flex-col gap-1 font-mono">
<div className="flex flex-col gap-1 text-xs">
{BUCKETS.map((b) => {
const v = snapshot[b.key]
const tone = toneForGitHubBucket(v.remaining, v.limit)
@@ -121,7 +121,7 @@ function GitHubRateLimitRows({
<span className="text-muted-foreground">{b.description}</span>
<span
className={cn(
'text-foreground',
'tabular-nums text-foreground',
tone === 'crit' && 'text-red-600 dark:text-red-300',
tone === 'warn' && 'text-amber-700 dark:text-amber-300'
)}
@@ -264,7 +264,7 @@ export function AccountsPane({ settings, updateSettings }: AccountsPaneProps): R
title="Claude Accounts"
description="Optional account switcher for the shared Claude auth files."
keywords={['claude', 'account', 'rate limit', 'status bar', 'quota']}
className="space-y-3 px-1 py-2"
className="space-y-3 py-2"
>
<div className="flex items-center justify-between gap-3">
<div className="space-y-0.5">
@@ -450,7 +450,7 @@ export function AccountsPane({ settings, updateSettings }: AccountsPaneProps): R
entry.description ?? '',
...(entry.keywords ?? [])
])}
className="space-y-3 px-1 py-2"
className="space-y-3 py-2"
>
{/* Why: Settings deep-links can target this subsection directly from
the status-bar account switcher. Keeping a stable DOM anchor here
@@ -644,7 +644,7 @@ export function AccountsPane({ settings, updateSettings }: AccountsPaneProps): R
'rate limit',
'status bar'
]}
className="flex items-center justify-between gap-4 px-1 py-2"
className="flex items-center justify-between gap-4 py-2"
>
<div className="space-y-0.5">
<Label>Use Gemini CLI credentials (experimental)</Label>
@@ -24,31 +24,36 @@ export function AgentAwakeSetting({
title={AGENT_AWAKE_TITLE}
description={description}
keywords={getAgentAwakeSearchKeywords()}
className="flex items-start justify-between gap-4 px-1 py-2"
>
<div className="min-w-0 shrink space-y-0.5">
<Label>{AGENT_AWAKE_TITLE}</Label>
<p className="text-xs text-muted-foreground">{description}</p>
<div className="flex items-start justify-between gap-4 py-2">
<div className="min-w-0 flex-1 space-y-0.5">
<Label>{AGENT_AWAKE_TITLE}</Label>
<p className="text-xs text-muted-foreground">{description}</p>
</div>
{/* Why: this button is read directly from the React element tree by tests
that walk props (without rendering), so the role/aria attributes
must remain on a literal <button>, not behind a component wrapper. */}
<button
type="button"
role="switch"
aria-label={AGENT_AWAKE_TITLE}
aria-checked={settings.keepComputerAwakeWhileAgentsRun}
onClick={() =>
updateSettings({
keepComputerAwakeWhileAgentsRun: !settings.keepComputerAwakeWhileAgentsRun
})
}
className={`relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors ${
settings.keepComputerAwakeWhileAgentsRun ? 'bg-foreground' : 'bg-muted-foreground/30'
} outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`}
>
<span
className={`pointer-events-none block size-3.5 rounded-full bg-background shadow-sm transition-transform ${
settings.keepComputerAwakeWhileAgentsRun ? 'translate-x-4' : 'translate-x-0.5'
}`}
/>
</button>
</div>
<button
role="switch"
aria-label={AGENT_AWAKE_TITLE}
aria-checked={settings.keepComputerAwakeWhileAgentsRun}
onClick={() =>
updateSettings({
keepComputerAwakeWhileAgentsRun: !settings.keepComputerAwakeWhileAgentsRun
})
}
className={`relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors ${
settings.keepComputerAwakeWhileAgentsRun ? 'bg-foreground' : 'bg-muted-foreground/30'
}`}
>
<span
className={`pointer-events-none block size-3.5 rounded-full bg-background shadow-sm transition-transform ${
settings.keepComputerAwakeWhileAgentsRun ? 'translate-x-4' : 'translate-x-0.5'
}`}
/>
</button>
</SearchableSetting>
</section>
)
@@ -7,6 +7,7 @@ import { Button } from '../ui/button'
import { Input } from '../ui/input'
import { cn } from '@/lib/utils'
import { AgentAwakeSetting } from './AgentAwakeSetting'
import { SettingsBadge, SettingsSubsectionHeader } from './SettingsFormControls'
export { AGENTS_PANE_SEARCH_ENTRIES } from './agents-search'
@@ -104,38 +105,26 @@ function AgentRow({
const [cmdOpen, setCmdOpen] = useState(Boolean(cmdOverride))
return (
<div
className={cn(
'group rounded-xl border transition-all',
isDetected ? 'border-border/60 bg-card/60' : 'border-border/30 bg-card/20 opacity-60'
)}
>
<div className="flex items-center gap-3 px-4 py-3">
{/* Icon */}
<div className="flex size-8 shrink-0 items-center justify-center rounded-lg border border-border/50 bg-background/60">
<AgentIcon agent={agentId} size={18} />
<div className={cn('py-3', !isDetected && 'opacity-60')}>
<div className="flex items-center gap-3">
<div className="flex size-7 shrink-0 items-center justify-center rounded-md border border-border/50 bg-background/50">
<AgentIcon agent={agentId} size={16} />
</div>
{/* Name + status */}
<div className="min-w-0 flex-1">
<div className="flex items-center gap-2">
<span className="text-sm font-semibold leading-none">{label}</span>
<span className="text-sm font-medium leading-none">{label}</span>
{isDetected ? (
<span className="inline-flex items-center gap-1 rounded-full border border-emerald-500/30 bg-emerald-500/10 px-1.5 py-0.5 text-[10px] font-medium text-emerald-700 dark:text-emerald-300">
<span className="size-1.5 rounded-full bg-emerald-500" />
Detected
</span>
<SettingsBadge tone="accent">Detected</SettingsBadge>
) : (
<span className="inline-flex items-center gap-1 rounded-full border border-border/40 bg-muted/30 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground">
Not installed
</span>
<SettingsBadge tone="muted">Not installed</SettingsBadge>
)}
</div>
<div className="mt-0.5 font-mono text-[11px] text-muted-foreground">
<div className="mt-1 truncate font-mono text-[11px] text-muted-foreground">
{cmdOverride ? (
<span>
<span className="text-muted-foreground/60 line-through">{defaultCmd}</span>
<span className="ml-1.5 text-foreground/70">{cmdOverride}</span>
<span className="ml-1.5 text-foreground/80">{cmdOverride}</span>
</span>
) : (
defaultCmd
@@ -143,72 +132,67 @@ function AgentRow({
</div>
</div>
{/* Actions */}
<div className="flex shrink-0 items-center gap-1">
{/* Set as default — only for detected agents */}
{isDetected && (
<button
<Button
type="button"
variant={isDefault ? 'secondary' : 'ghost'}
size="xs"
onClick={onSetDefault}
title={isDefault ? 'Default agent' : 'Set as default'}
className={cn(
'flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium transition-colors',
isDefault
? 'bg-foreground/10 text-foreground ring-1 ring-foreground/20'
: 'text-muted-foreground hover:bg-muted/60 hover:text-foreground'
)}
className="h-7 gap-1 text-xs"
>
{isDefault && <Check className="size-3" />}
{isDefault ? 'Default' : 'Set default'}
</button>
</Button>
)}
{/* Customize command — only for detected agents */}
{isDetected && (
<button
<Button
type="button"
variant="ghost"
size="icon-sm"
onClick={() => setCmdOpen((prev) => !prev)}
title="Customize command"
aria-expanded={cmdOpen}
className={cn(
'flex size-7 items-center justify-center rounded-lg transition-colors',
cmdOpen || cmdOverride
? 'bg-muted/60 text-foreground'
: 'text-muted-foreground hover:bg-muted/50 hover:text-foreground'
'size-7 text-muted-foreground hover:text-foreground',
(cmdOpen || cmdOverride) && 'text-foreground'
)}
>
<Terminal className="size-3.5" />
</button>
</Button>
)}
{/* Homepage link */}
<a
href={homepageUrl}
target="_blank"
rel="noopener noreferrer"
title={isDetected ? 'Docs' : 'Install'}
className="flex size-7 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground"
className="flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground"
>
<ExternalLink className="size-3.5" />
</a>
{/* Expand chevron for cmd override */}
{isDetected && (
<button
<Button
type="button"
variant="ghost"
size="icon-sm"
onClick={() => setCmdOpen((prev) => !prev)}
className="flex size-7 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground"
aria-label={cmdOpen ? 'Collapse command override' : 'Expand command override'}
className="size-7 text-muted-foreground hover:text-foreground"
>
<ChevronDown
className={cn('size-3.5 transition-transform', cmdOpen && 'rotate-180')}
/>
</button>
</Button>
)}
</div>
</div>
{/* Command override row */}
{isDetected && cmdOpen && (
<div className="border-t border-border/40 px-4 py-3">
<div className="mt-3 pl-10">
{/* Why: key by the persisted seed so settings changes reset the draft during reconciliation, not in a follow-up effect commit. */}
<AgentCommandOverrideInput
key={cmdOverride ?? defaultCmd}
@@ -225,6 +209,30 @@ function AgentRow({
)
}
type DefaultAgentPillProps = {
active: boolean
onClick: () => void
children: React.ReactNode
}
function DefaultAgentPill({ active, onClick, children }: DefaultAgentPillProps): React.JSX.Element {
return (
<button
type="button"
onClick={onClick}
aria-pressed={active}
className={cn(
'inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-sm outline-none transition-colors focus-visible:ring-[3px] focus-visible:ring-ring/50',
active
? 'border-muted-foreground/40 bg-accent font-medium text-accent-foreground'
: 'border-border bg-background/50 text-muted-foreground hover:border-muted-foreground/35 hover:text-foreground'
)}
>
{children}
</button>
)
}
export function AgentsPane({ settings, updateSettings }: AgentsPaneProps): React.JSX.Element {
const { detectedIds: detectedList, isRefreshing, refresh } = useDetectedAgents()
// Why: refresh re-spawns the user's login shell to re-capture PATH
@@ -269,69 +277,40 @@ export function AgentsPane({ settings, updateSettings }: AgentsPaneProps): React
return (
<div className="space-y-8">
{/* Default agent picker */}
<section className="space-y-4">
<div className="space-y-1">
<h3 className="text-sm font-semibold">Default Agent</h3>
<p className="text-xs text-muted-foreground">
Pre-selected agent when opening a new workspace.
</p>
</div>
<SettingsSubsectionHeader
title="Default Agent"
description="Pre-selected agent when opening a new workspace."
/>
<div className="flex flex-wrap gap-2">
{/* Auto option */}
<button
type="button"
onClick={() => setDefault(null)}
className={cn(
'flex items-center gap-2 rounded-xl border px-3 py-2 text-sm transition-all',
isAutoDefault
? 'border-foreground/20 bg-foreground/8 font-medium ring-1 ring-foreground/15'
: 'border-border/50 bg-muted/30 text-muted-foreground hover:border-border hover:bg-muted/50 hover:text-foreground'
)}
>
<DefaultAgentPill active={isAutoDefault} onClick={() => setDefault(null)}>
{isAutoDefault && <Check className="size-3.5" />}
Auto
</button>
</DefaultAgentPill>
{/* Why: users who prefer to open a raw shell by default need a
first-class "no agent" choice here — without it, the Auto pill
is the closest option but silently launches the first detected
agent, which is the opposite of what they want. */}
<button
type="button"
onClick={() => setDefault('blank')}
className={cn(
'flex items-center gap-2 rounded-xl border px-3 py-2 text-sm transition-all',
isBlankDefault
? 'border-foreground/20 bg-foreground/8 font-medium ring-1 ring-foreground/15'
: 'border-border/50 bg-muted/30 text-muted-foreground hover:border-border hover:bg-muted/50 hover:text-foreground'
)}
>
<DefaultAgentPill active={isBlankDefault} onClick={() => setDefault('blank')}>
<Terminal className="size-3.5" />
No agent (blank terminal)
{isBlankDefault && <Check className="size-3.5" />}
</button>
</DefaultAgentPill>
{/* Detected agent pills */}
{detectedAgents.map((agent) => {
const isActive = defaultAgent === agent.id
return (
<button
<DefaultAgentPill
key={agent.id}
type="button"
active={isActive}
onClick={() => setDefault(agent.id)}
className={cn(
'flex items-center gap-2 rounded-xl border px-3 py-2 text-sm transition-all',
isActive
? 'border-foreground/20 bg-foreground/8 font-medium ring-1 ring-foreground/15'
: 'border-border/50 bg-muted/30 text-muted-foreground hover:border-border hover:bg-muted/50 hover:text-foreground'
)}
>
<AgentIcon agent={agent.id} size={14} />
{agent.label}
{isActive && <Check className="size-3.5" />}
</button>
</DefaultAgentPill>
)
})}
</div>
@@ -339,32 +318,32 @@ export function AgentsPane({ settings, updateSettings }: AgentsPaneProps): React
<AgentAwakeSetting settings={settings} updateSettings={updateSettings} />
{/* Detected agents */}
{detectedAgents.length > 0 && (
<section className="space-y-3">
<div className="flex items-center gap-3">
<h3 className="text-sm font-semibold">Installed</h3>
<span className="rounded-full border border-emerald-500/30 bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-700 dark:text-emerald-300">
{detectedAgents.length} detected
</span>
<button
type="button"
onClick={handleRefresh}
disabled={isRefreshing}
title="Re-read your shell PATH and re-detect installed agents"
className={cn(
'ml-auto flex items-center gap-1.5 rounded-lg px-2 py-1 text-[11px] font-medium transition-colors',
isRefreshing
? 'text-muted-foreground/60'
: 'text-muted-foreground hover:bg-muted/60 hover:text-foreground'
)}
>
<RefreshCw className={cn('size-3', isRefreshing && 'animate-spin')} />
{isRefreshing ? 'Refreshing…' : 'Refresh'}
</button>
</div>
<SettingsSubsectionHeader
title={
<span className="flex items-center gap-2">
Installed
<SettingsBadge tone="accent">{detectedAgents.length} detected</SettingsBadge>
</span>
}
action={
<Button
type="button"
variant="ghost"
size="xs"
onClick={handleRefresh}
disabled={isRefreshing}
title="Re-read your shell PATH and re-detect installed agents"
className="h-7 gap-1.5 text-xs text-muted-foreground hover:text-foreground"
>
<RefreshCw className={cn('size-3', isRefreshing && 'animate-spin')} />
{isRefreshing ? 'Refreshing…' : 'Refresh'}
</Button>
}
/>
<div className="space-y-2">
<div className="divide-y divide-border/40">
{detectedAgents.map((agent) => (
<AgentRow
key={agent.id}
@@ -383,17 +362,18 @@ export function AgentsPane({ settings, updateSettings }: AgentsPaneProps): React
</section>
)}
{/* Undetected agents */}
{undetectedAgents.length > 0 && (
<section className="space-y-3">
<div className="flex items-center gap-3">
<h3 className="text-sm font-semibold text-muted-foreground">Available to install</h3>
<span className="rounded-full border border-border/40 bg-muted/30 px-2 py-0.5 text-[10px] font-medium text-muted-foreground">
{undetectedAgents.length} agents
</span>
</div>
<SettingsSubsectionHeader
title={
<span className="flex items-center gap-2 text-muted-foreground">
Available to install
<SettingsBadge tone="muted">{undetectedAgents.length} agents</SettingsBadge>
</span>
}
/>
<div className="space-y-2">
<div className="divide-y divide-border/40">
{undetectedAgents.map((agent) => (
<AgentRow
key={agent.id}
@@ -413,7 +393,7 @@ export function AgentsPane({ settings, updateSettings }: AgentsPaneProps): React
)}
{detectedIds === null && (
<div className="flex items-center justify-center rounded-xl border border-dashed border-border/50 py-8 text-sm text-muted-foreground">
<div className="flex items-center justify-center rounded-md border border-dashed border-border/50 py-6 text-sm text-muted-foreground">
Detecting installed agents…
</div>
)}
@@ -1,16 +1,21 @@
import type React from 'react'
import type { GlobalSettings, StatusBarItem } from '../../../../shared/types'
import { Label } from '../ui/label'
import { Separator } from '../ui/separator'
import { UIZoomControl } from './UIZoomControl'
import { SearchableSetting } from './SearchableSetting'
import { matchesSettingsSearch, type SettingsSearchEntry } from './settings-search'
import { useAppStore } from '../../store'
import { useShortcutLabel } from '@/hooks/useShortcutLabel'
import { FontAutocomplete } from './SettingsFormControls'
import { useShortcutKeyCombos } from '@/hooks/useShortcutLabel'
import { ShortcutKeyCombo } from '../ShortcutKeyCombo'
import {
FontAutocomplete,
SettingsRow,
SettingsSegmentedControl,
SettingsSubsectionHeader,
SettingsSwitchRow
} from './SettingsFormControls'
import { DEFAULT_APP_FONT_FAMILY } from '../../../../shared/constants'
import { useAvailableStatusBarToggles } from '../status-bar/use-available-status-bar-toggles'
import { SettingsToggleSwitchButton as ToggleSwitchButton } from './SettingsToggleSwitchButton'
type AppearancePaneProps = {
settings: GlobalSettings
@@ -152,6 +157,25 @@ export const APPEARANCE_PANE_SEARCH_ENTRIES: SettingsSearchEntry[] = [
...SIDEBAR_ENTRIES
]
function ShortcutHintList({ combos }: { combos: string[][] }): React.JSX.Element {
if (combos.length === 0) {
return <span className="text-xs text-muted-foreground">Unassigned</span>
}
return (
<span className="inline-flex flex-wrap items-center gap-1 align-middle">
{combos.map((keys) => (
<ShortcutKeyCombo
key={keys.join('-')}
keys={keys}
className="inline-flex gap-0.5"
separatorClassName="text-[10px] text-muted-foreground"
/>
))}
</span>
)
}
export function AppearancePane({
settings,
updateSettings,
@@ -159,255 +183,226 @@ export function AppearancePane({
fontSuggestions
}: AppearancePaneProps): React.JSX.Element {
const searchQuery = useAppStore((state) => state.settingsSearchQuery)
const zoomInLabel = useShortcutLabel('zoom.in')
const zoomOutLabel = useShortcutLabel('zoom.out')
const zoomInKeyCombos = useShortcutKeyCombos('zoom.in')
const zoomOutKeyCombos = useShortcutKeyCombos('zoom.out')
const statusBarItems = useAppStore((state) => state.statusBarItems)
const toggleStatusBarItem = useAppStore((state) => state.toggleStatusBarItem)
const visibleStatusBarToggles = useAvailableStatusBarToggles(STATUS_BAR_TOGGLES)
const visibleSections = [
matchesSettingsSearch(searchQuery, THEME_ENTRIES) ? (
<section key="theme" className="space-y-4">
<div className="space-y-1">
<h3 className="text-sm font-semibold">Theme</h3>
<p className="text-xs text-muted-foreground">Choose how Orca looks in the app window.</p>
</div>
<SearchableSetting
title="Theme"
description="Choose how Orca looks in the app window."
keywords={['dark', 'light', 'system']}
>
<div className="flex w-fit gap-1 rounded-md border border-border/50 p-1">
{(['system', 'dark', 'light'] as const).map((option) => (
<button
key={option}
onClick={() => {
updateSettings({ theme: option })
applyTheme(option)
}}
className={`rounded-sm px-3 py-1 text-sm capitalize transition-colors ${
settings.theme === option
? 'bg-accent font-medium text-accent-foreground'
: 'text-muted-foreground hover:text-foreground'
}`}
>
{option}
</button>
))}
</div>
</SearchableSetting>
</section>
) : null,
matchesSettingsSearch(searchQuery, ZOOM_ENTRIES) ? (
<section key="zoom" className="space-y-4">
<div className="space-y-1">
<h3 className="text-sm font-semibold">UI Zoom</h3>
<p className="text-xs text-muted-foreground">
Scale the entire application interface. Use{' '}
<kbd className="rounded border px-1 py-0.5 text-[10px]">{zoomInLabel}</kbd> /{' '}
<kbd className="rounded border px-1 py-0.5 text-[10px]">{zoomOutLabel}</kbd> when not in
a terminal pane.
</p>
</div>
<SearchableSetting
title="UI Zoom"
description="Scale the entire application interface."
keywords={['zoom', 'scale', 'shortcut']}
>
<UIZoomControl />
</SearchableSetting>
</section>
) : null,
matchesSettingsSearch(searchQuery, THEME_ENTRIES) ||
matchesSettingsSearch(searchQuery, ZOOM_ENTRIES) ||
matchesSettingsSearch(searchQuery, TYPOGRAPHY_ENTRIES) ? (
<section key="typography" className="space-y-4">
<div className="space-y-1">
<h3 className="text-sm font-semibold">Typography</h3>
<p className="text-xs text-muted-foreground">
Choose the font used by the Orca interface.
</p>
</div>
<section key="interface" className="divide-y divide-border/40">
{matchesSettingsSearch(searchQuery, THEME_ENTRIES) ? (
<SearchableSetting
title="Theme"
description="Choose how Orca looks in the app window."
keywords={['dark', 'light', 'system']}
>
<SettingsRow
label="Theme"
description="Choose how Orca looks in the app window."
control={
<SettingsSegmentedControl
ariaLabel="Theme"
value={settings.theme}
onChange={(option) => {
updateSettings({ theme: option })
applyTheme(option)
}}
options={[
{ value: 'system', label: 'System' },
{ value: 'dark', label: 'Dark' },
{ value: 'light', label: 'Light' }
]}
/>
}
/>
</SearchableSetting>
) : null}
<SearchableSetting
title="IDE Font"
description="Choose the font used by the Orca interface."
keywords={['font', 'typeface', 'typography', 'ide', 'orca', 'interface', 'app', 'ui']}
className="space-y-2"
>
<Label>IDE Font</Label>
<FontAutocomplete
value={settings.appFontFamily}
suggestions={fontSuggestions}
placeholder={DEFAULT_APP_FONT_FAMILY}
onChange={(value) =>
updateSettings({ appFontFamily: value.trim() || DEFAULT_APP_FONT_FAMILY })
}
/>
</SearchableSetting>
{matchesSettingsSearch(searchQuery, ZOOM_ENTRIES) ? (
<SearchableSetting
title="UI Zoom"
description="Scale the entire application interface."
keywords={['zoom', 'scale', 'shortcut']}
>
<SettingsRow
label="UI Zoom"
description={
<>
Scale the entire application interface. Use{' '}
<ShortcutHintList combos={zoomInKeyCombos} /> /{' '}
<ShortcutHintList combos={zoomOutKeyCombos} /> when not in a terminal pane.
</>
}
control={<UIZoomControl />}
/>
</SearchableSetting>
) : null}
{matchesSettingsSearch(searchQuery, TYPOGRAPHY_ENTRIES) ? (
<SearchableSetting
title="IDE Font"
description="Choose the font used by the Orca interface."
keywords={['font', 'typeface', 'typography', 'ide', 'orca', 'interface', 'app', 'ui']}
>
<SettingsRow
alignTop
label="IDE Font"
description="Choose the font used by the Orca interface."
control={
<FontAutocomplete
value={settings.appFontFamily}
suggestions={fontSuggestions}
placeholder={DEFAULT_APP_FONT_FAMILY}
onChange={(value) =>
updateSettings({ appFontFamily: value.trim() || DEFAULT_APP_FONT_FAMILY })
}
/>
}
/>
</SearchableSetting>
) : null}
</section>
) : null,
matchesSettingsSearch(searchQuery, LAYOUT_ENTRIES) ? (
<section key="layout" className="space-y-4">
<div className="space-y-1">
<h3 className="text-sm font-semibold">Layout</h3>
<p className="text-xs text-muted-foreground">
Default layout when creating new worktrees.
</p>
<section key="layout" className="space-y-3">
<SettingsSubsectionHeader
title="Layout"
description="Default layout when creating new worktrees."
/>
<div className="divide-y divide-border/40">
<SearchableSetting
title="Open Right Sidebar by Default"
description="Automatically expand the file explorer panel when creating a new worktree."
keywords={['layout', 'file explorer', 'sidebar']}
>
<SettingsSwitchRow
label="Open Right Sidebar by Default"
description="Automatically expand the file explorer panel when creating a new worktree."
checked={settings.rightSidebarOpenByDefault}
onChange={() =>
updateSettings({ rightSidebarOpenByDefault: !settings.rightSidebarOpenByDefault })
}
/>
</SearchableSetting>
<SearchableSetting
title="Show Git-Ignored Files"
description="Show files matched by .gitignore in the file explorer."
keywords={['git', 'gitignore', 'ignored', 'file explorer', 'sidebar', 'hide']}
>
<SettingsSwitchRow
label="Show Git-Ignored Files"
description="Turn off to hide files matched by .gitignore from the file explorer."
checked={settings.showGitIgnoredFiles ?? true}
onChange={() =>
updateSettings({ showGitIgnoredFiles: !(settings.showGitIgnoredFiles ?? true) })
}
/>
</SearchableSetting>
</div>
<SearchableSetting
title="Open Right Sidebar by Default"
description="Automatically expand the file explorer panel when creating a new worktree."
keywords={['layout', 'file explorer', 'sidebar']}
className="flex items-center justify-between gap-4 px-1 py-2"
>
<div className="space-y-0.5">
<Label>Open Right Sidebar by Default</Label>
<p className="text-xs text-muted-foreground">
Automatically expand the file explorer panel when creating a new worktree.
</p>
</div>
<ToggleSwitchButton
checked={settings.rightSidebarOpenByDefault}
onToggle={() =>
updateSettings({ rightSidebarOpenByDefault: !settings.rightSidebarOpenByDefault })
}
/>
</SearchableSetting>
<SearchableSetting
title="Show Git-Ignored Files"
description="Show files matched by .gitignore in the file explorer."
keywords={['git', 'gitignore', 'ignored', 'file explorer', 'sidebar', 'hide']}
className="flex items-center justify-between gap-4 px-1 py-2"
>
<div className="space-y-0.5">
<Label>Show Git-Ignored Files</Label>
<p className="text-xs text-muted-foreground">
Turn off to hide files matched by .gitignore from the file explorer.
</p>
</div>
<ToggleSwitchButton
checked={settings.showGitIgnoredFiles ?? true}
onToggle={() =>
updateSettings({ showGitIgnoredFiles: !(settings.showGitIgnoredFiles ?? true) })
}
/>
</SearchableSetting>
</section>
) : null,
matchesSettingsSearch(searchQuery, TITLEBAR_ENTRIES) ? (
<section key="titlebar" className="space-y-4">
<div className="space-y-1">
<h3 className="text-sm font-semibold">Titlebar</h3>
<p className="text-xs text-muted-foreground">
Control what appears in the application titlebar.
</p>
</div>
<section key="titlebar" className="space-y-3">
<SettingsSubsectionHeader
title="Titlebar"
description="Control what appears in the application titlebar."
/>
<SearchableSetting
title="Titlebar App Name"
description="Show Orca in the titlebar."
keywords={['titlebar', 'orca', 'app', 'name', 'brand']}
className="flex items-center justify-between gap-4 px-1 py-2"
>
<div className="space-y-0.5">
<Label>Titlebar App Name</Label>
<p className="text-xs text-muted-foreground">Show Orca in the titlebar.</p>
</div>
<ToggleSwitchButton
checked={settings.showTitlebarAppName}
onToggle={() => updateSettings({ showTitlebarAppName: !settings.showTitlebarAppName })}
/>
</SearchableSetting>
<div className="divide-y divide-border/40">
<SearchableSetting
title="Titlebar App Name"
description="Show Orca in the titlebar."
keywords={['titlebar', 'orca', 'app', 'name', 'brand']}
>
<SettingsSwitchRow
label="Titlebar App Name"
description="Show Orca in the titlebar."
checked={settings.showTitlebarAppName}
onChange={() =>
updateSettings({ showTitlebarAppName: !settings.showTitlebarAppName })
}
/>
</SearchableSetting>
</div>
</section>
) : null,
matchesSettingsSearch(searchQuery, STATUS_BAR_ENTRIES) ? (
<section key="status-bar" className="space-y-4">
<div className="space-y-1">
<h3 className="text-sm font-semibold">Status Bar</h3>
<p className="text-xs text-muted-foreground">
Choose which indicators appear at the bottom of the window. You can also right-click the
status bar for the same toggles.
</p>
</div>
<section key="status-bar" className="space-y-3">
<SettingsSubsectionHeader
title="Status Bar"
description="Choose which indicators appear at the bottom of the window. You can also right-click the status bar for the same toggles."
/>
{visibleStatusBarToggles.map((toggle) => {
const enabled = statusBarItems.includes(toggle.id)
return (
<SearchableSetting
key={toggle.id}
title={toggle.title}
description={toggle.description}
keywords={toggle.keywords}
className="flex items-center justify-between gap-4 px-1 py-2"
>
<div className="space-y-0.5">
<Label>{toggle.title}</Label>
<p className="text-xs text-muted-foreground">{toggle.toggleDescription}</p>
</div>
<ToggleSwitchButton
checked={enabled}
onToggle={() => toggleStatusBarItem(toggle.id)}
ariaLabel={toggle.title}
/>
</SearchableSetting>
)
})}
<div className="divide-y divide-border/40">
{visibleStatusBarToggles.map((toggle) => {
const enabled = statusBarItems.includes(toggle.id)
return (
<SearchableSetting
key={toggle.id}
title={toggle.title}
description={toggle.description}
keywords={toggle.keywords}
>
<SettingsSwitchRow
label={toggle.title}
description={toggle.toggleDescription}
checked={enabled}
onChange={() => toggleStatusBarItem(toggle.id)}
ariaLabel={toggle.title}
/>
</SearchableSetting>
)
})}
</div>
</section>
) : null,
matchesSettingsSearch(searchQuery, SIDEBAR_ENTRIES) ? (
<section key="sidebar" className="space-y-4">
<div className="space-y-1">
<h3 className="text-sm font-semibold">Sidebar</h3>
<section key="sidebar" className="space-y-3">
<SettingsSubsectionHeader title="Sidebar" />
<div className="divide-y divide-border/40">
<SearchableSetting
title="Show Tasks Button"
description="Show the Tasks button at the top of the left sidebar."
keywords={['tasks', 'sidebar', 'button', 'hide', 'show', 'github', 'linear']}
>
<SettingsSwitchRow
label="Show Tasks Button"
description="Show the Tasks button at the top of the left sidebar."
checked={settings.showTasksButton}
onChange={() => updateSettings({ showTasksButton: !settings.showTasksButton })}
/>
</SearchableSetting>
<SearchableSetting
title="Show Orca Mobile Button"
description="Show the Orca Mobile button at the top of the left sidebar."
keywords={['mobile', 'phone', 'sidebar', 'button', 'hide', 'show', 'toolbox']}
>
<SettingsSwitchRow
label="Show Orca Mobile Button"
description="Show the Orca Mobile shortcut in the sidebar. It remains available from Toolbox."
checked={settings.showMobileButton !== false}
onChange={() =>
updateSettings({ showMobileButton: !(settings.showMobileButton !== false) })
}
/>
</SearchableSetting>
</div>
<SearchableSetting
title="Show Tasks Button"
description="Show the Tasks button at the top of the left sidebar."
keywords={['tasks', 'sidebar', 'button', 'hide', 'show', 'github', 'linear']}
className="flex items-center justify-between gap-4 px-1 py-2"
>
<div className="space-y-0.5">
<Label>Show Tasks Button</Label>
<p className="text-xs text-muted-foreground">
Show the Tasks button at the top of the left sidebar.
</p>
</div>
<ToggleSwitchButton
checked={settings.showTasksButton}
onToggle={() => updateSettings({ showTasksButton: !settings.showTasksButton })}
/>
</SearchableSetting>
<SearchableSetting
title="Show Orca Mobile Button"
description="Show the Orca Mobile button at the top of the left sidebar."
keywords={['mobile', 'phone', 'sidebar', 'button', 'hide', 'show', 'toolbox']}
className="flex items-center justify-between gap-4 px-1 py-2"
>
<div className="space-y-0.5">
<Label>Show Orca Mobile Button</Label>
<p className="text-xs text-muted-foreground">
Show the Orca Mobile shortcut in the sidebar. It remains available from Toolbox.
</p>
</div>
<ToggleSwitchButton
checked={settings.showMobileButton !== false}
onToggle={() =>
updateSettings({ showMobileButton: !(settings.showMobileButton !== false) })
}
/>
</SearchableSetting>
</section>
) : null
].filter(Boolean)
return (
<div className="space-y-8">
<div className="space-y-6">
{visibleSections.map((section, index) => (
<div key={index} className="space-y-8">
<div key={index} className="space-y-6">
{index > 0 ? <Separator /> : null}
{section}
</div>
@@ -104,7 +104,7 @@ export function BrowserPane({
title="Default Home Page"
description="URL opened when creating a new browser tab. Leave empty to open a blank tab."
keywords={['browser', 'home', 'homepage', 'default', 'url', 'new tab', 'blank']}
className="flex items-start justify-between gap-4 px-1 py-2"
className="flex items-start justify-between gap-4 py-2"
>
<div className="min-w-0 shrink space-y-0.5">
<Label>Default Home Page</Label>
@@ -162,7 +162,7 @@ export function BrowserPane({
'token',
'omnibox'
]}
className="flex items-start justify-between gap-4 px-1 py-2"
className="flex items-start justify-between gap-4 py-2"
>
<div className="space-y-0.5">
<Label>Default Search Engine</Label>
@@ -208,7 +208,7 @@ export function BrowserPane({
'file',
'editor'
]}
className="flex items-center justify-between gap-4 px-1 py-2"
className="flex items-center justify-between gap-4 py-2"
>
<div className="space-y-0.5">
<Label>Link Routing</Label>
@@ -250,7 +250,7 @@ export function BrowserPane({
'arc',
'profile'
]}
className="space-y-3 px-1 py-2"
className="space-y-3 py-2"
>
<div className="flex items-center justify-between gap-3">
<div className="space-y-0.5">
@@ -180,7 +180,7 @@ export function BrowserUseSetup({
if (!browserUseEnabled) {
return (
<div className="flex items-center justify-between gap-4 px-1 py-2">
<div className="flex items-center justify-between gap-4 py-2">
<div className="space-y-0.5">
<p className="text-sm font-medium">Agent Browser Use</p>
<p className="text-xs text-muted-foreground">
@@ -585,7 +585,7 @@ export function CommitMessageAiPane({
title="Enable AI commit messages"
description="Adds a Generate button to the Source Control panel."
keywords={['ai', 'commit', 'message', 'generate', 'agent', 'enabled']}
className="flex items-center justify-between gap-4 px-1 py-2"
className="flex items-center justify-between gap-4 py-2"
>
<div className="space-y-0.5">
<Label>Enable AI commit messages</Label>
@@ -627,7 +627,7 @@ export function CommitMessageAiPane({
title="Agent"
description="Which agent to invoke when generating a commit message."
keywords={['agent', 'claude', 'codex', 'opencode', 'gemini', 'cursor']}
className="flex items-center justify-between gap-4 px-1 py-2"
className="flex items-center justify-between gap-4 py-2"
>
<div className="space-y-0.5">
<Label>Agent</Label>
@@ -707,7 +707,7 @@ export function CommitMessageAiPane({
title="Custom command"
description="Command line Orca runs to generate the commit message."
keywords={['custom', 'command', 'cli', 'binary', 'prompt', 'placeholder']}
className="space-y-2 px-1 py-2"
className="space-y-2 py-2"
>
<div className="space-y-0.5">
<Label htmlFor="commit-message-ai-custom-command">Custom command</Label>
@@ -755,7 +755,7 @@ export function CommitMessageAiPane({
title="Model"
description="Which model the selected agent uses to generate the message."
keywords={['model', 'haiku', 'sonnet', 'opus', 'gpt']}
className="flex items-center justify-between gap-4 px-1 py-2"
className="flex items-center justify-between gap-4 py-2"
>
<div className="space-y-0.5">
<Label>Model</Label>
@@ -816,7 +816,7 @@ export function CommitMessageAiPane({
title="Thinking effort"
description="Reasoning effort level for the selected model. Higher levels are slower."
keywords={['thinking', 'effort', 'reasoning']}
className="flex items-center justify-between gap-4 px-1 py-2"
className="flex items-center justify-between gap-4 py-2"
>
<div className="space-y-0.5">
<Label>Thinking effort</Label>
@@ -857,7 +857,7 @@ export function CommitMessageAiPane({
description="Optional instructions appended to the base prompt (e.g. Conventional Commits style)."
keywords={['prompt', 'conventional commits', 'gitmoji', 'style']}
forceVisible={isCustomPromptDirty}
className="space-y-2 px-1 py-2"
className="space-y-2 py-2"
>
<div className="space-y-0.5">
<Label htmlFor="commit-message-ai-custom-prompt">Custom prompt</Label>
@@ -35,7 +35,7 @@ export function ExperimentalPane({
title="Pet"
description="Floating animated pet in the bottom-right corner."
keywords={EXPERIMENTAL_SEARCH_ENTRY.pet.keywords}
className="space-y-3 px-1 py-2"
className="space-y-3 py-2"
id="experimental-pet"
>
<div className="flex items-start justify-between gap-4">
@@ -74,7 +74,7 @@ export function ExperimentalPane({
title="Agents View"
description="Threaded left-sidebar feed for agent completions and blocking states."
keywords={EXPERIMENTAL_SEARCH_ENTRY.activity.keywords}
className="space-y-3 px-1 py-2"
className="space-y-3 py-2"
>
<div className="flex items-start justify-between gap-4">
<div className="min-w-0 shrink space-y-0.5">
@@ -113,7 +113,7 @@ export function ExperimentalPane({
title="Symlinks on worktrees"
description="Automatically symlink configured files or folders into newly created worktrees."
keywords={EXPERIMENTAL_SEARCH_ENTRY.symlinks.keywords}
className="space-y-3 px-1 py-2"
className="space-y-3 py-2"
>
<div className="flex items-start justify-between gap-4">
<div className="min-w-0 shrink space-y-0.5">
@@ -3,9 +3,9 @@ import { FolderOpen } from 'lucide-react'
import type { FloatingTerminalTriggerLocation, GlobalSettings } from '../../../../shared/types'
import { Button } from '../ui/button'
import { Input } from '../ui/input'
import { Label } from '../ui/label'
import { ToggleGroup, ToggleGroupItem } from '../ui/toggle-group'
import { SearchableSetting } from './SearchableSetting'
import { SettingsRow, SettingsSwitchRow } from './SettingsFormControls'
import { FLOATING_WORKSPACE_SEARCH_ENTRIES } from './floating-workspace-search'
import { matchesSettingsSearch } from './settings-search'
import { useAppStore } from '../../store'
@@ -90,84 +90,65 @@ export function FloatingWorkspacePane({
'quick panel',
'launch directory'
]}
className="space-y-3"
className="divide-y divide-border/40"
>
<div className="flex items-center justify-between gap-4 px-1 py-2">
<div className="space-y-0.5">
<Label>Enable Floating Workspace</Label>
<p className="text-xs text-muted-foreground">
Shows the floating workspace button and panel.
</p>
</div>
<button
type="button"
role="switch"
aria-label="Enable Floating Workspace"
aria-checked={settings.floatingTerminalEnabled}
onClick={() =>
updateSettings({
floatingTerminalEnabled: !settings.floatingTerminalEnabled
})
}
className={`relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors ${
settings.floatingTerminalEnabled ? 'bg-foreground' : 'bg-muted-foreground/30'
}`}
>
<span
className={`pointer-events-none block size-3.5 rounded-full bg-background shadow-sm transition-transform ${
settings.floatingTerminalEnabled ? 'translate-x-4' : 'translate-x-0.5'
}`}
/>
</button>
</div>
<SettingsSwitchRow
label="Enable Floating Workspace"
description="Shows the floating workspace button and panel."
checked={settings.floatingTerminalEnabled}
onChange={() =>
updateSettings({
floatingTerminalEnabled: !settings.floatingTerminalEnabled
})
}
/>
<div className="space-y-2">
<Label>Terminal Directory</Label>
<div className="flex max-w-xl gap-2">
<Input
value={directoryInputValue}
readOnly
placeholder="~"
className="min-w-0 flex-1"
/>
<Button
type="button"
variant="outline"
size="icon"
aria-label="Choose floating workspace directory"
onClick={() => void pickFloatingWorkspaceDirectory()}
<SettingsRow
alignTop
label="Terminal Directory"
description="New floating terminal tabs start here. Markdown notes are saved in Orca's app-owned floating workspace."
control={
<div className="flex w-72 max-w-full gap-2">
<Input
value={directoryInputValue}
readOnly
placeholder="~"
className="min-w-0 flex-1"
/>
<Button
type="button"
variant="outline"
size="icon"
aria-label="Choose floating workspace directory"
onClick={() => void pickFloatingWorkspaceDirectory()}
>
<FolderOpen className="size-4" />
</Button>
</div>
}
/>
<SettingsRow
label="Toggle Button Location"
description="The keyboard shortcut works regardless of where the toggle is shown."
control={
<ToggleGroup
type="single"
value={settings.floatingTerminalTriggerLocation ?? 'floating-button'}
onValueChange={(value) => {
if (!value) {
return
}
updateSettings({
floatingTerminalTriggerLocation: value as FloatingTerminalTriggerLocation
})
}}
>
<FolderOpen className="size-4" />
</Button>
</div>
<p className="text-xs text-muted-foreground">
New floating terminal tabs start here. Markdown notes are saved in Orca&apos;s app-owned
floating workspace.
</p>
</div>
<div className="space-y-2">
<Label>Toggle Button Location</Label>
<ToggleGroup
type="single"
value={settings.floatingTerminalTriggerLocation ?? 'floating-button'}
onValueChange={(value) => {
if (!value) {
return
}
updateSettings({
floatingTerminalTriggerLocation: value as FloatingTerminalTriggerLocation
})
}}
className="justify-start"
>
<ToggleGroupItem value="floating-button">Floating Button</ToggleGroupItem>
<ToggleGroupItem value="status-bar">Status Bar</ToggleGroupItem>
</ToggleGroup>
<p className="text-xs text-muted-foreground">
The keyboard shortcut works regardless of where the toggle is shown.
</p>
</div>
<ToggleGroupItem value="floating-button">Floating Button</ToggleGroupItem>
<ToggleGroupItem value="status-bar">Status Bar</ToggleGroupItem>
</ToggleGroup>
}
/>
</SearchableSetting>
</section>
)
@@ -30,6 +30,12 @@ import {
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select'
import { SearchableSetting } from './SearchableSetting'
import { matchesSettingsSearch } from './settings-search'
import {
SettingsSegmentedControl,
SettingsSubsectionHeader,
SettingsSwitch,
SettingsSwitchRow
} from './SettingsFormControls'
function createOpenInApplication(): OpenInApplication {
return {
@@ -216,12 +222,10 @@ export function GeneralPane({ settings, updateSettings }: GeneralPaneProps): Rea
const visibleSections = [
matchesSettingsSearch(searchQuery, GENERAL_WORKSPACE_SEARCH_ENTRIES) ? (
<section key="workspace" className="space-y-4">
<div className="space-y-1">
<h3 className="text-sm font-semibold">Workspace</h3>
<p className="text-xs text-muted-foreground">
Configure where new workspaces are created.
</p>
</div>
<SettingsSubsectionHeader
title="Workspace"
description="Configure where new workspaces are created."
/>
<SearchableSetting
title="Workspace Directory"
@@ -255,32 +259,13 @@ export function GeneralPane({ settings, updateSettings }: GeneralPaneProps): Rea
title="Nest Workspaces"
description="Create workspaces inside a repo-named subfolder."
keywords={['nested', 'subfolder', 'directory']}
className="flex items-center justify-between gap-4 px-1 py-2"
>
<div className="space-y-0.5">
<Label>Nest Workspaces</Label>
<p className="text-xs text-muted-foreground">
Create workspaces inside a repo-named subfolder.
</p>
</div>
<button
role="switch"
aria-checked={settings.nestWorkspaces}
onClick={() =>
updateSettings({
nestWorkspaces: !settings.nestWorkspaces
})
}
className={`relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors ${
settings.nestWorkspaces ? 'bg-foreground' : 'bg-muted-foreground/30'
}`}
>
<span
className={`pointer-events-none block size-3.5 rounded-full bg-background shadow-sm transition-transform ${
settings.nestWorkspaces ? 'translate-x-4' : 'translate-x-0.5'
}`}
/>
</button>
<SettingsSwitchRow
label="Nest Workspaces"
description="Create workspaces inside a repo-named subfolder."
checked={settings.nestWorkspaces}
onChange={() => updateSettings({ nestWorkspaces: !settings.nestWorkspaces })}
/>
</SearchableSetting>
{/* Why: the "Don't ask again" toast in the delete-worktree dialog
@@ -291,33 +276,17 @@ export function GeneralPane({ settings, updateSettings }: GeneralPaneProps): Rea
title="Ask Before Deleting Workspaces"
description="Show a confirmation dialog before deleting a workspace."
keywords={['delete', 'worktree', 'confirm', 'dialog', 'skip', 'prompt']}
className="flex items-center justify-between gap-4 px-1 py-2"
>
<div className="space-y-0.5">
<Label>Ask Before Deleting Workspaces</Label>
<p className="text-xs text-muted-foreground">
Show a confirmation before deleting a workspace from the context menu. Failed
deletes still surface a Force Delete fallback.
</p>
</div>
<button
role="switch"
aria-checked={!settings.skipDeleteWorktreeConfirm}
onClick={() =>
<SettingsSwitchRow
label="Ask Before Deleting Workspaces"
description="Show a confirmation before deleting a workspace from the context menu. Failed deletes still surface a Force Delete fallback."
checked={!settings.skipDeleteWorktreeConfirm}
onChange={() =>
updateSettings({
skipDeleteWorktreeConfirm: !settings.skipDeleteWorktreeConfirm
})
}
className={`relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors ${
!settings.skipDeleteWorktreeConfirm ? 'bg-foreground' : 'bg-muted-foreground/30'
}`}
>
<span
className={`pointer-events-none block size-3.5 rounded-full bg-background shadow-sm transition-transform ${
!settings.skipDeleteWorktreeConfirm ? 'translate-x-4' : 'translate-x-0.5'
}`}
/>
</button>
/>
</SearchableSetting>
</div>
@@ -326,32 +295,17 @@ export function GeneralPane({ settings, updateSettings }: GeneralPaneProps): Rea
title="Ask Before Deleting Automations"
description="Show a confirmation dialog before deleting an automation and its run history."
keywords={['delete', 'automation', 'confirm', 'dialog', 'skip', 'prompt']}
className="flex items-center justify-between gap-4 px-1 py-2"
>
<div className="space-y-0.5">
<Label>Ask Before Deleting Automations</Label>
<p className="text-xs text-muted-foreground">
Show a confirmation before deleting automations and their run history.
</p>
</div>
<button
role="switch"
aria-checked={!settings.skipDeleteAutomationConfirm}
onClick={() =>
<SettingsSwitchRow
label="Ask Before Deleting Automations"
description="Show a confirmation before deleting automations and their run history."
checked={!settings.skipDeleteAutomationConfirm}
onChange={() =>
updateSettings({
skipDeleteAutomationConfirm: !settings.skipDeleteAutomationConfirm
})
}
className={`relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors ${
!settings.skipDeleteAutomationConfirm ? 'bg-foreground' : 'bg-muted-foreground/30'
}`}
>
<span
className={`pointer-events-none block size-3.5 rounded-full bg-background shadow-sm transition-transform ${
!settings.skipDeleteAutomationConfirm ? 'translate-x-4' : 'translate-x-0.5'
}`}
/>
</button>
/>
</SearchableSetting>
</div>
@@ -460,50 +414,31 @@ export function GeneralPane({ settings, updateSettings }: GeneralPaneProps): Rea
) : null,
matchesSettingsSearch(searchQuery, GENERAL_EDITOR_SEARCH_ENTRIES) ? (
<section key="editor" className="space-y-4">
<div className="space-y-1">
<h3 className="text-sm font-semibold">Editor</h3>
<p className="text-xs text-muted-foreground">Configure how Orca persists file edits.</p>
</div>
<SettingsSubsectionHeader
title="Editor"
description="Configure how Orca persists file edits."
/>
<SearchableSetting
title="Auto Save Files"
description="Save editor and editable diff changes automatically after a short pause."
keywords={['autosave', 'save']}
className="flex items-center justify-between gap-4 px-1 py-2"
>
<div className="space-y-0.5">
<Label>Auto Save Files</Label>
<p className="text-xs text-muted-foreground">
Save editor and editable diff changes automatically after a short pause.
</p>
</div>
<button
role="switch"
aria-checked={settings.editorAutoSave}
onClick={() =>
updateSettings({
editorAutoSave: !settings.editorAutoSave
})
}
className={`relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors ${
settings.editorAutoSave ? 'bg-foreground' : 'bg-muted-foreground/30'
}`}
>
<span
className={`pointer-events-none block size-3.5 rounded-full bg-background shadow-sm transition-transform ${
settings.editorAutoSave ? 'translate-x-4' : 'translate-x-0.5'
}`}
/>
</button>
<SettingsSwitchRow
label="Auto Save Files"
description="Save editor and editable diff changes automatically after a short pause."
checked={settings.editorAutoSave}
onChange={() => updateSettings({ editorAutoSave: !settings.editorAutoSave })}
/>
</SearchableSetting>
<SearchableSetting
title="Auto Save Delay"
description="How long Orca waits after your last edit before saving automatically."
keywords={['autosave', 'delay', 'milliseconds']}
className="flex items-center justify-between gap-4 px-1 py-2"
className="flex items-center justify-between gap-4 py-2"
>
<div className="space-y-0.5">
<div className="min-w-0 flex-1 space-y-0.5">
<Label>Auto Save Delay</Label>
<p className="text-xs text-muted-foreground">
How long Orca waits after your last edit before saving automatically. First launch
@@ -534,96 +469,78 @@ export function GeneralPane({ settings, updateSettings }: GeneralPaneProps): Rea
title="Default Diff View"
description="Preferred presentation format for showing git diffs by default."
keywords={['diff', 'view', 'inline', 'side-by-side', 'split']}
className="flex flex-col items-start gap-3 px-1 py-2 sm:flex-row sm:items-center sm:justify-between"
className="flex items-center justify-between gap-4 py-2"
>
<div className="space-y-0.5">
<div className="min-w-0 flex-1 space-y-0.5">
<Label>Default Diff View</Label>
<p className="text-xs text-muted-foreground">
Preferred presentation format for showing git diffs by default.
</p>
</div>
<div className="flex shrink-0 items-center rounded-md border border-border/60 bg-background/50 p-0.5">
{(['inline', 'side-by-side'] as const).map((option) => (
<button
key={option}
onClick={() => updateSettings({ diffDefaultView: option })}
className={`rounded-sm px-3 py-1 text-sm transition-colors ${
settings.diffDefaultView === option
? 'bg-accent font-medium text-accent-foreground'
: 'text-muted-foreground hover:text-foreground'
}`}
>
{option === 'inline' ? 'Inline' : 'Side-by-side'}
</button>
))}
</div>
<SettingsSegmentedControl
ariaLabel="Default Diff View"
value={settings.diffDefaultView}
onChange={(option) => updateSettings({ diffDefaultView: option })}
options={[
{ value: 'inline', label: 'Inline' },
{ value: 'side-by-side', label: 'Side-by-side' }
]}
/>
</SearchableSetting>
<SearchableSetting
title="Default Diff File Tree"
description="Show or hide the file tree when opening combined diff views."
keywords={['diff', 'tree', 'file tree', 'combined diff', 'sidebar']}
className="flex flex-col items-start gap-3 px-1 py-2 sm:flex-row sm:items-center sm:justify-between"
className="flex items-center justify-between gap-4 py-2"
>
<div className="space-y-0.5">
<div className="min-w-0 flex-1 space-y-0.5">
<Label>Default Diff File Tree</Label>
<p className="text-xs text-muted-foreground">
Show or hide the file tree when opening combined diff views.
</p>
</div>
<div className="flex shrink-0 items-center rounded-md border border-border/60 bg-background/50 p-0.5">
{[
{ label: 'Shown', value: true },
{ label: 'Hidden', value: false }
].map((option) => (
<button
key={option.label}
type="button"
onClick={() =>
updateSettings({ combinedDiffFileTreeVisibleByDefault: option.value })
}
className={`rounded-sm px-3 py-1 text-sm transition-colors ${
settings.combinedDiffFileTreeVisibleByDefault === option.value
? 'bg-accent font-medium text-accent-foreground'
: 'text-muted-foreground hover:text-foreground'
}`}
>
{option.label}
</button>
))}
</div>
<SettingsSegmentedControl
ariaLabel="Default Diff File Tree"
value={settings.combinedDiffFileTreeVisibleByDefault ? 'shown' : 'hidden'}
onChange={(option) =>
updateSettings({ combinedDiffFileTreeVisibleByDefault: option === 'shown' })
}
options={[
{ value: 'shown', label: 'Shown' },
{ value: 'hidden', label: 'Hidden' }
]}
/>
</SearchableSetting>
<SearchableSetting
title="Minimap"
description="Show the minimap overview when editing a file."
keywords={['minimap', 'overview', 'code', 'scroll']}
className="flex items-center justify-between gap-4 px-1 py-2"
>
<div className="space-y-0.5">
<Label>Minimap</Label>
<p className="text-xs text-muted-foreground">
Show the minimap overview when editing a file.
</p>
</div>
<button
role="switch"
aria-checked={settings.editorMinimapEnabled}
onClick={() =>
updateSettings({
editorMinimapEnabled: !settings.editorMinimapEnabled
})
<SettingsSwitchRow
label="Minimap"
description="Show the minimap overview when editing a file."
checked={settings.editorMinimapEnabled}
onChange={() =>
updateSettings({ editorMinimapEnabled: !settings.editorMinimapEnabled })
}
className={`relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors ${
settings.editorMinimapEnabled ? 'bg-foreground' : 'bg-muted-foreground/30'
}`}
>
<span
className={`pointer-events-none block size-3.5 rounded-full bg-background shadow-sm transition-transform ${
settings.editorMinimapEnabled ? 'translate-x-4' : 'translate-x-0.5'
}`}
/>
</button>
/>
</SearchableSetting>
<SearchableSetting
title="Markdown Review Notes"
description="Show local markdown review note controls in rich editor mode."
keywords={['markdown', 'review', 'notes', 'annotations', 'agents']}
>
<SettingsSwitchRow
label="Markdown Review Notes"
description="Show local markdown note controls in rich editor mode and agent handoff actions."
checked={settings.markdownReviewToolsEnabled}
onChange={() =>
updateSettings({ markdownReviewToolsEnabled: !settings.markdownReviewToolsEnabled })
}
/>
</SearchableSetting>
</section>
) : null,
@@ -635,62 +552,41 @@ export function GeneralPane({ settings, updateSettings }: GeneralPaneProps): Rea
) : null,
matchesSettingsSearch(searchQuery, GENERAL_CACHE_TIMER_SEARCH_ENTRIES) ? (
<section key="cache-timer" className="space-y-4">
<div className="space-y-1">
<h3 className="text-sm font-semibold">Prompt Cache Timer</h3>
<p className="text-xs text-muted-foreground">
Claude caches your conversation to reduce costs. When idle too long the cache expires
and the next message resends full context at higher cost. This shows a countdown so you
know when to resume.
</p>
</div>
<SettingsSubsectionHeader
title="Prompt Cache Timer"
description="Claude caches your conversation to reduce costs. When idle too long the cache expires and the next message resends full context at higher cost. This shows a countdown so you know when to resume."
/>
<SearchableSetting
title="Cache Timer"
description="Show a countdown after a Claude agent becomes idle."
// Why: this is the primary control for the section gated by
// GENERAL_CACHE_TIMER_SEARCH_ENTRIES (title "Prompt Cache Timer").
// Mirroring those keywords keeps a search for "Prompt Cache Timer"
// from rendering the section header with no body underneath.
keywords={GENERAL_CACHE_TIMER_SEARCH_ENTRIES.flatMap((entry) => [
entry.title,
entry.description ?? '',
...(entry.keywords ?? [])
])}
className="flex items-center justify-between gap-4 px-1 py-2"
className="flex items-center justify-between gap-4 py-2"
>
<div className="space-y-0.5">
<div className="min-w-0 flex-1 space-y-0.5">
<div className="flex items-center gap-2">
<Timer className="size-4" />
<Timer className="size-4 text-muted-foreground" />
<Label>Cache Timer</Label>
</div>
<p className="text-xs text-muted-foreground">
Show a countdown in the sidebar after a Claude agent becomes idle.
</p>
</div>
<button
role="switch"
aria-checked={settings.promptCacheTimerEnabled}
aria-label="Cache Timer"
onClick={() => {
<SettingsSwitch
ariaLabel="Cache Timer"
checked={settings.promptCacheTimerEnabled}
onChange={() => {
const enabling = !settings.promptCacheTimerEnabled
updateSettings({ promptCacheTimerEnabled: enabling })
// Why: if enabling mid-session, seed timers for any Claude tabs that
// are already idle — their working→idle transition already happened
// and won't re-fire.
if (enabling) {
useAppStore.getState().seedCacheTimersForIdleTabs()
}
}}
className={`relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors ${
settings.promptCacheTimerEnabled ? 'bg-foreground' : 'bg-muted-foreground/30'
}`}
>
<span
className={`pointer-events-none block size-3.5 rounded-full bg-background shadow-sm transition-transform ${
settings.promptCacheTimerEnabled ? 'translate-x-4' : 'translate-x-0.5'
}`}
/>
</button>
/>
</SearchableSetting>
{settings.promptCacheTimerEnabled && (
@@ -698,9 +594,9 @@ export function GeneralPane({ settings, updateSettings }: GeneralPaneProps): Rea
title="Timer Duration"
description="Match this to your provider's cache TTL."
keywords={['cache', 'timer', 'duration', 'ttl']}
className="flex items-center justify-between gap-4 px-1 py-2 pl-7"
className="flex items-center justify-between gap-4 py-2 pl-7"
>
<div className="space-y-0.5">
<div className="min-w-0 flex-1 space-y-0.5">
<Label>Timer Duration</Label>
<p className="text-xs text-muted-foreground">
Match this to your provider&apos;s cache TTL. The default is 5 minutes.
@@ -724,10 +620,10 @@ export function GeneralPane({ settings, updateSettings }: GeneralPaneProps): Rea
) : null,
matchesSettingsSearch(searchQuery, GENERAL_UPDATE_SEARCH_ENTRIES) ? (
<section key="updates" className="space-y-4">
<div className="space-y-1">
<h3 className="text-sm font-semibold">Updates</h3>
<p className="text-xs text-muted-foreground">Current version: {appVersion ?? '…'}</p>
</div>
<SettingsSubsectionHeader
title="Updates"
description={`Current version: ${appVersion ?? '…'}`}
/>
<SearchableSetting
title="Check for Updates"
@@ -841,9 +737,9 @@ export function GeneralPane({ settings, updateSettings }: GeneralPaneProps): Rea
].filter(Boolean)
return (
<div className="space-y-8">
<div className="space-y-6">
{visibleSections.map((section, index) => (
<div key={index} className="space-y-8">
<div key={index} className="space-y-6">
{index > 0 ? <Separator /> : null}
{section}
</div>
@@ -889,9 +785,7 @@ function SupportSection({
<div className="space-y-8">
{hasPrecedingSections ? <Separator /> : null}
<div className="space-y-4">
<div className="space-y-1">
<h3 className="text-sm font-semibold">Support Orca</h3>
</div>
<SettingsSubsectionHeader title="Support Orca" />
{state === 'loading' ? <SupportRowSkeleton /> : null}
{state !== 'loading' && state !== 'hidden' ? (
<SupportRow state={state} onStarClick={onStarClick} />
@@ -905,7 +799,7 @@ function SupportSection({
function SupportRowSkeleton(): React.JSX.Element {
return (
<div className="flex items-center justify-between gap-4 px-1 py-2" aria-hidden="true">
<div className="flex items-center justify-between gap-4 py-2" aria-hidden="true">
<div className="h-4 w-36 rounded bg-muted/50 animate-pulse" />
<div className="h-8 w-24 rounded-md bg-muted/50 animate-pulse" />
</div>
@@ -930,7 +824,7 @@ function SupportRow({
title="Star Orca on GitHub"
description="Support the project with a GitHub star via the gh CLI."
keywords={['star', 'github', 'support', 'feedback', 'like']}
className="flex items-center justify-between gap-4 px-1 py-2"
className="flex items-center justify-between gap-4 py-2"
>
<Label>Star Orca on GitHub</Label>
{state === 'starred' ? (
@@ -79,7 +79,7 @@ export function GitPane({
title="Refresh Local Base Ref"
description="Optionally fast-forward local main or master when creating worktrees."
keywords={['main', 'master', 'origin/main', 'git diff', 'base ref', 'worktree']}
className="flex items-center justify-between gap-4 px-1 py-2"
className="flex items-center justify-between gap-4 py-2"
>
<div className="space-y-0.5">
<Label>Refresh Local Base Ref</Label>
@@ -136,7 +136,7 @@ export function GitPane({
title="Orca Attribution"
description="Add Orca attribution to commits, PRs, and issues."
keywords={['github', 'gh', 'pr', 'issue', 'co-author', 'coauthored', 'attribution', 'orca']}
className="flex items-center justify-between gap-4 px-1 py-2"
className="flex items-center justify-between gap-4 py-2"
>
<div className="space-y-0.5">
<Label>Orca Attribution</Label>
@@ -53,7 +53,7 @@ export function InputPane({ settings, updateSettings }: InputPaneProps): React.J
'linux',
'macos'
]}
className="flex items-center justify-between gap-4 px-1 py-2"
className="flex items-center justify-between gap-4 py-2"
>
<div className="space-y-0.5">
<Label>Middle-click Paste from Selection</Label>
@@ -51,7 +51,7 @@ export function MobileSettingsPane({
title="Mobile"
description="Control terminals and agents from your phone."
keywords={MOBILE_ENABLE_SEARCH_ENTRY.keywords}
className="space-y-3 px-1 py-2"
className="space-y-3 py-2"
>
<div className="flex items-start justify-between gap-4">
<div className="min-w-0 shrink space-y-1.5">
@@ -242,7 +242,7 @@ export function NotificationsPane({
<Separator />
<div className="space-y-2 px-1 py-2">
<div className="space-y-2 py-2">
<div className="space-y-0.5">
<div className="flex items-center gap-2">
<FileAudio className="size-4" />
@@ -331,7 +331,7 @@ export function NotificationsPane({
}
/>
<div className="flex flex-wrap items-center gap-2 px-1 pt-3">
<div className="flex flex-wrap items-center gap-2 pt-3">
<Button
variant="outline"
size="sm"
@@ -365,7 +365,7 @@ function SettingToggle({
icon
}: SettingToggleProps): React.JSX.Element {
return (
<div className="flex items-center justify-between gap-4 px-1 py-2">
<div className="flex items-center justify-between gap-4 py-2">
<div className="space-y-0.5">
<div className="flex items-center gap-2">
{icon}
@@ -66,7 +66,7 @@ export function OrchestrationPane(): React.JSX.Element {
title="Agent Orchestration"
description="Coordinate multiple coding agents via messaging, task DAGs, dispatch, and decision gates."
keywords={ORCHESTRATION_PANE_SEARCH_ENTRIES[0].keywords}
className="space-y-3 px-1 py-2"
className="space-y-3 py-2"
>
<div className="flex items-start justify-between gap-4">
<div className="min-w-0 shrink space-y-0.5">
@@ -345,17 +345,15 @@ function Section({
children: React.ReactNode
}): React.JSX.Element {
return (
<div className="flex flex-col gap-3 py-2 sm:flex-row sm:items-start sm:justify-between">
<div className="flex flex-1 items-start gap-3">
<div className="mt-1 text-muted-foreground">{icon}</div>
<div className="space-y-1">
<div className="flex items-center justify-between gap-4 py-2">
<div className="flex min-w-0 flex-1 items-start gap-2.5">
<div className="mt-0.5 text-muted-foreground">{icon}</div>
<div className="min-w-0 space-y-0.5">
<Label className="text-sm">{title}</Label>
<p className="text-xs text-muted-foreground">{description}</p>
</div>
</div>
<div className="flex shrink-0 flex-wrap items-center gap-2 self-start sm:justify-end sm:self-center">
{children}
</div>
<div className="flex shrink-0 flex-wrap items-center justify-end gap-2">{children}</div>
</div>
)
}
@@ -80,7 +80,7 @@ export function PrivacyPane({ settings }: PrivacyPaneProps): React.JSX.Element {
return (
<div className="space-y-4">
<div className="flex items-center justify-between gap-4 px-1 py-2">
<div className="flex items-center justify-between gap-4 py-2">
<div className="space-y-0.5">
<div className="flex items-center gap-2">
<ShieldCheck className="size-4" />
@@ -126,7 +126,7 @@ export function PrivacyPane({ settings }: PrivacyPaneProps): React.JSX.Element {
function BlockedHelper({ blocked, id }: { blocked: BlockedReason; id: string }): React.JSX.Element {
return (
<div id={id} className="px-1 pb-2 text-xs text-muted-foreground">
<div id={id} className="pb-2 text-xs text-muted-foreground">
{blocked.reason === 'ci' ? (
<p>Telemetry is disabled because a CI environment variable is set. Unset it and restart.</p>
) : (
@@ -184,7 +184,7 @@ export function QuickCommandsPane({
return (
<div className="space-y-3">
<div className="flex items-center justify-between gap-3">
<div className="flex items-center justify-between gap-3 py-2">
<div className="space-y-1">
<Label>Saved Commands</Label>
<p className="text-xs text-muted-foreground">
@@ -284,7 +284,7 @@ export function QuickCommandsPane({
</Popover>
</div>
<div className="overflow-hidden rounded-lg border border-border/50">
<div className="overflow-hidden rounded-lg border border-border/50 bg-muted/20">
{visibleCommands.length === 0 ? (
<div className="px-3 py-6 text-sm text-muted-foreground">
{commands.length === 0
@@ -292,11 +292,14 @@ export function QuickCommandsPane({
: 'No commands in the selected scopes.'}
</div>
) : (
<div className="max-h-[60vh] divide-y divide-border/50 overflow-y-auto scrollbar-sleek">
<div className="max-h-[60vh] space-y-2 overflow-y-auto p-2 scrollbar-sleek">
{visibleCommands.map((command) => {
const scope = getTerminalQuickCommandScope(command)
return (
<div key={command.id} className="flex items-center gap-3 px-3 py-2">
<div
key={command.id}
className="flex items-center gap-3 rounded-md border border-border/60 bg-background px-3 py-2 shadow-xs"
>
<div className="min-w-0 flex-1">
<div className="flex min-w-0 items-center gap-2">
<div className="truncate text-sm font-medium">
@@ -319,11 +322,11 @@ export function QuickCommandsPane({
)}
</Badge>
</div>
<div className="truncate font-mono text-xs text-muted-foreground">
<div className="truncate font-mono text-xs text-foreground/80">
{command.command || 'No command text'}
</div>
</div>
<div className="shrink-0 text-[11px] text-muted-foreground">
<div className="shrink-0 text-[11px] font-medium text-foreground/75">
{command.appendEnter ? 'Enter' : 'Insert'}
</div>
<Button
@@ -213,7 +213,7 @@ export function RuntimeEnvironmentsPane({
title={searchEntry.title}
description={searchEntry.description}
keywords={searchEntry.keywords}
className="space-y-4 px-1 py-2"
className="space-y-4 py-2"
>
<div className="space-y-2">
<div className="space-y-1">
@@ -1,4 +1,5 @@
import type React from 'react'
import { cn } from '@/lib/utils'
import { useAppStore } from '../../store'
import { matchesSettingsSearch, type SettingsSearchEntry } from './settings-search'
@@ -24,7 +25,7 @@ export function SearchableSetting({
}
return (
<div className={className} id={id}>
<div className={cn('scroll-mt-6 w-full max-w-3xl', className)} id={id}>
{children}
</div>
)
@@ -985,7 +985,7 @@ function Settings(): React.JSX.Element {
<div className="flex min-h-0 flex-1 flex-col">
<div ref={contentScrollRef} className="min-h-0 flex-1 overflow-y-auto scrollbar-sleek">
<div className="flex w-full max-w-5xl flex-col gap-10 px-8 py-10">
<div className="flex w-full max-w-4xl flex-col gap-10 px-8 pb-24 pt-10">
{visibleNavSections.length === 0 ? (
<div className="flex min-h-[24rem] items-center justify-center rounded-2xl border border-dashed border-border/60 bg-card/30 text-sm text-muted-foreground">
No settings found for &quot;{settingsSearchQuery.trim()}&quot;
@@ -1,6 +1,7 @@
/* eslint-disable max-lines -- Why: these small settings form primitives and controls
co-locate shared layout and keyboard interaction logic, which keeps the settings
panel wiring simple even though the file exceeds the default line limit. */
import type React from 'react'
import { useEffect, useId, useMemo, useRef, useState } from 'react'
import { ScrollArea } from '../ui/scroll-area'
import { Input } from '../ui/input'
@@ -8,6 +9,221 @@ import { Label } from '../ui/label'
import { Check, ChevronsUpDown, CircleX } from 'lucide-react'
import { BUILTIN_TERMINAL_THEME_NAMES, normalizeColor } from '@/lib/terminal-theme'
import { MAX_THEME_RESULTS } from './SettingsConstants'
import { cn } from '@/lib/utils'
type SettingsSwitchProps = {
checked: boolean
onChange: () => void
ariaLabel?: string
ariaLabelledBy?: string
disabled?: boolean
}
export function SettingsSwitch({
checked,
onChange,
ariaLabel,
ariaLabelledBy,
disabled
}: SettingsSwitchProps): React.JSX.Element {
return (
<button
type="button"
role="switch"
aria-checked={checked}
aria-label={ariaLabel}
aria-labelledby={ariaLabelledBy}
disabled={disabled}
onClick={onChange}
className={cn(
'relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent outline-none transition-colors focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50',
checked ? 'bg-foreground' : 'bg-muted-foreground/30'
)}
>
<span
className={cn(
'pointer-events-none block size-3.5 rounded-full bg-background shadow-sm transition-transform',
checked ? 'translate-x-4' : 'translate-x-0.5'
)}
/>
</button>
)
}
type SettingsRowProps = {
label: React.ReactNode
description?: React.ReactNode
control: React.ReactNode
/** Optional id applied to the label so the control can reference it via aria-labelledby. */
labelId?: string
/** When true, top-align label/description and control. Useful for tall control columns. */
alignTop?: boolean
}
/** Two-column row grammar: left min-w-0 label+description, right shrink-0 control. */
export function SettingsRow({
label,
description,
control,
labelId,
alignTop
}: SettingsRowProps): React.JSX.Element {
return (
<div
className={cn('flex gap-4 py-2', alignTop ? 'items-start' : 'items-center justify-between')}
>
<div className="min-w-0 flex-1 space-y-0.5">
<Label id={labelId}>{label}</Label>
{description ? <p className="text-xs text-muted-foreground">{description}</p> : null}
</div>
<div className="shrink-0">{control}</div>
</div>
)
}
type SettingsSwitchRowProps = {
label: React.ReactNode
description?: React.ReactNode
checked: boolean
onChange: () => void
ariaLabel?: string
}
export function SettingsSwitchRow({
label,
description,
checked,
onChange,
ariaLabel
}: SettingsSwitchRowProps): React.JSX.Element {
return (
<SettingsRow
label={label}
description={description}
control={
<SettingsSwitch
checked={checked}
onChange={onChange}
ariaLabel={ariaLabel ?? (typeof label === 'string' ? label : undefined)}
/>
}
/>
)
}
type SegmentedOption<T extends string | number> = {
value: T
label: React.ReactNode
disabled?: boolean
ariaLabel?: string
}
type SettingsSegmentedControlProps<T extends string | number> = {
value: T
onChange: (value: T) => void
options: readonly SegmentedOption<T>[]
ariaLabel?: string
size?: 'sm' | 'md'
}
/** Canonical segmented control for theme/ligatures/cursor/shell/etc. */
export function SettingsSegmentedControl<T extends string | number>({
value,
onChange,
options,
ariaLabel,
size = 'md'
}: SettingsSegmentedControlProps<T>): React.JSX.Element {
return (
<div
role="radiogroup"
aria-label={ariaLabel}
className="inline-flex items-center rounded-md border border-border bg-background/50 p-0.5"
>
{options.map((opt) => {
const active = opt.value === value
return (
<button
key={String(opt.value)}
type="button"
role="radio"
aria-checked={active}
aria-label={opt.ariaLabel}
disabled={opt.disabled}
onClick={() => {
if (!opt.disabled) {
onChange(opt.value)
}
}}
className={cn(
'rounded-sm outline-none transition-colors focus-visible:ring-[3px] focus-visible:ring-ring/50',
size === 'sm' ? 'px-2.5 py-0.5 text-xs' : 'px-3 py-1 text-sm',
active
? 'bg-accent font-medium text-accent-foreground'
: opt.disabled
? 'cursor-not-allowed text-muted-foreground/50'
: 'text-muted-foreground hover:text-foreground'
)}
>
{opt.label}
</button>
)
})}
</div>
)
}
type SettingsBadgeProps = {
tone?: 'neutral' | 'accent' | 'muted'
children: React.ReactNode
className?: string
}
/** Tokenized badge for status pills inside settings (e.g. Detected, Not installed). */
export function SettingsBadge({
tone = 'neutral',
children,
className
}: SettingsBadgeProps): React.JSX.Element {
return (
<span
className={cn(
'inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium',
tone === 'accent'
? 'border-foreground/20 bg-foreground/10 text-foreground'
: tone === 'muted'
? 'border-border/40 bg-muted/30 text-muted-foreground'
: 'border-border/50 bg-background/50 text-foreground/80',
className
)}
>
{children}
</span>
)
}
type SettingsSubsectionHeaderProps = {
title: React.ReactNode
description?: React.ReactNode
action?: React.ReactNode
}
/** Consistent subsection header: h3 text-sm font-semibold + optional muted description. */
export function SettingsSubsectionHeader({
title,
description,
action
}: SettingsSubsectionHeaderProps): React.JSX.Element {
return (
<div className="flex items-start justify-between gap-3">
<div className="space-y-1">
<h3 className="text-sm font-semibold">{title}</h3>
{description ? <p className="text-xs text-muted-foreground">{description}</p> : null}
</div>
{action ? <div className="shrink-0">{action}</div> : null}
</div>
)
}
type ThemePickerProps = {
label: string
@@ -119,26 +335,26 @@ export function ColorField({
const normalized = normalizeColor(value, fallback)
return (
<div className="space-y-2">
<div className="space-y-1">
<Label>{label}</Label>
<p className="text-xs text-muted-foreground">{description}</p>
</div>
<div className="flex items-center gap-3">
<input
type="color"
value={normalized}
onChange={(e) => onChange(e.target.value)}
className="h-9 w-12 rounded-md border border-input bg-transparent p-1"
/>
<Input
value={value}
onChange={(e) => onChange(e.target.value)}
placeholder={fallback}
className="max-w-xs text-xs"
/>
</div>
</div>
<SettingsRow
label={label}
description={description}
control={
<div className="flex items-center gap-2">
<input
type="color"
value={normalized}
onChange={(e) => onChange(e.target.value)}
className="h-8 w-10 rounded-md border border-input bg-transparent p-1"
/>
<Input
value={value}
onChange={(e) => onChange(e.target.value)}
placeholder={fallback}
className="w-32 text-xs"
/>
</div>
}
/>
)
}
@@ -181,34 +397,37 @@ export function NumberField({
}
return (
<div className="space-y-2">
<div className="space-y-1">
<Label>{label}</Label>
<p className="text-xs text-muted-foreground">{description}</p>
</div>
<div className="flex items-center gap-3">
<Input
type="number"
min={min}
max={max}
step={step}
value={draft}
onChange={(e) => setDraft(e.target.value)}
onBlur={commit}
onKeyDown={(e) => {
if (e.key === 'Enter') {
commit()
}
}}
className="number-input-clean w-28 tabular-nums"
/>
{suffix ? <span className="text-xs text-muted-foreground">{suffix}</span> : null}
</div>
<p className="text-[11px] text-muted-foreground">
Current: {value}
{defaultValue !== undefined ? ` · Default: ${defaultValue}` : ''}
</p>
</div>
<SettingsRow
label={label}
description={
<>
{description}
{defaultValue !== undefined ? (
<span className="ml-1 text-muted-foreground/70">· Default: {defaultValue}</span>
) : null}
</>
}
control={
<div className="flex items-center gap-2">
<Input
type="number"
min={min}
max={max}
step={step}
value={draft}
onChange={(e) => setDraft(e.target.value)}
onBlur={commit}
onKeyDown={(e) => {
if (e.key === 'Enter') {
commit()
}
}}
className="number-input-clean w-24 tabular-nums"
/>
{suffix ? <span className="shrink-0 text-xs text-muted-foreground">{suffix}</span> : null}
</div>
}
/>
)
}
@@ -1,5 +1,6 @@
import type React from 'react'
import { createContext, useContext } from 'react'
import { cn } from '@/lib/utils'
import { useAppStore } from '../../store'
import type { SettingsSearchEntry } from './settings-search'
import { matchesSettingsSearch } from './settings-search'
@@ -60,23 +61,28 @@ export function SettingsSection({
}
return (
<section id={id} data-settings-section={id} className={className ?? 'scroll-mt-6 space-y-6'}>
<div className="flex items-start justify-between gap-4">
<div className="space-y-1">
<h2 className="flex items-center gap-2 text-lg font-semibold">
<section id={id} data-settings-section={id} className={cn('scroll-mt-8 space-y-6', className)}>
<div className="flex flex-wrap items-start justify-between gap-4 border-b border-border/60 pb-5">
<div className="min-w-0 space-y-2">
<h2 className="flex flex-wrap items-center gap-2 text-2xl font-semibold leading-tight text-foreground">
{title}
{badge ? (
<span className="rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground">
<span className="rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.05em] text-muted-foreground">
{badge}
</span>
) : null}
{badgeAccessory}
</h2>
<p className="text-sm text-muted-foreground">{description}</p>
<p className="max-w-2xl text-sm leading-6 text-muted-foreground">{description}</p>
</div>
{headerAction ? <div className="shrink-0">{headerAction}</div> : null}
</div>
{children}
{/* Why: body content sits in a visually distinct band — a soft card with
rounded corners and tight inner padding — so each row group reads as
contained inside the section, not as a continuation of the sidebar. */}
<div className="rounded-xl border border-border/40 bg-card/30 px-8 py-7 shadow-[0_1px_0_rgba(0,0,0,0.02)]">
{children}
</div>
</section>
)
}
@@ -1,6 +1,7 @@
import type { RefObject } from 'react'
import { ArrowLeft, Search, Server, type LucideIcon, type LucideProps } from 'lucide-react'
import { useShortcutLabel } from '@/hooks/useShortcutLabel'
import { cn } from '@/lib/utils'
import { Button } from '../ui/button'
import { Input } from '../ui/input'
@@ -33,7 +34,12 @@ type SettingsSidebarProps = {
onSearchChange: (query: string) => void
onSelectSection: (
sectionId: string,
modifiers: { metaKey: boolean; ctrlKey: boolean; shiftKey: boolean; altKey: boolean }
modifiers: {
metaKey: boolean
ctrlKey: boolean
shiftKey: boolean
altKey: boolean
}
) => void
}
@@ -49,6 +55,13 @@ export function SettingsSidebar({
onSelectSection
}: SettingsSidebarProps): React.JSX.Element {
const searchShortcutHint = useShortcutLabel('settings.search')
const navItemClassName = (isActive: boolean): string =>
cn(
'flex w-full items-center gap-2 rounded-lg px-3 py-1.5 text-left text-[13px] outline-none transition-colors focus-visible:ring-[3px] focus-visible:ring-ring/50',
isActive
? 'bg-accent font-medium text-accent-foreground'
: 'text-muted-foreground hover:bg-muted/60 hover:text-foreground'
)
return (
<aside className="flex w-[280px] shrink-0 flex-col border-r border-border/50 bg-card/40">
@@ -57,7 +70,7 @@ export function SettingsSidebar({
variant="ghost"
size="sm"
onClick={onBack}
className="w-full justify-start gap-2 text-muted-foreground"
className="w-full justify-start gap-2 text-[13px] text-muted-foreground"
>
<ArrowLeft className="size-4" />
Back to app
@@ -72,7 +85,7 @@ export function SettingsSidebar({
value={searchQuery}
onChange={(event) => onSearchChange(event.target.value)}
placeholder="Search settings"
className="pl-9 pr-14"
className="pl-9 pr-14 text-[13px]"
/>
{searchQuery === '' ? (
<kbd className="pointer-events-none absolute right-2 top-1/2 inline-flex -translate-y-1/2 items-center rounded border border-border/60 bg-background/40 px-1.5 py-px font-mono text-[10px] font-medium text-muted-foreground">
@@ -97,6 +110,8 @@ export function SettingsSidebar({
return (
<button
key={section.id}
aria-current={isActive ? 'page' : undefined}
data-current={isActive ? 'true' : undefined}
onClick={(event) =>
onSelectSection(section.id, {
metaKey: event.metaKey,
@@ -105,13 +120,9 @@ export function SettingsSidebar({
altKey: event.altKey
})
}
className={`flex w-full items-center rounded-lg px-3 py-2 text-left text-sm transition-colors ${
isActive
? 'bg-accent font-medium text-accent-foreground'
: 'text-muted-foreground hover:bg-muted/60 hover:text-foreground'
}`}
className={navItemClassName(isActive)}
>
<Icon className="mr-2 size-4" />
<Icon className="size-4 shrink-0" />
<span className="truncate">{section.title}</span>
{section.badge ? (
<span className="ml-auto rounded-full bg-muted px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-wider text-muted-foreground">
@@ -138,6 +149,8 @@ export function SettingsSidebar({
return (
<button
key={section.id}
aria-current={isActive ? 'page' : undefined}
data-current={isActive ? 'true' : undefined}
onClick={(event) =>
onSelectSection(section.id, {
metaKey: event.metaKey,
@@ -146,15 +159,16 @@ export function SettingsSidebar({
altKey: event.altKey
})
}
className={`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm transition-colors ${
isActive
? 'bg-accent font-medium text-accent-foreground'
: 'text-muted-foreground hover:bg-muted/60 hover:text-foreground'
}`}
className={navItemClassName(isActive)}
>
<span
className="size-2.5 shrink-0 rounded-full"
style={{ backgroundColor: section.badgeColor ?? '#6b7280' }}
className={cn(
'size-2.5 shrink-0 rounded-full',
section.badgeColor ? null : 'bg-muted-foreground'
)}
style={
section.badgeColor ? { backgroundColor: section.badgeColor } : undefined
}
/>
<span className="truncate">{section.title}</span>
{section.isRemote && (
@@ -18,10 +18,10 @@ import {
type TerminalShortcutPolicy
} from '../../../../shared/keybindings'
import { useAppStore } from '../../store'
import { Label } from '../ui/label'
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select'
import { KeybindingsFileActions } from './KeybindingsFileActions'
import { SearchableSetting } from './SearchableSetting'
import { SettingsRow, SettingsSubsectionHeader } from './SettingsFormControls'
import { ShortcutBindingRow, type ShortcutTerminalStatus } from './ShortcutBindingRow'
import { matchesSettingsSearch, type SettingsSearchEntry } from './settings-search'
@@ -287,78 +287,80 @@ export function ShortcutsPane(): React.JSX.Element {
setErrors((prev) => ({ ...prev, [actionId]: undefined }))
}
const showPolicy = matchesSettingsSearch(searchQuery, TERMINAL_SHORTCUT_POLICY_SEARCH_ENTRY)
const showCtrlTab = matchesSettingsSearch(searchQuery, CTRL_TAB_BEHAVIOR_SEARCH_ENTRY)
return (
<div className="space-y-8">
<section className="space-y-4">
<div className="space-y-1">
<h2 className="text-sm font-semibold">Keyboard Shortcuts</h2>
<p className="text-xs text-muted-foreground">
Customize shortcuts visually or edit the file directly.
</p>
</div>
<div className="space-y-6">
<section className="space-y-3">
<SettingsSubsectionHeader
title="Keyboard Shortcuts"
description="Customize shortcuts visually or edit the file directly."
/>
{matchesSettingsSearch(searchQuery, TERMINAL_SHORTCUT_POLICY_SEARCH_ENTRY) ? (
<SearchableSetting
id="terminal-shortcut-policy"
title="Shortcuts in Terminal"
description="Choose whether Orca or the focused terminal wins when shortcuts overlap."
keywords={TERMINAL_SHORTCUT_POLICY_SEARCH_ENTRY.keywords}
className="flex items-center justify-between gap-4 px-1 py-2"
>
<div className="space-y-0.5">
<Label>Shortcuts in Terminal</Label>
<p className="text-xs text-muted-foreground">
Orca first keeps app shortcuts active in TUIs. Terminal first lets shell shortcuts
win unless a shortcut is marked terminal-active.
</p>
</div>
<Select
value={terminalShortcutPolicy}
onValueChange={(value) =>
void updateSettings({
terminalShortcutPolicy: value as TerminalShortcutPolicy
})
}
>
<SelectTrigger className="w-[180px]">
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="orca-first">Orca first</SelectItem>
<SelectItem value="terminal-first">Terminal first</SelectItem>
</SelectContent>
</Select>
</SearchableSetting>
) : null}
{showPolicy || showCtrlTab ? (
<div className="divide-y divide-border/40">
{showPolicy ? (
<SearchableSetting
id="terminal-shortcut-policy"
title="Shortcuts in Terminal"
description="Choose whether Orca or the focused terminal wins when shortcuts overlap."
keywords={TERMINAL_SHORTCUT_POLICY_SEARCH_ENTRY.keywords}
>
<SettingsRow
label="Shortcuts in Terminal"
description="Orca first keeps app shortcuts active in TUIs. Terminal first lets shell shortcuts win unless marked terminal-active."
control={
<Select
value={terminalShortcutPolicy}
onValueChange={(value) =>
void updateSettings({
terminalShortcutPolicy: value as TerminalShortcutPolicy
})
}
>
<SelectTrigger className="w-[180px]">
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="orca-first">Orca first</SelectItem>
<SelectItem value="terminal-first">Terminal first</SelectItem>
</SelectContent>
</Select>
}
/>
</SearchableSetting>
) : null}
{matchesSettingsSearch(searchQuery, CTRL_TAB_BEHAVIOR_SEARCH_ENTRY) ? (
<SearchableSetting
title="Recent Tab Order"
description="Choose recent or sequential tab switching."
keywords={CTRL_TAB_BEHAVIOR_SEARCH_ENTRY.keywords}
className="flex items-center justify-between gap-4 px-1 py-2"
>
<div className="space-y-0.5">
<Label>Recent Tab Order</Label>
<p className="text-xs text-muted-foreground">
Choose whether recent tab switching follows recent use or the tab strip order.
</p>
</div>
<Select
value={ctrlTabOrderMode}
onValueChange={(value) =>
void updateSettings({ ctrlTabOrderMode: value as CtrlTabOrderMode })
}
>
<SelectTrigger className="w-[180px]">
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="mru">Most recent</SelectItem>
<SelectItem value="sequential">Tab strip order</SelectItem>
</SelectContent>
</Select>
</SearchableSetting>
{showCtrlTab ? (
<SearchableSetting
title="Recent Tab Order"
description="Choose recent or sequential tab switching."
keywords={CTRL_TAB_BEHAVIOR_SEARCH_ENTRY.keywords}
>
<SettingsRow
label="Recent Tab Order"
description="Choose whether recent tab switching follows recent use or the tab strip order."
control={
<Select
value={ctrlTabOrderMode}
onValueChange={(value) =>
void updateSettings({ ctrlTabOrderMode: value as CtrlTabOrderMode })
}
>
<SelectTrigger className="w-[180px]">
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="mru">Most recent</SelectItem>
<SelectItem value="sequential">Tab strip order</SelectItem>
</SelectContent>
</Select>
}
/>
</SearchableSetting>
) : null}
</div>
) : null}
<KeybindingsFileActions />
@@ -9,6 +9,7 @@ import { cn } from '@/lib/utils'
import { LinearIcon } from '@/components/icons/LinearIcon'
import { Label } from '../ui/label'
import { SearchableSetting } from './SearchableSetting'
import { SettingsSubsectionHeader } from './SettingsFormControls'
type TasksPaneProps = {
settings: GlobalSettings
@@ -62,14 +63,11 @@ export function TasksPane({ settings, updateSettings }: TasksPaneProps): React.J
return (
<div className="space-y-6">
<section className="space-y-4">
<div className="space-y-1">
<h3 className="text-sm font-semibold">Task Sources</h3>
<p className="text-xs text-muted-foreground">
Choose which task providers appear in the Tasks page source picker and sidebar
shortcuts. At least one provider must stay visible.
</p>
</div>
<section className="space-y-3">
<SettingsSubsectionHeader
title="Task Sources"
description="Choose which task providers appear in the Tasks page source picker and sidebar shortcuts. At least one provider must stay visible."
/>
<SearchableSetting
title="Task Providers"
@@ -84,7 +82,7 @@ export function TasksPane({ settings, updateSettings }: TasksPaneProps): React.J
'display',
'hide'
]}
className="grid gap-2"
className="grid gap-2 py-2"
>
{TASK_PROVIDER_OPTIONS.map((option) => {
const enabled = visibleProviders.includes(option.id)
File diff suppressed because it is too large Load Diff
@@ -109,7 +109,7 @@ export function LightTerminalThemeSection({
title="Use Separate Theme In Light Mode"
description="When disabled, light mode reuses the dark terminal theme."
keywords={['terminal', 'light mode', 'theme']}
className="flex items-center justify-between gap-4 px-1 py-2"
className="flex items-center justify-between gap-4 py-2"
>
<div className="space-y-0.5">
<p className="text-sm font-medium">Use Separate Theme In Light Mode</p>
@@ -139,7 +139,7 @@ export function TerminalWindowSection({
title="Window Blur"
description="Apply background blur to the terminal window. Requires restart."
keywords={['window', 'blur', 'background', 'transparency', 'vibrancy']}
className="space-y-3 px-1 py-2"
className="space-y-3 py-2"
>
<div className="flex items-center justify-between gap-4">
<div className="space-y-0.5">
@@ -228,7 +228,7 @@ export function TerminalWindowSection({
title="Hide Mouse While Typing"
description="Hide the mouse cursor when typing in the terminal."
keywords={['mouse', 'hide', 'typing', 'cursor']}
className="flex items-center justify-between gap-4 px-1 py-2"
className="flex items-center justify-between gap-4 py-2"
>
<div className="space-y-0.5">
<Label>Hide Mouse While Typing</Label>
@@ -99,7 +99,7 @@ export function VoicePane({ settings, updateSettings }: VoicePaneProps): React.J
return (
<div className="space-y-1">
<div className="flex items-center justify-between gap-4 px-1 py-2">
<div className="flex items-center justify-between gap-4 py-2">
<div className="space-y-0.5">
<Label>Enable Voice Dictation</Label>
<p className="text-xs text-muted-foreground">
@@ -127,7 +127,7 @@ export function VoicePane({ settings, updateSettings }: VoicePaneProps): React.J
<Separator />
<div className="flex items-center justify-between gap-4 px-1 py-2">
<div className="flex items-center justify-between gap-4 py-2">
<div className="space-y-0.5">
<Label>Dictation Mode</Label>
<p className="text-xs text-muted-foreground">
@@ -155,7 +155,7 @@ export function VoicePane({ settings, updateSettings }: VoicePaneProps): React.J
<Separator />
<div className="flex items-center justify-between gap-4 px-1 py-2">
<div className="flex items-center justify-between gap-4 py-2">
<div className="space-y-0.5">
<Label>Speech Model</Label>
<p className="text-xs text-muted-foreground">
@@ -53,6 +53,11 @@ export const GENERAL_EDITOR_SEARCH_ENTRIES: SettingsSearchEntry[] = [
title: 'Minimap',
description: 'Show the minimap overview when editing a file.',
keywords: ['minimap', 'overview', 'code', 'scroll']
},
{
title: 'Markdown Review Notes',
description: 'Show local markdown review note controls in rich editor mode.',
keywords: ['markdown', 'review', 'notes', 'annotations', 'agents']
}
]
+1 -1
View File
@@ -13,7 +13,7 @@ const buttonVariants = cva(
destructive:
'bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40',
outline:
'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50',
'border border-border bg-background text-foreground shadow-xs hover:border-muted-foreground/35 hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50',
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
link: 'text-primary underline-offset-4 hover:underline'
+1 -1
View File
@@ -10,7 +10,7 @@ function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimiti
<LabelPrimitive.Root
data-slot="label"
className={cn(
'flex items-center gap-2 text-xs leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
className
)}
{...props}
@@ -39,3 +39,18 @@ export function useShortcutKeys(actionId: KeybindingActionId): string[] {
const keybindings = useAppStore((state) => state.keybindings)
return formatShortcutKeys(actionId, keybindings)
}
export function formatShortcutKeyCombos(
actionId: KeybindingActionId,
overrides?: KeybindingOverrides
): string[][] {
const platform = getShortcutPlatform()
return getEffectiveKeybindingsForAction(actionId, platform, overrides).map((binding) =>
formatKeybinding(binding, platform)
)
}
export function useShortcutKeyCombos(actionId: KeybindingActionId): string[][] {
const keybindings = useAppStore((state) => state.keybindings)
return formatShortcutKeyCombos(actionId, keybindings)
}
+1
View File
@@ -162,6 +162,7 @@ export function getDefaultSettings(homedir: string): GlobalSettings {
editorAutoSave: false,
editorAutoSaveDelayMs: DEFAULT_EDITOR_AUTO_SAVE_DELAY_MS,
editorMinimapEnabled: false,
markdownReviewToolsEnabled: true,
primarySelectionMiddleClickPaste: getDefaultPrimarySelectionMiddleClickPaste(),
primarySelectionMiddleClickPasteDefaultedForLinux:
typeof process !== 'undefined' && process.platform === 'linux',
+2
View File
@@ -1569,6 +1569,8 @@ export type GlobalSettings = {
editorAutoSave: boolean
editorAutoSaveDelayMs: number
editorMinimapEnabled: boolean
/** Whether local markdown review note controls and the review panel are shown. */
markdownReviewToolsEnabled: boolean
/** Why: mirrors terminal selection-paste muscle memory without mutating the
* normal system clipboard; Linux and macOS enable it by default, Windows
* leaves middle-click semantics unchanged unless the user opts in. */