Skip to content

Commit 38c0df9

Browse files
committed
refactor(theme): 清理 v2.5/v2.6 残留,统一 v3 命名 + 归档历史文档
以最新 v3 为准做纯净化,不改任何运行时行为: - 全量符号改名:ResolvedV25→ResolvedV3 / ResolveV25→ResolveV3 / resolvedV25→resolvedV3 / TestV26GoldenSnapshot→TestV3GoldenSnapshot; golden 目录 golden_v26→golden_v3、manager_v25_test.go→manager_v3_test.go - 注释纯净化:误导性"当前=v2.5/v2.6"改 v3;溯源标记去死版本号留阶段; build_all.ps1 与 scripts_mac/build.sh 的 _layouts/_palettes(v2.5) 注释改 _base(v3); 保留正确的历史引用(旧主题回退、legacy-v26 fixture、迁移对比文档) - 历史文档归档:docs/design/archive/(v26-freeze + P2/P6/architecture/P7/P8)、 wind_input/docs/design/archive/(P4/P5);保留 theme-schema-v3.md + theme-v3-freeze-report.md + AGENTS.md 为权威;新建 archive/AGENTS.md 索引并修正交叉引用 - 修复 golden 行尾隐患:新建 .gitattributes 将 golden 快照钉为 eol=lf, 根治 core.autocrlf 在 checkout 时转 CRLF 导致逐字节比较跨机/CI 误判回归 验证:双 module 编译 + theme/internal/ui 测试 + gofmt 全绿
1 parent d8e2271 commit 38c0df9

88 files changed

Lines changed: 261 additions & 224 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 主题 golden 快照基线由测试逐字节比较,生成端用 LF。
2+
# 固定为 LF,避免 core.autocrlf=true 在 checkout 时转成 CRLF 导致跨机/CI 误判回归。
3+
wind_input/pkg/theme/testdata/golden_v3/*.txt text eol=lf

build_all.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
param(
1+
param(
22
[ValidateSet("all", "dll", "service", "setting", "portable")]
33
[string[]]$Module = @("all"),
44

@@ -605,14 +605,14 @@ function Prepare-DataFiles {
605605
}
606606
Write-Detail " - 已复制预制数据文件 ($dataCopied 个文件)"
607607

608-
# 复制主题文件: 每个主题目录的 theme.yaml + 共享零件目录 _layouts / _palettes (v2.5)
608+
# 复制主题文件: 每个主题目录的 theme.yaml + 隐藏基础主题目录 _base (v3 单链继承)
609609
Write-Detail " - 复制主题文件..."
610610
$themesSrc = Join-Path $ScriptDir "wind_input\themes"
611611
$themesDst = Join-Path $DataDir "themes"
612612
if (Test-Path $themesSrc) {
613613
Get-ChildItem -Path $themesSrc -Directory | ForEach-Object {
614614
$name = $_.Name
615-
# 下划线前缀目录视为 v2.5 共享零件 (_layouts / _palettes), 整目录递归复制
615+
# 下划线前缀目录视为隐藏基础主题 (_base), 整目录递归复制
616616
if ($name.StartsWith("_")) {
617617
$destDir = Join-Path $themesDst $name
618618
if (-not (Test-Path $destDir)) { New-Item -ItemType Directory -Path $destDir -Force | Out-Null }

docs/design/AGENTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- Parent: ../AGENTS.md -->
2-
<!-- Generated: 2026-04-20 | Updated: 2026-06-03 -->
2+
<!-- Generated: 2026-04-20 | Updated: 2026-06-04 -->
33

44
# design/ - 活跃设计与技术方案文档
55

@@ -24,8 +24,8 @@
2424
| `macos-port.md` | macOS 移植设计 (IMKit + Go 服务双进程模型, UDS bridge 协议, uicmd 命令模型, 与 Win 端 wind_tsf 的对应关系, PR-A 工作清单) |
2525
| `macos-imkit-plan.md` | **PR-A 实战手册**: macOS IMKit `.app` 工程目录结构 / Swift 类骨架 / Info.plist 模板 / 6 个开发里程碑 / 验证步骤 / 风险清单 |
2626
| `enum-constraint.md` | 枚举与魔法字符串约束 SSOT (跨模块共享) |
27-
| `theme-view-architecture.md` | 主题渲染架构演进:从固定化渲染到统一 View 盒模型(margin/padding/background/border/layers/states + Text 排版),具名 View + 可换 token palette + 整数 z 层级 + 通用 Image/资源表;含 P0-P4 分阶段与迁移 |
28-
| `theme-schema-v3.md` | 主题 Schema v3:结构归一(删 layout 并入 views / 删 candidate_window 颜色组并入 colors 扁平 token)+ 亮暗统一(`Variant<T>` 贯穿颜色与图片)+ base 单链继承 + Fill(色·渐变·图)/font 分组;含 v2.6→v3 迁移映射与编辑器原型(`WindInputThemeEditor/src/lib/theme3`)作参考实现 |
27+
| `theme-schema-v3.md` | **主题 Schema v3(当前权威设计语义)**:结构归一(删 layout 并入 views / 删 candidate_window 颜色组并入 colors 扁平 token)+ 亮暗统一(`LightDark<T>` 贯穿颜色与图片)+ base 单链继承 + Fill(色·渐变·图)/font 分组;含 v2.6→v3 迁移映射与编辑器原型(`WindInputThemeEditor/src/lib/theme3`)作参考实现 |
28+
| `theme-v3-freeze-report.md` | **主题 v3 冻结契约(当前权威)**:冻结字段面 + 求值语义快照 + 不兼容旧主题(不合法整体回退 default)+ golden 逐字节验收证据。历史演进/阶段文档(architecture/P2/P4-P8、v26-freeze)已移入 `archive/` |
2929
| `settings-incremental-save.md` | 设置端全局保存重构:快照 diff + 按 key 最小化提交(`Config.Set`)。根治「全局保存整份覆盖、formData 不含 stats 导致 null 冲掉 track_english」的 bug;独立段(stats/dict)天然隔离 |
3030

3131
## 文件分类

docs/design/archive/AGENTS.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!-- Parent: ../AGENTS.md -->
2+
<!-- Generated: 2026-06-04 | Updated: 2026-06-04 -->
3+
4+
# design/archive/ - 已完成设计方案历史归档
5+
6+
## 用途
7+
8+
**完成实现并验证**的设计/阶段计划文档。保留用于历史追溯与迁移对照,不再作为当前权威。
9+
当前权威的主题设计请看上级目录的 `../theme-schema-v3.md`(设计语义)与 `../theme-v3-freeze-report.md`(冻结契约)。
10+
11+
## 归档文件
12+
13+
| 文件 | 描述 |
14+
|------|------|
15+
| [theme-view-architecture.md](theme-view-architecture.md) | P0 架构演进叙事:从固定化渲染到统一 View 盒模型的设计与迁移路线(含已删除的 adapter/density/LayoutSchema/ResolvedTheme 等 v2.5/v2.6 机制)。**已被 `../theme-schema-v3.md` 取代** |
16+
| [theme-view-p7-schema-completion.md](theme-view-p7-schema-completion.md) | P7 完成度审计:候选窗 schema 能力清单与验收(点时态快照,引用已删除类型)。**已被 `../theme-v3-freeze-report.md` 取代** |
17+
| [theme-view-p8-other-windows.md](theme-view-p8-other-windows.md) | P8 其它窗口几何 View 化的阶段记录(菜单/Tooltip/状态泡/Toast,toolbar 几何延后) |
18+
| [theme-v26-freeze-report.md](theme-v26-freeze-report.md) | 主题 v2.6 候选窗盒模型 schema 冻结契约。**已解冻,被 v3 取代**(见 `../theme-v3-freeze-report.md`);保留作 v2.6→v3 迁移对照 |
19+
| [theme-view-p2-slice0-plan.md](theme-view-p2-slice0-plan.md) | P2 切片0:theme 解析 views + default 主题 YAML 基线(已实现) |
20+
| [theme-view-p2-slice0-views.md](theme-view-p2-slice0-views.md) | P2 切片0:View 盒模型 schema 上位 spec(已实现) |
21+
| [theme-view-p2-slice1-colors.md](theme-view-p2-slice1-colors.md) | P2 切片1:颜色/token 上位 spec(已实现) |
22+
| [theme-view-p2-slice1-plan.md](theme-view-p2-slice1-plan.md) | P2 切片1:颜色落地计划(已实现) |
23+
| [theme-view-p6-bridge-retirement.md](theme-view-p6-bridge-retirement.md) | P6:schema 三权分立 + 合成桥退役总设计(已实现) |
24+
| [theme-view-p6-stage1-schema-plan.md](theme-view-p6-stage1-schema-plan.md) | P6 阶段1:Behavior schema 定义与接入(已实现) |
25+
| [theme-view-p6-stage2a-plan.md](theme-view-p6-stage2a-plan.md) | P6 阶段2a:mergeViews 指针透传补全(已实现) |
26+
| [theme-view-p6-stage2b-plan.md](theme-view-p6-stage2b-plan.md) | P6 阶段2b:ResolveCandidateViews 几何/颜色求值(已实现) |
27+
28+
## 说明
29+
30+
- 这些文档描述的功能均已落地,其中涉及的 `v2.5`/`v2.6` 版本号为历史阶段标记——主题 schema 已于 2026-06-04 重构并冻结为 **v3**
31+
- P4/P5 阶段计划归档在另一棵文档树:`../../../wind_input/docs/design/archive/`
32+
- 归档文档之间的互相引用按同目录兄弟文件名解析,仍然有效。
33+
34+
<!-- MANUAL: -->
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)