From 83e81d12aca0f31473e0bc4e62b36c46c8e97631 Mon Sep 17 00:00:00 2001 From: weichen Date: Sat, 17 Oct 2026 04:30:32 +0000 Subject: [PATCH] Sync panorama node detail on refresh; scope scenario 4 to the fixture doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why: the cockpit refresh reloaded overview and tree but left the node detail at its old snapshot, so the 刷新对齐 banner persisted after refreshing (DV-R05 wants every projection to advance). PanoramaNode now refetches when the overview snapshotRevision advances. Scenario 4 also scoped its tree clicks to the 验证主体报告 branch — the unscoped first caret expanded an unrelated rdm-self doc. Evidence: tsc clean, vitest green, build green (SELF); seven-scenario rerun to be recorded on the Dev I4 card. Impact: cockpit panorama + e2e spec. Refs: rollout I4 --- e2e/rdm-cockpit.playwright.ts | 5 +++-- src/components/DocumentCockpit.tsx | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/e2e/rdm-cockpit.playwright.ts b/e2e/rdm-cockpit.playwright.ts index fb23037..1009aba 100644 --- a/e2e/rdm-cockpit.playwright.ts +++ b/e2e/rdm-cockpit.playwright.ts @@ -111,8 +111,9 @@ test.describe.serial('I4 文档驾驶舱组合验收', () => { test('4 一致性:API 采纳新版本后,刷新入口与各投影同步', async ({ page }) => { await loginOwner(page) await openCockpit(page) - await page.locator('.cockpit-tree-caret').first().click() - await page.locator('.cockpit-tree-title', { hasText: '设计说明' }).first().click() + const branch4 = page.locator('.cockpit-tree-branch', { hasText: '验证主体报告' }).first() + await branch4.locator('.cockpit-tree-caret').click() + await branch4.locator('.cockpit-tree-title', { hasText: '设计说明' }).first().click() const snapBefore = await page.locator('.cockpit-snap').innerText() // 通过应用自身 API 落一个已提交变更(需求账本新增条目,唯一键防幂等跳过; // 采纳走高危确认卡、服务端不允许客户端伪造 Confirmed,故用低危提交面驱动)。 diff --git a/src/components/DocumentCockpit.tsx b/src/components/DocumentCockpit.tsx index b271301..e7c08b0 100644 --- a/src/components/DocumentCockpit.tsx +++ b/src/components/DocumentCockpit.tsx @@ -197,6 +197,7 @@ export function DocumentCockpit() { )} {overview && selected && viewMode === 'panorama' && ( setSelected(null)} @@ -290,10 +291,11 @@ function PanoramaHome({ overview, onSelect }: { overview: CockpitOverview; onSel ) } -function PanoramaNode({ pid, selection, overview, childPage, density, onClear, onOpenReader }: { +function PanoramaNode({ pid, selection, overview, childPage, density, snapRev, onClear, onOpenReader }: { pid: string; selection: Selection; overview: CockpitOverview childPage?: { items: CockpitTreeNode[]; nextCursor?: string; hasMore: boolean; meta?: CockpitMeta } density: Density + snapRev: string onClear: () => void onOpenReader: () => void }) { @@ -314,7 +316,7 @@ function PanoramaNode({ pid, selection, overview, childPage, density, onClear, o }) .catch(e => { if (g === gen.current) setErr(e.message) }) return () => { gen.current++ } - }, [pid, selection.ref.kind, selection.ref.id]) + }, [pid, selection.ref.kind, selection.ref.id, snapRev]) const node = (detail?.node || null) as CockpitTreeNode | null const title = node?.title || selection.ref.id return (