合并 origin/master 到 Game Agent 读取路径分支
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m26s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m57s
Project CI / Backend tests (pull_request) Successful in 4m8s
Project CI / Frontend tests (pull_request) Successful in 2m17s
Project CI / Native shell tests (pull_request) Successful in 6m44s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 9m7s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 9m16s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m38s
Project CI / Repository checks (pull_request) Successful in 2m28s

- 决策记录同时保留外壳状态栏浮层与 Game Agent 读取路径两条 2026-09-29 条目
This commit is contained in:
2026-09-29 13:18:48 +01:00
15 changed files with 358 additions and 124 deletions
@@ -1,5 +1,17 @@
# 决策记录
## 2026-09-29 外壳状态栏退役:`status` 一行改由浮层承载
- 背景:首页输入框下方、项目组页面头部那一行由 `WorkspaceLauncher` 的 `status` 承接,写入的内容很杂——进行中进度(`正在创建工作区`、`正在选择项目`)、“已取消 / 已创建项目 / 已打开项目目录”这类回显、失败结论(`创建未完成,请重试`、工作区看门狗文案、Provider 报错)以及项目组页面的 `正在检查项目状态`。这一行常驻占页面,用户明确要求整行改成浮层提示,而不是只把「已取消」挑出来。
- 决策(一个通道):`status` 不再由页面渲染,统一由外壳浮层承载(`LauncherNoticeToast`)。`HomeView` 只保留 `onStatusChange`,`ProjectsPage` 去掉 `status` prop 与 `.launcher-project-page-status` 那段;项目组页面的 `正在检查项目状态` 由外壳按 `recentWorkspaceRefreshing` 与当前视图合成后进入同一通道。
- 决策(生存期按需要分两种):进行中进度与失败结论走**粘性**浮层(`sticky: true`,不自动收起)——这与原来那一行一致,切页回来仍能看到,重建的 10 分钟看门狗文案也不会一闪而过;成功、取消这类回显走**一次性**浮层(`showTransientNotice`,`tone='neutral'` / 成功 2.6 秒、失败 6 秒)。一次性提示优先显示,自己收起后粘性状态(仍在的话)继续显示。
- 决策(显示范围照旧):粘性状态只挂在 `home` / `projects` 两个页面上,进项目工作台、模板库、帮助页不再飘在界面上(原来那一行也只长在列表页上),状态本身留着,回首页 / 项目组时照旧显示;运行 / 预览反馈与取消回显不受这条限制,仍在哪里发生就在哪里弹。
- 决策(一枚 toast):`RunNoticeToast` 更名 `LauncherNoticeToast`(类型 `LauncherNotice` 增加 `sticky`、挂点 `data-launcher-notice-toast`),运行 / 预览反馈、状态栏内容、取消回显共用一个挂点与一套色调;长文案容器限宽 `min(680px, 100vw - 2rem)` 并换行。
- 决策(计时不被重渲染打断):收起回调只从 ref 读,不写进 effect 依赖——外壳每渲染一次都会换一个内联箭头函数,写进依赖会让 2.6 秒在每次重渲染时重新起算。
- 影响范围:`apps/ai-game-creator-shell/src/features/app-shell/{LauncherNoticeToast.tsx,model.ts,WorkspaceLauncher.tsx,ProjectCreation.tsx,useHomeProjectCreation.ts}`、`src/view/home/index.tsx`、`src/styles.css`;用例 `apps/ai-game-creator-shell/tests/launcherNoticeToast.test.tsx`(新增粘性不收起、重渲染不重新计时、取消短时收起)与 `launcherNoticeShellWiring.test.tsx`(原 `runNoticeToast` / `runNoticeShellWiring`;新增「进行中状态与取消回显都只走浮层、首页不留那一行」)、`tests/appSurface/home.suite.ts` 三处取消断言、`tests/{homeWebPreflight,designProjectRestore}.test.tsx` 的 hook 参数。
- 验证:`npx vitest run apps/ai-game-creator-shell/tests` → 191 passed / 1 skipped;`npx tsc -p apps/ai-game-creator-shell/tsconfig.json --noEmit`;`eslint`(改动文件)、`prettier --check`(改动代码文件)、`npm run check:encoding`、`npm run check:doc-index`、`npm run typecheck`、`git diff --check`。
- 边界:本次只改这一条状态通道的呈现。首页那行**带动作**的提示留在原地——建项已落盘但没进项目时的「已创建的工作区:<路径>」+「打开已创建的工作区」按钮要能点,不能飘走;设置弹层里「项目创建目录」选择器的「已取消」仍是弹层内自己的状态文案,未一并改动;浮层外观没有在真机窗口里目测过(取消原生选择器需要 Tauri 客户端窗口)。
## 2026-09-29 Game Agent 读取工具接受绝对路径和项目外路径
- 决策:`agc_read_project_context` 与 `agc_list_project_files` 可以读取绝对路径,以及用 `..` 离开当前项目的路径。项目内相对路径仍拒绝 `.agent`、凭据文件名、符号链接和硬链接。项目外读取同样拒绝这些受保护名字和链接,但不因路径落在项目外而失败。
@@ -9553,7 +9565,7 @@ CI 上 `background_agent_runtime_recovers_stale_running_before_pending_task` 在
- 决策(运行页顶栏是唯一入口):运行区域上方的状态行与预览地址小字整体退役(运行画面回到两行栅格);预览地址改成顶栏动作区里的一枚「在浏览器打开」按钮(opener 插件的 `openUrl`,只在有活预览时渲染;`scripts/check-native-shells.mjs` 另加「视图里 `openUrl(` 只有一个调用点」的判据);版本入口搬进同一个顶栏动作区,外观复用 `.game-workbench-view-actions button` 的基础规则,不再自带边框 / 底色 / hover,也不再是绝对定位浮层。版本入口在**资源画布与运行页**显示,UI 编辑器壳里不渲染(那一页是聚焦编辑某个资源的界面)。版本名改用一层 span 承载省略号——按钮是 flex 容器,文本直接挂在按钮上时 `text-overflow` 不生效。
- 决策(运行页不挂生成任务):`ResourceCanvasAssetGenerationTasksPanelView` 只在资源画布 / UI 编辑器出现,运行页的入口、面板与锚点都不渲染;`[data-generation-tasks-placement='run']` 那一档坐标与组件 `placement` 联合类型里的 `run` 一并删除。任务不丢,切回资源页即可见。
- 边界:预览的**启动与切换**仍然只走内置运行画面、不自动开系统浏览器——`scripts/check-native-shells.mjs` 那条负向守卫保持原样,本轮只补「浏览器入口只有顶栏这一枚按钮」的正向断言。
- 影响面:`apps/ai-game-creator-shell/src/{App.tsx,styles.css,view/project-development/index.tsx,features/app-shell/*,features/resource-canvas/*}`;用例新增 `tests/runPreviewBrowserOpen.test.tsx`、`tests/runNoticeToast.test.tsx`、`tests/runNoticeShellWiring.test.tsx`(外壳级:替身聊天发提示 → 壳真的渲染浮层)、`tests/gameRunToolbarActionsStyle.test.ts`,改写 `tests/previewActivation.test.tsx`(原断言「聊天里出现已载入运行视图」的地方改为断言 toast 通道 + 对话容器里没有这类提示,并补一条「启动失败走失败色提示且不写对话区」)与 `tests/appSurface/project-development.suite.ts` 的生成任务入口用例。
- 影响面:`apps/ai-game-creator-shell/src/{App.tsx,styles.css,view/project-development/index.tsx,features/app-shell/*,features/resource-canvas/*}`;用例新增 `tests/runPreviewBrowserOpen.test.tsx`、`tests/runNoticeToast.test.tsx`、`tests/runNoticeShellWiring.test.tsx`(外壳级:替身聊天发提示 → 壳真的渲染浮层)、`tests/gameRunToolbarActionsStyle.test.ts`,改写 `tests/previewActivation.test.tsx`(原断言「聊天里出现已载入运行视图」的地方改为断言 toast 通道 + 对话容器里没有这类提示,并补一条「启动失败走失败色提示且不写对话区」)与 `tests/appSurface/project-development.suite.ts` 的生成任务入口用例。(后续更名:`RunNoticeToast` 与那两条用例自 2026-09-29 起叫 `LauncherNoticeToast` / `launcherNoticeToast.test.tsx` / `launcherNoticeShellWiring.test.tsx`,见当日条目。)
- 验证:`appSurface` 全量、AGC 壳目录全量、`npm run typecheck`、`check:native-shells:contract`、`check:encoding`、`git diff --check` 全绿;真机观感未复验。
## 2026-09-22 DirectProject 聊天状态显式化:回合三态 + 「在跑吗」唯一派生入口 + 数据流地图