Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,23 @@

- 所有文本/边框/输入框必须基于 token;尤其避免 `#fff` / `#ccc` 这类暗色假设。
- provider/card 标题与错误信息必须可读(Light/Dark 都可读)。
- 页面 registry 是 Settings 信息架构的单一来源:规范页面 id、别名、导航分组、标题/说明键和滚动目标;侧栏、动态页头、搜索结果与窄窗选择器必须共同消费它,禁止各自维护映射。
- 桌面侧栏按“应用 / 工作区 / 连接 / 高级”分组;项目使用独立、可折叠分组。二级入口可供搜索或深链定位,但不重复占用主导航。
- 页头必须随当前页面显示对应标题和简短说明,标题与说明来自 registry,不使用泛化的固定标题替代页面上下文。
- Settings 内容层级固定为 `Page H2 → Group H3 →(必要时)Module H4 → Row`;Group 标题与说明必须位于内容面之外,不能用 `<strong>` 冒充结构标题。
- 每个 Group 最多一个共享的轻量内容面,内部继续使用扁平设置行和细分隔线;Module 只用标题、说明、留白与 hairline 区分,不得再拥有独立背景、圆角或 header surface。Agent、Endpoint 等具备独立身份与状态的重复实体可保留 Entity Card,但不能再套 Group Body Card。
- 单项页面不为了形式统一强加空洞层级;条件内容不得产生空 Group;重排时必须保留搜索/深链依赖的 `settings-section-*` anchor。
- 窄窗口使用顶部 page selector 和单列内容,不能把桌面侧栏压缩成不可读的窄栏;页面切换后仍需保持标题、说明和目标内容可达。
- Settings 容器必须具备 `dialog` 语义、可访问名称和 `aria-modal`。打开后把焦点移入面板,关闭后恢复到触发控件;所有交互必须有清晰的 `:focus-visible`。
- 搜索支持方向键选择结果、`Enter` 跳转和 `Escape` 退出;查询非空时首次 `Escape` 先清空查询,再次 `Escape` 关闭面板。关闭按钮必须有可访问名称。

实现锚点:
- 面板样式:`src/app/renderer/styles/settings-panel.css`
- 分组原语:`src/contexts/settings/presentation/renderer/settingsPanel/SettingsGroup.tsx`
- 主题选择:`src/contexts/settings/presentation/renderer/settingsPanel/GeneralSection.tsx`

参考原则:Apple HIG Settings(稳定 pane 与相关设置分组)、Windows App Settings(单列、受约束宽度与 section header)、GNOME HIG Boxed Lists(短静态偏好使用共享列表面,标题位于列表之外)。

---

## 6) 测试与验收(UI 变更必须做)
Expand Down
67 changes: 67 additions & 0 deletions src/app/renderer/i18n/locales/en.settingsPanel.layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,73 @@ export const enSettingsPanelLayout = {
diagnostics: 'Diagnostics',
projects: 'Projects',
sectionsLabel: 'Settings sections',
pageSelectorLabel: 'Settings page',
expandProjects: 'Expand projects',
collapseProjects: 'Collapse projects',
},
navGroups: {
application: 'Application',
workspace: 'Workspace',
connections: 'Connections',
advanced: 'Advanced',
projects: 'Projects',
},
pageDescriptions: {
general: 'Language, updates, and everyday preferences.',
appearance: 'Theme, interface text, and terminal typography.',
notifications: 'Manage system alerts and standby context.',
canvasWindows: 'Adjust canvas navigation and window behavior.',
agent: 'Choose and configure AI assistants.',
tasksShortcuts: 'Set task defaults, quick actions, and shortcuts.',
worker: 'Configure Worker runtime, access, and remote endpoints.',
integrations: 'Connect OpenCove with external services.',
advanced: 'Manage experimental features and diagnostics.',
},
groups: {
general: {
languageRegion: 'Language & Region',
softwareUpdates: 'Software Updates',
},
appearance: {
interface: 'Interface',
terminal: 'Terminal',
},
notifications: {
system: 'Notification Delivery',
standby: 'Standby Banner',
},
canvasWindows: {
canvasInput: 'Canvas Input',
nodeFocus: 'Node Focus',
spaceArchiving: 'Space Archiving',
windowTerminal: 'Windows & Terminal',
},
agent: {
providers: 'Agent Providers',
permissions: 'Permissions',
},
tasksShortcuts: {
taskTitles: 'Task Titles',
taskTags: 'Task Tags',
quickActions: 'Quick Actions',
keyboard: 'Keyboard Shortcuts',
},
worker: {
runtime: 'Worker Runtime',
remote: 'Remote Connections',
webAccess: 'Browser Access',
},
integrations: {
github: 'GitHub',
},
advanced: {
websiteWindows: 'Website Windows',
diagnostics: 'Performance Diagnostics',
},
workspace: {
worktrees: 'Worktrees',
environment: 'Runtime Environment',
},
},
appearance: {
title: 'Display & Fonts',
Expand Down
46 changes: 15 additions & 31 deletions src/app/renderer/i18n/locales/en.settingsPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { enSettingsPanelEndpoints } from './en.settingsPanel.endpoints'
import { enSettingsPanelAgentExecutable } from './en.settingsPanel.agentExecutable'
import { enSettingsPanelDiagnostics } from './en.settingsPanel.diagnostics'
import { enSettingsPanelLayout } from './en.settingsPanel.layout'
import { enSettingsPanelWorkspace } from './en.settingsPanel.workspace'
import { enWorkspaceCanvasNavigationShortcutCommands } from './en.settingsPanel.shortcuts.workspaceCanvasNavigation'

export const enSettingsPanel = {
Expand All @@ -13,6 +14,9 @@ export const enSettingsPanel = {
noResults: 'No matching settings',
},
nav: enSettingsPanelLayout.nav,
navGroups: enSettingsPanelLayout.navGroups,
pageDescriptions: enSettingsPanelLayout.pageDescriptions,
groups: enSettingsPanelLayout.groups,
general: {
title: 'General',
languageLabel: 'Display Language',
Expand Down Expand Up @@ -97,6 +101,8 @@ export const enSettingsPanel = {
help: 'Add or override environment variables when starting an agent.',
add: 'Add Variable',
enabled: 'Enabled',
keyLabel: 'variable name',
valueLabel: 'variable value',
keyPlaceholder: 'KEY',
valuePlaceholder: 'value',
},
Expand Down Expand Up @@ -221,6 +227,7 @@ export const enSettingsPanel = {
'Shows remote worker and remote location UI. When disabled, OpenCove keeps the local-only workflow by default.',
workerWebUi: {
title: 'Worker Web UI',
securityTitle: 'Access Security',
help: 'Open the experimental browser UI served by the Local Worker.',
enabledLabel: 'Enable Web UI',
enabledHelp:
Expand Down Expand Up @@ -418,13 +425,13 @@ export const enSettingsPanel = {
'OpenCove uses the Local Worker on this device. Most of the time, you only need to start or restart it below.',
packagedModeLabel: 'Current Mode',
packagedModeValue: 'Local Worker',
modeLabel: 'Worker Mode',
modeLabel: 'Current Mode',
mode: {
standalone: 'Standalone (No Worker)',
local: 'Local Worker',
remote: 'Remote Worker',
},
applyLabel: 'Apply',
applyLabel: 'Mode Changes',
applyHelp: 'Changes require a restart to take effect.',
applyRestart: 'Apply & Restart',
},
Expand All @@ -438,25 +445,25 @@ export const enSettingsPanel = {
cli: {
title: 'CLI',
help: 'Install the `opencove` command in your PATH.',
statusLabel: 'Status',
statusLabel: 'CLI Status',
status: {
installed: 'Installed ({{path}})',
needsRepair: 'Installed, but the launcher needs repair ({{path}})',
notInstalled: 'Not installed',
},
actionsLabel: 'Actions',
actionsLabel: 'CLI Actions',
install: 'Install CLI',
uninstall: 'Uninstall CLI',
},
local: {
title: 'Local Worker Status',
title: 'Local Worker',
help: 'Loopback-only (127.0.0.1) + token. Use SSH tunnels for remote access. Worker Web UI is in Worker & Connections.',
statusLabel: 'Status',
statusLabel: 'Worker Status',
status: {
running: 'Running',
stopped: 'Stopped',
},
actionsLabel: 'Actions',
actionsLabel: 'Worker Controls',
start: 'Start',
stop: 'Stop',
baseUrlLabel: 'Base URL',
Expand All @@ -468,28 +475,5 @@ export const enSettingsPanel = {
},
},
endpoints: enSettingsPanelEndpoints,
workspace: {
title: 'Workspace Worktree',
selectProjectFirst: 'Select a project first',
selectProjectFirstHelp: 'Choose a project in the sidebar to configure its worktree root.',
workspacePathLabel: 'Workspace Path',
workspacePathHelp: 'Project root for {{name}}.',
worktreeRootLabel: 'Worktree Root',
worktreeRootHelp: 'Relative path is based on project root.',
worktreeRootPlaceholder: '.opencove/worktrees',
resolvedPathLabel: 'Resolved Path',
resolvedPathHelp: 'Where new worktrees will be created.',
pullRequestBaseBranchesLabel: 'Pull Request Base Branches',
pullRequestBaseBranchesHelp:
'Suggestions shown when creating PRs on the canvas. The repository default branch is always included.',
pullRequestBaseBranchesEmpty: 'No base branches configured.',
pullRequestBaseBranchesPlaceholder: 'e.g. develop',
environmentVariablesTitle: 'Environment Variables',
environmentVariablesHelp:
'Custom environment variables injected into terminals and agents in this workspace.',
searchResultDescription: 'Project worktree and environment settings.',
environmentVariablesEmpty: 'No environment variables configured.',
environmentVariablesKeyPlaceholder: 'e.g. NODE_ENV',
environmentVariablesValuePlaceholder: 'e.g. development',
},
workspace: enSettingsPanelWorkspace,
}
26 changes: 26 additions & 0 deletions src/app/renderer/i18n/locales/en.settingsPanel.workspace.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export const enSettingsPanelWorkspace = {
title: 'Workspace Worktree',
selectProjectFirst: 'Select a project first',
selectProjectFirstHelp: 'Choose a project in the sidebar to configure its worktree root.',
workspacePathLabel: 'Workspace Path',
workspacePathHelp: 'Project root for {{name}}.',
worktreeRootLabel: 'Worktree Root',
worktreeRootHelp: 'Relative path is based on project root.',
worktreeRootPlaceholder: '.opencove/worktrees',
resolvedPathLabel: 'Resolved Path',
resolvedPathHelp: 'Where new worktrees will be created.',
pullRequestBaseBranchesLabel: 'Pull Request Base Branches',
pullRequestBaseBranchesHelp:
'Suggestions shown when creating PRs on the canvas. The repository default branch is always included.',
pullRequestBaseBranchesEmpty: 'No base branches configured.',
pullRequestBaseBranchesPlaceholder: 'e.g. develop',
environmentVariablesTitle: 'Environment Variables',
environmentVariablesHelp:
'Custom environment variables injected into terminals and agents in this workspace.',
searchResultDescription: 'Project worktree and environment settings.',
environmentVariablesEmpty: 'No environment variables configured.',
environmentVariablesKeyLabel: 'Environment variable name',
environmentVariablesValueLabel: 'Environment variable value',
environmentVariablesKeyPlaceholder: 'e.g. NODE_ENV',
environmentVariablesValuePlaceholder: 'e.g. development',
}
67 changes: 67 additions & 0 deletions src/app/renderer/i18n/locales/zh-CN.settingsPanel.layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,73 @@ export const zhCNSettingsPanelLayout = {
diagnostics: '诊断',
projects: '项目',
sectionsLabel: '设置分区',
pageSelectorLabel: '设置页面',
expandProjects: '展开项目',
collapseProjects: '收起项目',
},
navGroups: {
application: '应用',
workspace: '工作区',
connections: '连接',
advanced: '高级',
projects: '项目',
},
pageDescriptions: {
general: '设置语言、更新和常用偏好。',
appearance: '调整主题、界面文字与终端字体。',
notifications: '管理系统通知与待命信息。',
canvasWindows: '调整画布操作与窗口行为。',
agent: '选择并配置 AI 助手。',
tasksShortcuts: '设置任务默认项、快捷操作与快捷键。',
worker: '配置 Worker 运行方式、访问与远程端点。',
integrations: '连接 OpenCove 与外部服务。',
advanced: '管理实验性功能与诊断选项。',
},
groups: {
general: {
languageRegion: '语言与地区',
softwareUpdates: '软件更新',
},
appearance: {
interface: '界面',
terminal: '终端',
},
notifications: {
system: '通知方式',
standby: '待命横幅',
},
canvasWindows: {
canvasInput: '画布输入',
nodeFocus: '节点定位',
spaceArchiving: 'Space 归档',
windowTerminal: '窗口与终端',
},
agent: {
providers: 'Agent 提供方',
permissions: '权限',
},
tasksShortcuts: {
taskTitles: '任务标题',
taskTags: '任务标签',
quickActions: '快捷操作',
keyboard: '键盘快捷键',
},
worker: {
runtime: 'Worker 运行',
remote: '远程连接',
webAccess: '浏览器访问',
},
integrations: {
github: 'GitHub',
},
advanced: {
websiteWindows: '网页窗口',
diagnostics: '性能诊断',
},
workspace: {
worktrees: 'Worktree',
environment: '运行环境',
},
},
appearance: {
title: '显示与字体',
Expand Down
Loading
Loading