fix(console,ui,docs): 對齊 A10 ChatUSD 身分、修 A1 卡片導向、main typecheck 紅燈與 primary hover 文字蒸發 - #336
Conversation
- ChatUSD 全域欄(ec-agent)標籤由 A9 改掛 A10。route 身分已於 96eaa23 對齊 TARGET-shell(A9=機器人/自主巡檢、A10=其他應用/AI 決策工作台),ChatUSD 併入 A10,舊 usd-copilot 存為 legacy alias;殼層三處標籤未同步,本次補齊。 - A1 應用卡片 route 由 issues 修正為 a1(原本導向規則中心,非 A1 五步治理工作台)。 修 main 既有 typecheck 紅燈(CI 跑 npm run verify,在 typecheck 即掛;該紅燈隨 未經 PR 的直接 push 進入 main): - A4SemanticSearchPage 改用 Btn 既有 primary prop 取代 className。ec-btn-primary 在 CSS 中不存在,且 Btn 不接受 className prop 會直接丟棄——來源模式與解譯模式 按鈕的選中狀態原本完全不可見(真實 UI bug,非僅型別問題)。 - 移除 DemoControlPanel 中 collab 退役(contracts §1 #12 DO-NOT-RE-ADD)殘留的 死 props(type 定義+destructuring,零呼叫端、零使用處)。 TRUTH 對帳(PROCESS §2(b)): - as_of_commit 94e817b → 9a49d96 - a9/a10 列改記新 route 身分;註明 ChatUSD 右欄是全站元件、非 a9 頁面特徵 - viewer 區塊 3/5/6/7 由 not observed 更正為 PARTIAL:UI 已建且經 coordinator 真 fetch(StructureStats 空間巢狀樹、IfcSemanticPanel Pset/Qto 與空間包含鏈), 原記載屬 PROCESS §1 所禁的「不足宣稱」;區塊 3 缺口收斂為 dim/iso 篩選模式, 區塊 5 缺口收斂為後端 pipeline 無幾何/分類碼來源 - §3 標題 12→13 項(96eaa23 增列第 13 項未同步標題) - §3 #1 移除已過時的 A4「非 LLM」(4ec21c5 已接 Ornith vLLM semantic mode) verify: npm run verify 全綠(typecheck + build + vitest + struct-log) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3Mx7VchiGQwk3eUhxm43Z
純前端驗證(不需 coordinator/governance;由 playwright.config webServer 起 vite dev :5180): - #a9 h1=「A9 · 機器人 / 自主巡檢」,且依 PROCESS §3 斷言 NOT-BUILT 佔位頁對 /api/* 零呼叫 - #a10 h1=「A10 · 其他應用 / AI 決策工作台」;ChatUSD 全域右欄顯示 ROADMAP · A10 - #apps 的 A1 卡片點擊後導向 #a1(原誤導向 #issues) - #a4 來源/解譯模式按鈕選中時套用 Btn primary class(修復前 className 被丟棄,選中不可見) 截圖落點 artifacts/e2e/a9-a10-identity-a4-primary/(.gitignore 擋 evidence,引用前須 git add -f)。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3Mx7VchiGQwk3eUhxm43Z
`.ec-btn:hover:not(:disabled)` 的特異性 (0,3,0) 高於 `.ec-btn.primary` (0,2,0),會把 color 覆蓋成 --ec-grn——正是 primary 自身的背景色——使 hover 中的 primary 按鈕文字完全不可見。 影響全部四處 <Btn primary>,含 A1GovernanceWorkbenchPage.tsx:816 的「執行檢核」主要 CTA。 此缺陷長期存在但從未被觀測:toHaveClass 與 unit test 都只驗 class、不驗可讀性,只有 browser 截圖看得出來。本輪修 A4 選中高亮(className→primary)讓該樣式首次真正套用到 A4 按鈕上,才把 它暴露出來——截圖顯示選中的 semantic/deterministic 變成無文字的綠色方塊。 - edge-console.css:以 (0,4,0) 覆寫回 --ec-on-grn(border-color 本就同色,無須重申) - e2e spec:加 computed style 回歸防線(hover 時 color 不得等於 background) - e2e spec:修正 PROCESS §3 network 斷言——排除殼層 SharedStatusProvider(:34)對 /api/runtime/status 的全站健康輪詢。該輪詢每頁都發(HealthChips 資料源),非頁面資料 呼叫;若照字面計入,任何 route(含 #home/#a1)都無法滿足「佔位頁零 /api 呼叫」。 evidence(artifacts/e2e/a9-a10-identity-a4-primary/,git add -f 入庫): - a4-mode-primary-hover-readable.png:hover 中的 deterministic 綠底+深色文字清晰可見(修復後) - a4-mode-semantic-primary.png / a4-mode-deterministic-primary.png:選中高亮生效 - a9-robot-inspection.png / a10-ai-decision.png:route 身分正確+ChatUSD 標 ROADMAP·A10 - apps-cards.png / a1-workbench-after-card-click.png:A1 卡片導向 #a1(不再是 #issues) verify: npm run verify 全綠(52 files / 576 tests / struct-log);playwright 4/4 passed Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3Mx7VchiGQwk3eUhxm43Z
📝 WalkthroughWalkthroughThe change updates A9/A10 route documentation and navigation, adds Playwright coverage for A9, A10, apps, and A4 interactions, and adjusts console callback contracts, active button styling, hover text color, and ChatUSD labels. ChangesRoute and console updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR updates the web-viewer-sample console shell to match the intended A9/A10 identity (ChatUSD belongs to A10), fixes an A1 app-card misnavigation, resolves pre-existing main typecheck failures, and prevents primary button hover from making text unreadable. It also adds a Playwright E2E regression test and updates docs/plans/TRUTH.md to reflect verified UI presence/fetch behavior.
Changes:
- Align ChatUSD rail labeling/copy to A10, and fix A1 app card route to land on
#a1(not#issues). - Fix A4 mode/source selection highlighting by using
Btn’s existingprimaryprop (instead of an unused/nonexistent CSS class), and fix.ec-btnhover specificity so primary text remains readable. - Remove unused optional props from
DemoControlPanelto clear typecheck errors; add E2E coverage + update TRUTH ledger entries.
Reviewed changes
Copilot reviewed 7 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| web-viewer-sample/src/console/EdgeConsole.tsx | Updates ChatUSD rail “ROADMAP” label/copy and placeholder text from A9 → A10. |
| web-viewer-sample/src/console/edge-console.css | Adds a higher-specificity primary-hover rule to prevent hover from overriding primary text color. |
| web-viewer-sample/src/console/data.ts | Fixes A1 app card route from issues → a1. |
| web-viewer-sample/src/console/A4SemanticSearchPage.tsx | Switches selection styling to Btn primary={...} for visible, type-safe selected-state UI. |
| web-viewer-sample/src/components/DemoControlPanel.tsx | Removes unused optional props (and their defaults) to eliminate TS unused-variable errors. |
| web-viewer-sample/e2e/a9-a10-identity-a4-primary.spec.ts | Adds Playwright regression coverage for A9/A10 identity, A1 card navigation, and primary-hover readability. |
| docs/plans/TRUTH.md | Updates TRUTH entries to reflect verified route identity and viewer panel UI/fetch reality (without overclaiming runtime traces). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/plans/TRUTH.md`:
- Around line 3-4: Update the generated_from metadata in TRUTH.md to contain
only the current generation source and as-of date, removing the embedded
historical audit trail. Preserve the as_of_commit value and the document’s
provenance-current convention; do not add historical details to this file.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 21dbad88-d096-421a-9d7a-92054d61fdf4
⛔ Files ignored due to path filters (7)
artifacts/e2e/a9-a10-identity-a4-primary/a1-workbench-after-card-click.pngis excluded by!**/*.pngartifacts/e2e/a9-a10-identity-a4-primary/a10-ai-decision.pngis excluded by!**/*.pngartifacts/e2e/a9-a10-identity-a4-primary/a4-mode-deterministic-primary.pngis excluded by!**/*.pngartifacts/e2e/a9-a10-identity-a4-primary/a4-mode-primary-hover-readable.pngis excluded by!**/*.pngartifacts/e2e/a9-a10-identity-a4-primary/a4-mode-semantic-primary.pngis excluded by!**/*.pngartifacts/e2e/a9-a10-identity-a4-primary/a9-robot-inspection.pngis excluded by!**/*.pngartifacts/e2e/a9-a10-identity-a4-primary/apps-cards.pngis excluded by!**/*.png
📒 Files selected for processing (7)
docs/plans/TRUTH.mdweb-viewer-sample/e2e/a9-a10-identity-a4-primary.spec.tsweb-viewer-sample/src/components/DemoControlPanel.tsxweb-viewer-sample/src/console/A4SemanticSearchPage.tsxweb-viewer-sample/src/console/EdgeConsole.tsxweb-viewer-sample/src/console/data.tsweb-viewer-sample/src/console/edge-console.css
💤 Files with no reviewable changes (1)
- web-viewer-sample/src/components/DemoControlPanel.tsx
| as_of_commit: 9a49d96 | ||
| generated_from: 人工核對(2026-07-10 repo 盤點 + code 逐檔讀;2026-07-13 對 #323–#329 增量複核;2026-07-14 BCF provenance 路徑複核;2026-07-14 A9/A10 route 身分與 viewer 七區塊 code 對帳);未來可換腳本重生 |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Keep provenance current, not historical.
generated_from now embeds a multi-date audit trail, contradicting this document’s rule that historical narrative belongs in git. Keep only the current generation source/as-of date, or move the detailed audit trail to a separate historical artifact.
Proposed cleanup
-generated_from: 人工核對(2026-07-10 repo 盤點 + code 逐檔讀;2026-07-13 對 `#323`–#329 增量複核;2026-07-14 BCF provenance 路徑複核;2026-07-14 A9/A10 route 身分與 viewer 七區塊 code 對帳);未來可換腳本重生
+generated_from: 人工核對(current repo code、tests、artifacts);未來可換腳本重生📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| as_of_commit: 9a49d96 | |
| generated_from: 人工核對(2026-07-10 repo 盤點 + code 逐檔讀;2026-07-13 對 #323–#329 增量複核;2026-07-14 BCF provenance 路徑複核;2026-07-14 A9/A10 route 身分與 viewer 七區塊 code 對帳);未來可換腳本重生 | |
| as_of_commit: 9a49d96 | |
| generated_from: 人工核對(current repo code、tests、artifacts);未來可換腳本重生 |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/plans/TRUTH.md` around lines 3 - 4, Update the generated_from metadata
in TRUTH.md to contain only the current generation source and as-of date,
removing the embedded historical audit trail. Preserve the as_of_commit value
and the document’s provenance-current convention; do not add historical details
to this file.
pr-review-agent.yml:28 以 `github.event.pull_request.body` 讀取 PR body(event payload), 且 on.types 僅 [opened, synchronize, reopened, ready_for_review]——不含 edited。因此改 PR body 不會重新觸發,`gh run rerun` 也只會拿到舊 payload。以空 commit 產生 synchronize event。 補齊內容(依 scripts/tests/check-pr-body-evidence.ps1 的實際規則): - Runtime action:據實記錄「無 coordinator 環境下 sessionId=null、HealthChip 標『尚無 session 證據』」,並附 Playwright runId(原填「無」不符 :67 的 runtime ID regex) - Visible success state:補齊 loading / success / failure / retry 四態(:72 要求),並明確 區分「本輪 E2E 實測」與「既有行為未覆蓋」 - Screenshot / trace:逐檔列出 7 張 .png(:77 要求可識別的 artifact) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3Mx7VchiGQwk3eUhxm43Z
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 081926b243
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // /api/runtime/status 餵頂部 HealthChips 健康燈,屬全站殼層行為、非頁面資料呼叫; | ||
| // 若照字面把它算進來,任何 route(含 #home/#a1)都無法滿足此斷言。故排除後再斷言。 | ||
| const SHELL_HEALTH_POLL = "/api/runtime/status"; | ||
| const pageApiCalls = apiCalls.filter((u) => !u.includes(SHELL_HEALTH_POLL)); |
There was a problem hiding this comment.
Filter the conversion status poll from this assertion
When this spec is run against a live coordinator (for example with the default Playwright webServer env pointing the viewer at :8005), SharedStatusProvider does not stop at /api/runtime/status: after that succeeds it also calls coordinatorClient.getConversionRecords(100), which issues GET /api/conversion/records?limit=100 from the same shell status rail. Since this filter only excludes runtime status, the new “placeholder page zero API” assertion fails even though the page itself did not request any data; stub/disable the provider or exclude the conversion poll as shell traffic too.
Useful? React with 👍 / 👎.
2026-07-14 對 viewer 七區塊做 code 對帳,發現三條 gap 建立在已被 code 推翻的前提上 (源頭是 TRUTH §2 的「不足宣稱」,已於 #336 修正)。照原 BACKLOG 派工,會有人去重做 一個早已存在的前端,而真正缺的後端資料源沒人碰。 - `gap-viewer-m4-tree-filter`:**範圍縮小**。空間巢狀樹已建——console/viewer/ StructureStats.tsx 經 coordinator spatial-tree for-session proxy 真 fetch、 loading/error/no_url/ok 四態齊全。本 gap 只剩 dim/iso 篩選模式,距離由 「PARTIAL×中」下修為「小×中」。 - `gap-viewer-m4-geom-pset`:**性質從前端工項改為後端工項**。前端的⑤幾何/分類碼卡與 區塊 6 的 Pset/Qto 面板皆已建且真 fetch(console/viewer/IfcSemanticPanel.tsx),並依 誠實鐵律標 roadmap N/A。真正的缺口是**後端 pipeline 無 BBox/體積/材質/分類碼來源**, 端點依 contracts §1 #6 誠實回 null。DONE 定義改為「pipeline 產出幾何與分類碼,使 geometry/classification 不再恆為 null」——前端無須改動即生效。blocker 補上「動工前先做 runtime probe」(比照 A3 clash 的 has_occ=False 教訓)。 - `gap-viewer-m4-spatial`:**刪列**。空間包含鏈 UI 已建且真 fetch,前端已達成其 DONE 定義;僅差 tracked browser trace,該取證併入 gap-status-calibration(已於該列註明)。 並修正「viewer gap 實作接點註」: - 數量六→五(spatial 刪列後)。 - 原註寫「viewer 前端真身…非 src/console/ 殼層」,意在區隔 EdgeConsole,但字面易被誤讀成 「元件檔不在 src/console/ 目錄下」。repo 內並無 src/viewer/ 目錄——元件實際位於 src/console/viewer/,而渲染入口才是 src/Window.tsx(經 /ui/open 302 的 :5173 baked viewer app)。照原註會找錯位置。現分列「元件檔位置」與「渲染入口」兩點。 未動 gap-viewer-m4-select-semantic 與 gap-viewer-m4-mapping-table:本輪未對帳其前提, 不憑推測改動。 Claude-Session: https://claude.ai/code/session_01G3Mx7VchiGQwk3eUhxm43Z Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Summary
修 A9/A10 route 身分對齊後留下的殼層殘留,並順帶修掉
main上既有的 typecheck 紅燈與一個從未被觀測到的 UI bug。96eaa23已把 route 身分對齊 TARGET-shell(A9=機器人/自主巡檢、A10=其他應用/AI 決策工作台,ChatUSD 併入 A10、舊usd-copilot存為 legacy alias),但殼層全域 ChatUSD 右欄的三處標籤仍掛 A9。本次補齊。data.ts的 A1 卡片route: "issues"會把使用者送到規則中心,而非#a1的五步治理工作台。修為a1。main既有 typecheck 紅燈(4 個):CI 跑npm run verify,在 typecheck 就掛,任何新 PR 都會被擋。已在乾淨9a49d96上以git stash複驗確認為 pre-existing(隨未經 PR 的直接 push 進入 main)。.ec-btn:hover的特異性高於.ec-btn.primary,把文字色覆蓋成與自身背景相同的--ec-grn。影響全部四處<Btn primary>,含A1GovernanceWorkbenchPage.tsx:816的「執行檢核」主要 CTA。AI Coding Governance
Requirement source明細:TARGET-shell.md§a9/§a10(route 身分,已凍結a9@v2/a10@v3)、PROCESS.md§1 誠實鐵律、§2(b) TRUTH 同步、§3 network 面斷言。GitNexus evidence說明:GitNexus index 停在de6c1d2(stale)。本 PR 無 shared/exported symbol 語意變更;唯一 interface 變更是DemoControlPanelProps移除兩個 optional props(onEmitCoordinatorHighlight/onCreateAnnotation——collab 依 contracts §1 #12 DO-NOT-RE-ADD 退役後的殘留),已 grep 驗證零呼叫端傳入、零使用處,blast radius 為 0。Frontend Verification
#a9、#a10、#apps、#a4#apps的 A1 應用卡片SharedStatusProvider.tsx:34對/api/runtime/status的全站健康輪詢(每一頁都發,HealthChips 資料源)SharedStatusProvider.tsx:34輪詢/api/runtime/status失敗,畫面據實顯示sessionId=null——截圖右上 HealthChip 標「GPU · 尚無 session 證據」,非偽綠。Playwright 執行識別runId=a9-a10-identity-a4-primary(4/4 passed)。#a4選中的模式按鈕顯示ec-btn primary(NVIDIA 綠底+深色文字,滑鼠停留其上仍可讀);#a9h1「A9 · 機器人 / 自主巡檢」;#a10h1「A10 · 其他應用 / AI 決策工作台」;ChatUSD 右欄「ROADMAP · A10」;#apps點 A1 卡片後 URL→#a1並渲染 A1 工作台。載入:
StructureStats/IfcSemanticPanel具 loading 態(既有行為,本 PR 未改動、本輪 E2E 未覆蓋)。失敗:無 coordinator 時 HealthChips 顯示「未取得」而非偽綠;A4
llm-status查詢失敗以.catch(() => null)降級、不阻斷頁面渲染(截圖可見頁面完整而 GPU chip 誠實標「尚無 session 證據」)。重試:A4 提供「重新整理來源」按鈕(見
a4-mode-*.png)。cd web-viewer-sample && npx playwright test e2e/a9-a10-identity-a4-primary.spec.ts→ 4/4 passedartifacts/e2e/a9-a10-identity-a4-primary/*.png(7 張,已git add -ftracked):a4-mode-primary-hover-readable.png(hover 文字可讀=CSS 修復實證)、a4-mode-semantic-primary.png、a4-mode-deterministic-primary.png、a9-robot-inspection.png、a10-ai-decision.png、apps-cards.png、a1-workbench-after-card-click.pngcd web-viewer-sample && npm run dev2. 開#a9/#a10,確認標題與右欄 ChatUSD 的 A10 標籤 3. 開#apps點「BIM 治理與模型檢核」卡片 → 應落在#a1(非#issues) 4. 開#a4點解譯模式任一顆 → 應變綠底且文字清晰可讀(把滑鼠留在按鈕上也不消失)gap-status-calibration,另案);BACKLOG 三個 viewer gap 的前提已被本輪 code 對帳推翻,重寫另開 PR;scripts/hooks/require-gstack-evidence.ps1的 deadlock 未修(另案);#a9/#a10後端仍 NOT BUILTDeploy Path Verification
cd web-viewer-sample && npm run verifyhttp://127.0.0.1:5180/#a9、#a10、#apps、#a4(vite dev,playwright webServer 啟動)artifacts/e2e/a9-a10-identity-a4-primary/Validation
npm run verify全綠:typecheck + build + 52 test files / 576 tests + struct-log(exit 0)npx playwright test e2e/a9-a10-identity-a4-primary.spec.ts→ 4/4 passedmain的 verify 是紅的:DemoControlPanel.tsx:231/232TS6133(宣告未使用)、A4SemanticSearchPage.tsx:235/251TS2322(Btn不接受className)。已git stash後在乾淨9a49d96上複驗,確認為 pre-existing,非本 PR 引入。A4SemanticSearchPage原寫className={... ? "ec-btn-primary" : undefined}:ec-btn-primary這個 class 在整個 CSS 中不存在,且Btn不接受className會直接丟棄 → 來源模式與解譯模式按鈕的選中狀態原本完全不可見。改用Btn既有的primaryprop 後修復,並因此暴露出下述 hover bug。toHaveClass(/primary/)與 unit test 都只驗 class、不驗可讀性。已加 computed style E2E 斷言(hover 時color不得等於background)作為回歸防線。Known Risks
.ec-btn.primary:hover的修復依賴特異性 (0,4,0) 壓過 (0,3,0)。若日後有人再提高.ec-btn:hover規則的特異性,會再度回歸——已加 E2E computed style 斷言防守。/api/runtime/status輪詢。這是對規約的解讀:§3 字面上的「佔位頁對/api/*零呼叫」若把殼層全站健康輪詢計入,則任何 route(含#home/#a1)都無法滿足。此解讀已寫入 spec 註解,若與規約原意不符請在 review 指出。誠實邊界聲明(PROCESS §2(a))
本 PR 完成後,下列仍為 NOT BUILT /未取得,UI 維持誠實標示:
#a9/#a10維持AppVisionPage誠實佔位,prov="p4",頁面零資料 API 呼叫。disabled,標籤改掛ROADMAP · A10,tool trace 僅版型。gap-status-calibration。a4列)。🤖 Generated with Claude Code
https://claude.ai/code/session_01G3Mx7VchiGQwk3eUhxm43Z