Files
orca/src/shared/constants.ts
T
Jinjing 00d3e15c71 feat: change default divider thickness to 3px for first-time users (#256)
The previous 1px default was too thin for comfortable visibility.
This changes the default to 3px, which only affects new users who
haven't customized the setting. Also updates the preview component's
fallback to stay consistent with the new default.
2026-04-01 16:38:55 -07:00

104 lines
2.5 KiB
TypeScript

import type {
GlobalSettings,
PersistedState,
PersistedUIState,
RepoHookSettings,
WorkspaceSessionState,
WorktreeCardProperty
} from './types'
import { DEFAULT_TERMINAL_FONT_WEIGHT } from './terminal-fonts'
export const SCHEMA_VERSION = 1
export const DEFAULT_WORKTREE_CARD_PROPERTIES: WorktreeCardProperty[] = [
'status',
'unread',
'ci',
'issue',
'pr',
'comment'
]
export const REPO_COLORS = [
'#737373', // neutral
'#ef4444', // red
'#f97316', // orange
'#eab308', // yellow
'#22c55e', // green
'#14b8a6', // teal
'#8b5cf6', // purple
'#ec4899' // pink
] as const
export function getDefaultSettings(homedir: string): GlobalSettings {
return {
workspaceDir: `${homedir}/orca/workspaces`,
nestWorkspaces: true,
branchPrefix: 'git-username',
branchPrefixCustom: '',
theme: 'system',
terminalFontSize: 14,
terminalFontFamily: 'SF Mono',
terminalFontWeight: DEFAULT_TERMINAL_FONT_WEIGHT,
terminalCursorStyle: 'bar',
terminalCursorBlink: true,
terminalThemeDark: 'Ghostty Default Style Dark',
terminalDividerColorDark: '#3f3f46',
terminalUseSeparateLightTheme: false,
terminalThemeLight: 'Builtin Tango Light',
terminalDividerColorLight: '#d4d4d8',
terminalInactivePaneOpacity: 0.8,
terminalActivePaneOpacity: 1,
terminalPaneOpacityTransitionMs: 140,
terminalDividerThicknessPx: 3,
terminalScrollbackBytes: 10_000_000,
rightSidebarOpenByDefault: true
}
}
export function getDefaultRepoHookSettings(): RepoHookSettings {
return {
mode: 'auto',
scripts: {
setup: '',
archive: ''
}
}
}
export function getDefaultPersistedState(homedir: string): PersistedState {
return {
schemaVersion: SCHEMA_VERSION,
repos: [],
worktreeMeta: {},
settings: getDefaultSettings(homedir),
ui: getDefaultUIState(),
githubCache: { pr: {}, issue: {} },
workspaceSession: getDefaultWorkspaceSession()
}
}
export function getDefaultUIState(): PersistedUIState {
return {
lastActiveRepoId: null,
lastActiveWorktreeId: null,
sidebarWidth: 280,
rightSidebarWidth: 350,
groupBy: 'none',
sortBy: 'name',
filterRepoIds: [],
uiZoomLevel: 0,
worktreeCardProperties: [...DEFAULT_WORKTREE_CARD_PROPERTIES]
}
}
export function getDefaultWorkspaceSession(): WorkspaceSessionState {
return {
activeRepoId: null,
activeWorktreeId: null,
activeTabId: null,
tabsByWorktree: {},
terminalLayoutsByTabId: {}
}
}