From b15fd19d8e81ccabdb8b6414ee4da5064b58ab70 Mon Sep 17 00:00:00 2001 From: Wanderingss <1624155937@qq.com> Date: Tue, 17 Nov 2026 00:10:29 +0800 Subject: [PATCH] docs(roles): drop golden-reference counts that had already gone stale The UI role stated the content-page golden-reference count twice and disagreed with itself: 66 in one line, 74 in another, 76 on disk. The skill file repeated the 74. The font charset line had drifted the same way, from 224 characters to 230. Counts like these go stale the moment a page is added or a character is set, so the file should not carry them at all. Both places now say to read the number from the gate that prints it: check_content_pages.py reports the frame count, check_font_charset.py reports the charset size, and ui_font_cn_12.c carries the glyph list. A role file that contradicts itself is worse than one with a gap, because the reader cannot tell which number to trust and has to go measure, which is exactly what the number was supposed to save. --- .dsh/roles/ui-specialist.md | 6 +++--- .dsh/skills/lvgl-simulator/SKILL.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.dsh/roles/ui-specialist.md b/.dsh/roles/ui-specialist.md index 02c531f3..3fbafcdd 100644 --- a/.dsh/roles/ui-specialist.md +++ b/.dsh/roles/ui-specialist.md @@ -125,7 +125,7 @@ LVGL Pro CLI 提供完整的 headless 测试链:`lvglpro generate` → `lvglpr - **LVGL 160×160 单色菜单**:uiTask 渲染、菜单树结构、内容页布局 - **PC 模拟器**:CMake + SDL2 构建、无头截图自检(`--screenshot/--keys/--standby/--cfgtest/--logtest/--idle`)、与固件同标准受检 - **菜单树生成器**:`tools/menu_gen/gen_menu.py`,输入 `ui_menu_tree.txt` + `ui_cn_chars.txt`,产物纳入 `generated-fresh` 门禁 -- **UI 自动化回归**:菜单 8 状态 + 内容页 66 张黄金参考(`ui-golden` 钩子) +- **UI 自动化回归**:菜单 8 状态 + 内容页黄金参考(`ui-golden` 钩子)。**具体张数不写死**——它随菜单和页面增删必然过期,跑 `check_content_pages.py` 时它会自己打印当前数。 - **板端 UI 交互**:STATUS 身份查询、`--where/--goto` 闭环导航(操作手册全文内联在下文第三部分) ## 铁律 @@ -255,7 +255,7 @@ PC 上编译运行与 MCU **同一份** UI 源码(CMake + MSVC + SDL2,x64, ### UI 改动回归 → 按上文 ui-verify 节执行(勿零散手跑) -5 步门禁 = 构建 → `check_menu_rows.py`(菜单 8 状态像素 + 池基线)→ `check_content_pages.py`(文本断言 + 74 张黄金参考 + 往返池 + rtlive)→ `/keil-build` → `coding-standard`。 +5 步门禁 = 构建 → `check_menu_rows.py`(菜单 8 状态像素 + 池基线)→ `check_content_pages.py`(文本断言 + 全量黄金参考 + 往返池 + rtlive)→ `/keil-build` → `coding-standard`。 RemoDispBus 推流回归单独跑:`.venv\Scripts\python.exe simulator/tests/check_remo_sink.py`。 黄金参考 `tests/ref/*.bin` **随仓库入库**(`.gitignore` 在全仓 *.bin 兜底之后又显式反选,2026-10-22 起;缺基准 = 新克隆跑 `ui-golden` 必 FAIL):不入库的只是派生目检图 `ref/*.png`,换机后先 `check_content_pages.py --update` 生成,再 `regen_ref_png.py` 出目检 PNG。 @@ -374,5 +374,5 @@ python tools/font_gen/extract_cn.py # 扫描 UI 源码字符串 → - `requirements.txt` 必须**纯 ASCII**(Windows 下 pip 按 GBK 解码,中文注释 → UnicodeDecodeError) - 生僻字(宋体可能无字形)→ **写码前先手动验证字形**,避免"代码写完才发现是空白" - 生成成功后跑上文 ui-verify 节全回归;黄金参考因字形变化而 FAIL 属预期 → `check_content_pages.py --update` 刷新 -- 字数变化时同步更新文档中的字符集计数(当前 **224** 汉字/符号 + ASCII 0x20-0x7E,共 **319** 字形;2026-10-29 实测:`ui_cn_chars.txt` 唯一码点 224、`ui_font_cn_12.c` 的 `.bitmap_index` 320 条含 notdef → 319 字形。历史上 119/214 → 179/274 → 185/280 → 218/313 均为当时快照):`UI_中文字体生成与配置.md`、`UI_界面制作流程.md` C3、`UI_设计架构.md`、`simulator/README.md` 已知坑 #4 +- 字数变化时同步更新文档中的字符集计数。**但角色文件里不写死具体数字**——它随字集增删必然过期,且历史上已经出现过同一文件里两处计数互相矛盾的情况。权威来源是 `check_font_charset.py` 的输出(`字符集: N 字` 与 `coverage OK: N 个字符全部进字体`)和 `ui_font_cn_12.c` 的 `unicode_list_1` 条目数,需要数字时现跑现看。需要同步的文档:`UI_中文字体生成与配置.md`、`UI_界面制作流程.md` C3、`UI_设计架构.md`、`simulator/README.md` 已知坑 #4 - **新增字低于既有最小码位**(如 Ⅰ U+2160)会下探稀疏 cmap 起点并吞掉单码位补回条目(实测 ▶ 箭头全变方框而旧版 coverage 全绿)——`make_font.py`(2026-10-25 起)按 LVGL 首命中语义插入/守卫/校验,扩字后模拟器像素回归**必跑** diff --git a/.dsh/skills/lvgl-simulator/SKILL.md b/.dsh/skills/lvgl-simulator/SKILL.md index 760fa5b1..47efd766 100644 --- a/.dsh/skills/lvgl-simulator/SKILL.md +++ b/.dsh/skills/lvgl-simulator/SKILL.md @@ -34,7 +34,7 @@ PC 上编译运行与 MCU **同一份** UI 源码(CMake + MSVC + SDL2,x64, ## UI 改动回归 → 用 `ui-verify` skill(勿在此零散手跑) -5 步门禁 = 构建 → `check_menu_rows.py`(菜单 8 状态像素 + 池基线)→ `check_content_pages.py`(文本断言 + 74 张黄金参考 + 往返池 + rtlive)→ `/keil-build` → `coding-standard`。 +5 步门禁 = 构建 → `check_menu_rows.py`(菜单 8 状态像素 + 池基线)→ `check_content_pages.py`(文本断言 + 全量黄金参考 + 往返池 + rtlive)→ `/keil-build` → `coding-standard`。 RemoDispBus 推流回归单独跑:`.venv\Scripts\python.exe simulator/tests/check_remo_sink.py`。 黄金参考 `tests/ref/*.bin` **随仓库入库**(`.gitignore` 在全仓 *.bin 兜底之后又显式反选,2026-10-22 起;缺基准 = 新克隆跑 `ui-golden` 必 FAIL):不入库的只是派生目检图 `ref/*.png`,换机后先 `check_content_pages.py --update` 生成,再 `regen_ref_png.py` 出目检 PNG。