修复:AGC 窗口标题栏项目标签改认当前项目(#618)
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m40s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 7m15s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 8m17s
Project CI / Frontend tests (pull_request) Successful in 2m51s
Project CI / Backend tests (pull_request) Successful in 7m38s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m58s
Project CI / Repository checks (pull_request) Successful in 6m18s
Project CI / Native shell tests (pull_request) Has been cancelled

- 窗口标题栏标签主文案恒为当前项目名:WindowChromeActiveProjectRuns 新增 currentProjectName,由 WorkspaceLauncher 发布当前项目清单名,WindowChrome 透传给标题栏入口
- 正在运行的项目降级为圆点、运行中数量徽标与展开菜单:ActiveProjectRunsPanel 主文案不再取开始时间最晚的在跑项目
- 展开菜单里当前项目那一行沿用清单项目名,meta 首位标「当前」,aria-current 保留
- 运行快照读取失败不再整块替换标签:圆点转告警色,结论落在菜单内一行;既无在跑项目又无当前项目名时保留原来的纯提示
- 新增 .launcher-runs-panel-dot.is-warning 与 .launcher-runs-titlebar-menu-note 样式
- 用例:directActiveTurns 新增三条回归(别的项目在跑时标签仍是当前项目、当前项目自己跑时列表带「当前」、读取失败不顶掉当前项目名),WindowChrome 新增当前项目优先级用例,并把「只显示最后开始的项目」用例改名为「不在项目内时…」
- 文档:修正主规范 2026-09-15 段的标题栏条目、里程碑与实施计划文末修订,decision-log 追加 2026-10-04 决策
This commit is contained in:
2026-10-04 18:52:45 +08:00
parent 65514328f3
commit c9df6edc63
11 changed files with 302 additions and 82 deletions
@@ -9580,3 +9580,13 @@ CI 上 `background_agent_runtime_recovers_stale_running_before_pending_task` 在
- 验证:`npm run agc:bundled-resources:test`(18 passed,含 sidecar 归位、跳过规则、上游缺失、版本漂移、目录被占);`npm run agc:bundled-resources:check`、`check-config.mjs`、`cargo test --bin genarrative-ai-game-creator-shell package_layout::tests`、`cargo check --no-default-features`、`cargo fmt --check`、`check:encoding`、eslint/prettier 全部通过;Windows 真机准备步骤 staging 24 个文件(含 243MB `claude.exe`)后 `cargo check` 不再出现构建期写入。
- 边界(未验证):macOS 真机的 sidecar 加载与 `check-macos-bundle.mjs` 包内容门禁未在本机验证;Linux 门禁按新配置不再要求 sidecar 资源,需 CI 实跑确认转绿。
- 关联:issue #519、master `fb130d184`、`docs/technical/【技术方案】AGC随包资源staging归位-2026-09-26.md`、CI run 3083。
## 2026-10-04 AGC 窗口标题栏项目标签改认「当前项目」,运行中项目降级为圆点与徽标
- 背景:issue #618。窗口标题栏那枚标签原来被「正在运行的项目」整块接管——`WindowChrome` 只要存在活动回合或运行快照读取失败,就把当前工作区标题换成 `ActiveProjectRunsPanel`(titlebar 形态),主文案取开始时间最晚的在跑项目。于是「当前项目没在跑、后台别的项目在跑」时,标签显示的是别的项目(现场:当前项目 `gameagent-ff7f3240`,标签 `gameagent-c3af9c7e`),用户以为自己开错了项目;读取失败时标签还会变成「正在运行的项目读取失败」,同样顶掉当前项目名。
- 决策(主文案):标签主文案恒为当前项目名,与当前项目是否在跑回合无关;不在项目内(首页 / 项目组 / 模板库)才回落到最后开始的在跑项目。名字由 `WorkspaceLauncher` 经 `WindowChromeActiveProjectRuns.currentProjectName` 发布(`currentProjectContext.projectName`,即清单项目名)。这同时消掉了同一项目「有回合在跑显示目录名、没在跑显示项目名」的两种口径。
- 决策(运行态):圆点 + 运行中数量徽标(≥1 即显示)+ 展开菜单;菜单里当前项目那一行用与标签同名的项目名,meta 首位带「当前」标记,`aria-current` 保留。读取失败改成告警色圆点 + 菜单内一行结论;只有既没有在跑项目、又没有当前项目可显示时才保留原来的纯提示。
- 有意未做:后台项目在菜单里仍是目录名(快照 `projectName` 由 Rust 取 `thread_id` 目录名)。改成清单项目名要在 `ThreadManager` 的 claim 路径里读 `.agent/manifest.json`,等于给纯内存模块加锁内文件 I/O,本轮不做。
- 影响范围:`apps/ai-game-creator-shell/src/components/WindowChrome.tsx`、`src/components/windowChromeContext.ts`、`src/features/app-shell/ActiveProjectRunsPanel.tsx`、`src/features/app-shell/WorkspaceLauncher.tsx`、`src/styles.css` 与两个定向用例文件;同步修正主规范 2026-09-15 段的标题栏条目、里程碑与实施计划文末修订。不改 Rust、快照命令字段、公共 API 与持久化。
- 验证方式:`npx vitest run apps/ai-game-creator-shell/tests/directActiveTurns.test.tsx apps/ai-game-creator-shell/tests/WindowChrome.test.tsx apps/ai-game-creator-shell/tests/workspaceWindowSync.test.tsx` → 22 passed(三条新回归:别的项目在跑时标签仍是当前项目、当前项目自己跑时列表带「当前」、读取失败不顶掉当前项目名);全量 `npm run test -- apps/ai-game-creator-shell/tests` 与真实 Chromium 冒烟见 PR。
- 关联:issue #618、`docs/project-memory/plans/【里程碑】Direct回合跨页面生命周期与运行中项目可见性-2026-09-15.md`(2026-10-04 修订)。