Files
windroost/HANDOFF.md
T
wushenghua 4f4b7d918a fix(ui): polish skill bar, victory modal, 360px underlines and raw keys
- battle manual actions now share one skill bar backing with accent rules and
  dividers; button rects, mouse_filter and callbacks unchanged
- victory/dialog panel is opaque with a darker dim so battle chrome no longer
  shows through; action labels and 44px hit areas unchanged
- idle underline and tab baselines brightened/thickened for 360px readability
- UiText.node_name() falls back to localized chapter theme + node number, so
  full-game nodes no longer render [content.node.*] raw keys; locale keys intact

Evidence: 9ba98ef-polish before/after runtime captures, strict import and
focused touch/UI regressions all PASS. No merge, push or release.
2026-11-29 08:23:08 +08:00

129 lines
15 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Windroost UI 视觉语言 candidate 交接
## 身份与边界
- 角色:UI 视觉实现 worker(本地 candidate,非 PMO 验收、非发布)。
- 初始基线 HEAD:`1e11038a6a998b81dcec75ca1e78fc2111f74671`;视觉语言迭代 2 基线:`c5fdd500247a2cf6416641496f013beda96b00f3`;本轮 PMO 复核修复基线:`c85337ee6aef8deb2f128a2aca579cb8c2498d9f`。
- 独立 worktree:`windroost-worktrees/hapi-windroost-ui-language-fix`,分支 `wr-ui-language-fix`。
- 未改主树,未 merge / push / package / sign / release。
- 范围仅按钮呈现与层级以及底部 Tab 高亮同步;未新增付费生成资产,全部复用现有 `assets/icons` 与 `UiTheme`。
## 本轮:剩余代码级视觉打磨(9ba98ef → 本地 candidate)
- 角色:UI 呈现 worker(本地 candidate,非 PMO 验收、非发布)。
- 基线 HEAD:`9ba98ef`(worktree `windroost-worktrees/pmo-ui-polish-20261129`,分支 `pmo-ui-polish-20261129`);开始与结束时工作树均为干净基线 + 本轮改动,无 upstream(worktree 分支),未 merge / push / package / sign / release。
- 只复用现有 `assets/icons` 与 `UiTheme` 样式工厂;未新增/替换任何图像资产,未改 locale 数据表键。
### 四项改动(diff 摘要)
1. 战斗技能栏(`ui_theme.gd`、`battle_hud.gd`):三个手动动作的容器由 `glass_panel()` 改为新的 `make_skill_bar_panel()`——一条连续暗色底条 + 上下细线;每个按钮改用 `skill_bar_slot_style()`,只保留 3px 强调底线(金/青/紫),去掉填充矩形与前两个闭合边;在 Tap/Storm 按钮右缘加入 1px `MOUSE_FILTER_IGNORE` 分隔线。按钮 `custom_minimum_size`(132×52 / 88×52 / 88×52)、`alignment`、`mouse_filter`、文案/冷却逻辑、pressed 回调全部未动,热区不变。
2. 胜利弹层可读性(`battle_hud.gd`):`_modal_panel` 单独覆盖为近不透明面板(alpha 0.985,保留顶边细线与原 content margin),modal 遮罩 alpha 0.72 → 0.84。此前透过玻璃面板可见的战斗技能栏/英雄牌文字已消失。动作按钮、文案、`disabled`、44px 热区未动。
3. 360px 下划线对比(`ui_theme.gd`):`underline_style` 常态 `#5a708f` 1px → `#8ba3c4` 2px;`tab_style` 未选中 `#3b5070` 1px → `#6d86a8` 2px;弹层次级动作底线 `#5a4a2a` → `#8a6f43`。选中/激活强调线(金/薄荷)仍为 3px,层级不变。
4. raw key 消除(`ui_text.gd`、`game_root.gd`、`battle_hud.gd`、`ui_page_world.gd`):新增 `UiText.node_name(node_id, locale)`——有 `content.node.<id>` 时正常返回;否则复用现有 `world.theme.<chapter>` 本地化名称 + 节点号(如「岩脉隧道 01」/「Vein Tunnel 01」),不再向标签输出 `[content.node.R3-C05-N0x]`。四个调用点(U1 地图节点名、U2 世界节点列表 label、战斗 HUD 节点标题、世界详情)统一走该 helper。locale 表未增删改任何键,经济/存档/战斗规则未动。
### 本轮证据
- before:`p2_godot_sample/artifacts/ui_language_captures/9ba98ef-polish-before/`;after:`.../9ba98ef-polish-after/`。各 10 张 PNG + `manifest.json`(文件名、视口、locale、SHA-256):skyport / world / side / loadout / victory / battle @ 390×844 zh_CN、skyport @ 360×800 与 430×932 zh_CN、skyport + world @ 390×844 en_US。复现:`./p2_godot_sample/run_ui_language_capture.sh artifacts/ui_language_captures/9ba98ef-polish-<before|after>`。
- 严格导入:`run_headless_smoke.sh` PASS(编辑器导入 + 3 场景,`P2_HEADLESS_SMOKE`)。首次在新 worktree 运行 capture 因缺少 class cache 报解析错误,先跑该 smoke 重建缓存后恢复;`project.godot` 无残留 churn。
- 聚焦触控/UI 回归(全部 PASS):`run_touch_test.sh`(`TOUCH_INPUT_PASS 3 real ScreenTouch events verified`,含 Tap/Storm 真实触摸与冷却)、`run_ui_scroll_layout_test.sh`(PASS)、`run_modal_states_test.sh`(`MODAL_PASS 2 stages verified`)、`run_battle_exit_test.sh`(`BATTLE_EXIT_PASS`)、`run_ui_slice_capture.sh`(`UI_SLICE_PASS 48 shots`,360/390/430 × zh/en × normal/reduced)、`run_capture.sh`(`UI_CAPTURE_PASS 25 captures`,全部 `layout_ok=true`)。日志仅有既有 Godot 退出时 ObjectDB/RID leak warning,无 `SCRIPT ERROR` / Parse Error / 资源导入失败。
- 测试重生成的已跟踪证据 PNG/JSON 已 `git checkout -- p2_godot_sample/artifacts/` 还原基线;candidate 只含 5 个源码脚本 + before/after 目录 + 本文。`project.godot` 无改动。
- 视觉复核(agent_visual_reviewed):技能栏三槽在 before 是三个填充盒,after 是一条带分隔线的连续底条 + 强调底线;胜利弹层 after 不再透出背后按钮文字;360px 空闲下划线更亮更粗;world 列表 after 为「岩脉隧道 01/02/03」,无方括号 raw key。
- 证据级别:`runtime_verified(render + input) + agent_visual_reviewed(composition)`。不含 `human_reviewed` / `device_verified` / `release_accepted`。两次 capture 共用隔离 profile,离线金币数字会随状态变化(对比 focus 是控件呈现与可读性,不是数值)。
## 本轮:PMO 复核问题的最小修复(c85337e → 本地 candidate)
- 问题:底部 Tab 高亮此前只在 `_on_nav()` 里调用 `_refresh_nav_tabs()` 时刷新;从 World / 结算 / 战斗退出等非底栏入口经 `show_page()` 换页后会留下旧高亮(`c5fdd50/after/world_390_zh_CN.png` 中 World 页仍高亮“天空港”)。
- 修复(`p2_godot_sample/scripts/game_root.gd`,仅 2 处):
1. `show_page()` 在 `current_page = page` 之后直接调用 `_refresh_nav_tabs()`,覆盖所有非 `PAGE_BATTLE` 换页路径(World、结算、战斗退出、返回按钮、debug 路由等)。
2. 删除 `_on_nav()` 末尾已冗余的 `_refresh_nav_tabs()`,避免同一次点击刷新两次;路由与点击回调完全未动。
- `_refresh_nav_tabs()` 本体未改;`show_page()` 首次调用发生在 `_build_bottom_nav()` 之后,`_nav_buttons` 已就绪。
- 冻结项未触碰:触区尺寸与 `mouse_filter`、`UiText` 文案表与 locale、经济/存档、战斗规则与数值、动效 API、其他视觉样式。
### 本轮证据
- 重取截图(正常渲染):`p2_godot_sample/artifacts/ui_language_captures/c85337e-navfix/`,10 张 PNG + `manifest.json`(文件名、视口、locale、SHA-256):world / victory / battle / side / loadout @ 390×844 zh_CN、skyport @ 360×800 与 430×932 zh_CN、skyport + world @ 390×844 en_US。
- 复现:`./p2_godot_sample/run_ui_language_capture.sh artifacts/ui_language_captures/c85337e-navfix` → `UI_LANGUAGE_CAPTURE_PASS 10 shots`,无 `SCRIPT ERROR`。
- 视觉复核(agent_visual_reviewed):对比 `c5fdd50/after/world_390_zh_CN.png`(World 页残留“天空港”金色下划线),`c85337e-navfix/world_390_zh_CN.png` 四个 Tab 均无高亮;`skyport_390_zh_CN.png` 仍正确高亮“天空港”。战斗/胜利页导航本就隐藏,渲染正常。
- 回归(全部 PASS,命令与原候选一致):`run_headless_smoke.sh`(编辑器导入 + 3 场景)、`run_touch_test.sh`(`TOUCH_INPUT_PASS 3 real ScreenTouch events verified`)、`run_ui_scroll_layout_test.sh`(`UI_SCROLL_LAYOUT_PASS`)、`run_ui_slice_capture.sh`(`UI_SLICE_PASS 48 shots`,360/390/430 × zh/en × normal/reduced)、`run_modal_states_test.sh`(`MODAL_PASS 2 stages verified`)、`run_battle_exit_test.sh`(`BATTLE_EXIT_PASS`,含 map/growth/skyport/side 四 Tab 退出与重入)、`run_ui_language_capture.sh`(`UI_LANGUAGE_CAPTURE_PASS 10 shots`)。
- 日志检查:无 `SCRIPT ERROR` / Parse Error / 资源导入失败;仅有 Godot 退出时的既有 ObjectDB/RID leak warning(与基线一致)。测试重生成的已跟踪证据已还原;candidate 只含 `game_root.gd`、新截图目录与本文。
- 证据级别:`runtime_verified(render + input) + agent_visual_reviewed(composition)`;不含 `human_reviewed` / `device_verified` / `release_accepted`。
## 视觉语言改动(diff 摘要)
1. `p2_godot_sample/scripts/ui_theme.gd`
- 新增 `underline_style()`:次级动作只保留一条底部细线作为可点击提示,去掉填充矩形;热区与 `MOUSE_FILTER_PASS` 不变。
- 新增 `slot_style()`:技能槽用单侧强调边 + 半透明底,而不是闭合卡片框;新增 `skill` 层级(青色,给风暴号令)。
- `tab_style()` 由“填充小盒子”改为 tab chrome:选中为短金色底线 + 极淡底色,未选中透明 + 暗底线。
- `build_theme()` 的全局 Button 改为安静下划线样式;Panel 改为半透明玻璃 + 单条顶部细线。
- `make_panel()` 同步为玻璃卡片(不再有闭合边框)。
- `make_menu_button()` 的 `primary` / `special` 改为技能槽;`secondary` 改为 icon+文字下划线;`quiet` 保持最轻。
- 新增 `make_nav_button()`:底部导航/侧页签的 icon+文字 tab chrome。
- 新增 `make_dialog_action()`:弹层与胜利结算中只有主动作有暖色强调线,其余 quiet。
- `make_primary_cta()`:迭代 1 保持平坦金色;迭代 2 改为复用现有九宫格材质(见下)。每页仍只有一个主 CTA。
2. `p2_godot_sample/scripts/game_root.gd`
- 底部导航改用 `make_nav_button()`,复用现有 `icon_flag / icon_chest / icon_hammer / icon_bow`;选中态由新增的视觉专用 `_refresh_nav_tabs()` 移动,路由仍在 `_on_nav()`。
- `_show_modal()` 与 `_show_victory()` 的动作按钮改用 `make_dialog_action()`,主动作强调、其余 quiet;文案、`disabled`、回调和 44px 热区不变。
3. `p2_godot_sample/scripts/battle_hud.gd`
- 风暴号令层级由 `secondary` 改为 `skill`;Tap / Ultimate 仍为 `primary` / `special` 技能槽。三按钮 `custom_minimum_size`(132×52 / 88×52 / 88×52)与动态文案逻辑未动。
4. 证据工具(不改游戏行为)
- `p2_godot_sample/scripts/ui_language_capture_runner.gd`
- `p2_godot_sample/run_ui_language_capture.sh`
## 迭代 2:以当前截图为 before 的可读化打磨
- before:`p2_godot_sample/artifacts/ui_language_captures/c5fdd50/before/`
- after :`p2_godot_sample/artifacts/ui_language_captures/c5fdd50/after/`
- 主 CTA 材质:`make_primary_cta()` 改为复用已有 `ui_frame_button.png` / `ui_frame_button_pressed.png` 九宫格,作为全局唯一有材质的表面;保留 STRETCH 轴模式(TILE 会把 6px 金边重复成网格,已实测并撤回);hover 提亮、disabled 降饱和,56px 热区不变。
- 次级动作仍为无完整矩形底的 icon+text / underline / chip:下划线常态提亮为 `#5a708f`、激活态 3px;`make_menu_button()` / `make_nav_button()` / `make_dialog_action()` / `make_primary_cta()` 均显式设置 `font_disabled_color`,禁用态不再糊成一片。
- 未新增资源;仅改 `UiTheme` 与调用层,图标与九宫格全部来自现有 `assets/`。
### `project.godot` 核查结论
Godot 编辑器导入 / capture 运行时确实会临时重写 `p2_godot_sample/project.godot`(键顺序重排、插入/移除 `[editor]` 段,属于 import churn,与 UI 视觉无关)。本轮每次测试后均已 `git checkout -- p2_godot_sample/project.godot` 恢复;最终 `git diff -- p2_godot_sample/project.godot` 为空,candidate 不含任何项目配置改动。产品 diff 只含 UI visual-language 脚本,证据目录与 runner 单独提交。
### 迭代 2 回归
`run_headless_smoke.sh` PASS;`run_capture.sh` 25 张全部 `layout_ok=true`、无 `SCRIPT ERROR`;`run_touch_test.sh`、`run_ui_scroll_layout_test.sh`、`run_ui_slice_capture.sh`、`run_loadout_ui_test.sh`、`run_side_systems_ui_test.sh`、`run_modal_states_test.sh`、`run_reward_celebration_test.sh`、`run_battle_exit_test.sh` 全部 PASS。测试重新生成的已跟踪证据已还原基线。
## 冻结项确认
未触碰:触区尺寸与 `mouse_filter`、页面路由、`UiText` 文案表与 locale、经济/存档、战斗规则与数值、动效 API。未引入新的 raw key;世界里已有的 `[content.node.R3-C05-N0x]` 在 before 截图中同样存在,属于既有问题,不是本 candidate 引入。
## before / after 证据
真实渲染截图(正常渲染,非 headless):
- before:`p2_godot_sample/artifacts/ui_language_captures/1e11038a/before/`
- after :`p2_godot_sample/artifacts/ui_language_captures/1e11038a/after/`
- 各目录含 `manifest.json`(文件名、视口、locale、SHA-256)与 10 张 PNG:
- skyport / world / side / loadout / victory / battle @ 390×844 zh_CN
- skyport @ 360×800、430×932 zh_CN,skyport + world @ 390×844 en_US
- 复现命令:
`./p2_godot_sample/run_ui_language_capture.sh artifacts/ui_language_captures/1e11038a/<before|after>`
- 证据级别:`runtime_verified(render) + agent_visual_reviewed(composition)`。不含 `human_reviewed` / `device_verified` / `release_accepted`。
注意:两次 capture 共用隔离测试 profile 目录,离线收益数字会随 profile 状态变化(before 显示 458 金币、after 显示 6–40 金币)。对比 focus 是控件呈现与层级,不是数值。
## 回归结果(全部 PASS)
- `run_headless_smoke.sh`:编辑器导入 + 3 场景 headless smoke 通过。
- `run_capture.sh`(C1 战斗 HUD 契约):25 张截图,全部 `layout_ok=true`,`UI_CAPTURE_PASS`;日志仅有既有的 “BattleStage caps visible heroes at 5” 警告,无 `SCRIPT ERROR`。
- `run_touch_test.sh`:真实 `InputEventScreenTouch` 通过。
- `run_ui_scroll_layout_test.sh`:列表滚动 filter / 扁平样式断言通过。
- `run_ui_slice_capture.sh`:U1 矩阵(360/390/430 × zh/en × normal/reduced)通过,CTA 稳定与 48px 触区断言通过。
- `run_loadout_ui_test.sh`、`run_side_systems_ui_test.sh`、`run_modal_states_test.sh`、`run_reward_celebration_test.sh`、`run_battle_exit_test.sh`:全部 PASS。
测试重新生成的已跟踪证据 PNG/JSON 已还原为基线;本 candidate 只保留专用 before/after 目录与源码 diff。
## 视觉问题状态
1. 战斗技能槽相邻填充盒(原问题 1)→ 本轮已改为连续 skill bar + 强调底线 + 分隔线,热区不变。
2. 胜利弹层半透明透出背后按钮(原问题 2)→ 本轮已改为近不透明面板 + 更暗遮罩。
3. 360px 下划线对比(原问题 3)→ 本轮已提亮加粗;仍建议真机人工判断极端背景下的可读性。
4. World raw key(原问题 4)→ 本轮由 `UiText.node_name()` 兜底消除,locale 键未改。
5. 仍未解决:人工理解度、选择质量、继续游玩意愿、真机触感与性能(只能由 owner / fresh player 验证)。
## 最短下一步
PMO 对照本 candidate 的 5 个源码 diff 与 `9ba98ef-polish-before/after` 截图,确认四项视觉改动与冻结项边界;若接受,再由 owner 在 360/390/430 的 zh/en 真机上做人工可读性、层级与触感判断。在此之前不要 merge、push、打包、签名或发布。