Skip to content

Commit 41a1376

Browse files
committed
chore: distill local CLI UI patterns
1 parent 68289ea commit 41a1376

8 files changed

Lines changed: 239 additions & 67 deletions

File tree

.agents/skills/gettokens-domain-engineering/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ This skill unifies the technical rules for building, styling, and debugging GetT
118118
- **Themes**: Support `system`, `light`, and `dark`. Ensure `--bg-main` and `--bg-surface` are distinct in dark mode.
119119
- **l10n**: Add new copy to both `zh.json` and `en.json`. Default is Chinese.
120120
- **Controls**: Use segmented controls for discrete settings.
121+
- **Action Selects**: For `select + right-side actions` patterns, use the project-level `frontend/src/components/ui/ActionSelect.tsx` instead of hand-rolling label/select/button grids. Keep `+` and optional delete actions inside the select frame so field widths align across sibling rows.
122+
- **Status Local CLI Config**: In `StatusApplyLocalSection`, Codex and Claude Code tabs must share field components for equivalent concepts such as Relay API key, endpoint/base URL, provider, and model. Do not maintain parallel JSX just because one tab has fewer fields.
121123
- **Account Cards**: Account cards should support whole-card detail entry, but clicks originating from nested interactive controls (`button`, `input`, etc.) must not trigger the card-level detail action.
122124
- **Rotation Cards**: `AccountRotationModal` is a variant of the account card, not a second visual system. Reuse the account-card content hierarchy and only replace the bottom action strip plus rotation-only affordances such as rank rail and drag marker.
123125
- **Rotation Disable Semantics**:

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@ dist/
1010
frontend/dist
1111
frontend/node_modules
1212
.playwright-cli
13+
.playwright-mcp/
1314
.local/
15+
16+
.DS_Store
17+
docs-linhay/references/codex/
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# 2026-05-03 Status Local CLI UI Pattern
2+
3+
## 背景
4+
5+
本轮状态页本地 CLI 配置从单一 Codex 表单扩展为 `Codex / Claude Code` 双 tab。用户多次指出重复 JSX、按钮位置不一致、字段宽度不对齐和说明区过密的问题,最终形成一条可复用 UI 模式。
6+
7+
## 稳定规则
8+
9+
1. `Codex / Claude Code` tab 中表达同一概念的字段必须复用同一组件,不因目标 CLI 不同而复制一份相似 JSX。
10+
2. `select + 右侧动作按钮` 使用 `frontend/src/components/ui/ActionSelect.tsx`
11+
3. `ActionSelect``+` 和可选删除按钮位于 select 框内,select 本身占满父列,避免按钮数量不同导致字段边界不齐。
12+
4. 本地 CLI 配置区只保留可操作控件和右侧 diff;固定值、受控字段列表、说明性提示优先移除,除非它直接阻止用户误操作。
13+
5. 右侧 diff 继续由 `StatusSnippetPanel` 承载,增删行用红绿标识。
14+
6. Codex 写入语义是 `CODEX_HOME/auth.json` 字段 merge 与 `CODEX_HOME/config.toml` 受控 key patch;Claude Code 写入语义是 `settings.json` 的受控 `env` 字段 patch。两者都不能覆盖 MCP、profiles、agents、permissions、hooks、statusLine 或未知字段。
15+
16+
## 当前落点
17+
18+
- 通用控件:`frontend/src/components/ui/ActionSelect.tsx`
19+
- 页面控制器:`frontend/src/features/status/StatusFeature.tsx`
20+
- 状态页组件:`frontend/src/features/status/components/StatusPanels.tsx`
21+
- 本地 patch 模型:`frontend/src/features/status/model/relayLocalState.ts`
22+
- Claude Code 后端写入:`internal/wailsapp/claude_local_apply.go`
23+
- Codex feature 配置后端:`internal/wailsapp/codex_feature_config.go`
24+
25+
## 不纳入本次沉淀
26+
27+
- `docs-linhay/references/codex/` 是本地外部参考仓库副本,不作为项目文档资产提交。
28+
- `.playwright-mcp/` 是本地浏览器自动化临时目录。
29+
- `docs-linhay/spaces/.DS_Store` 是系统文件。

docs-linhay/memory/2026-05-03.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- 偏好更新:Codex feature 配置表格里的开关只保留拨档控件本体,不再在开关按钮内重复显示 ON/OFF 或默认值文案;开启态使用绿色,关闭态保持浅色底。
66
- 细节更新:Codex feature 开关滑块关闭态固定在左侧、开启态固定在右侧,使用 transform 动画过渡;滑块需始终留在线框内,不压出外框。
7+
- 表格收敛:移除 `Local Value` 列,避免 default/local/dirty 徽标与开关表达重复;每行保留 `Feature Key / Stage / Switch` 三列。
78
- 验证:`npm --prefix frontend run typecheck``npm --prefix frontend run build``git diff --check` 通过。
89

910
## Codex Feature 描述本地化
@@ -42,3 +43,9 @@
4243
- 偏好更新:状态页本地 CLI 配置区中,Codex 与 Claude Code 的 Relay API key 选择器、Endpoint / Base URL 区域必须复用同一组局部组件,不再在两个 tab 内平行维护同款 JSX。
4344
- 实现:`StatusApplyLocalSection` 复用 `StatusRelayKeyPicker``StatusEndpointPicker``StatusModelPicker`;Relay API key / Provider / Model 的“下拉 + 框内右侧动作按钮”已抽为项目级 `ActionSelect` 通用组件,Endpoint 模块统一承载 LAN Access、endpoint 选择与 Base URL 复制。
4445
- 验证:`npm --prefix frontend run typecheck``npm --prefix frontend run test:unit``git diff --check` 通过。
46+
47+
## 会话整理:本地 CLI 配置 UI 模式
48+
49+
- 沉淀结论:本轮重复出现的模式是“状态页本地 CLI 配置字段复用”和“select + 框内右侧动作按钮”。已写入项目级 `gettokens-domain-engineering` skill,并新增 `docs-linhay/dev/20260503-status-local-cli-ui-pattern.md`
50+
- 后续入口:遇到 Status 页 Relay key、Provider、Model 等下拉动作组合时,优先复用 `ActionSelect`;遇到 Codex / Claude Code 同概念字段时,先抽共享组件再改样式。
51+
- 不纳入:`.playwright-mcp/``docs-linhay/references/codex/``.DS_Store` 是本地临时或外部参考内容,只加入忽略规则,不作为本轮知识资产提交。

0 commit comments

Comments
 (0)