From 737c7454d51d952fb8d49c1c9737a55b353c75d2 Mon Sep 17 00:00:00 2001 From: ThearchyHelios Date: Sun, 4 Oct 2026 02:15:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9B=AE=E5=BD=95=20F2b=20/?= =?UTF-8?q?=20D6=EF=BC=9A=E5=BD=B1=E5=93=8D=E9=9D=A2=E9=87=8C=E3=80=8C?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E5=BC=95=E7=94=A8=E3=80=8D=E7=9A=84=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E6=94=B9=E7=94=A8=E5=BC=BA=E8=B0=83=E8=89=B2=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E7=94=A8=E7=90=A5=E7=8F=80=E8=89=B2=E2=80=94?= =?UTF-8?q?=E2=80=94=E5=AE=83=E8=AF=B4=E7=9A=84=E6=98=AF=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E5=85=B3=E7=B3=BB=E7=9A=84=E5=BC=BA=E5=BC=B1=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E6=98=AF=E8=AD=A6=E7=A4=BA=EF=BC=9B=E3=80=8C=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E6=B6=89=E5=8F=8A=E3=80=8D=E4=BB=8D=E7=94=A8=E6=AC=A1=E8=A6=81?= =?UTF-8?q?=E6=96=87=E5=AD=97=E8=89=B2=EF=BC=9B=E8=A1=A5=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E7=9A=84=E6=96=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/CatalogImpact.tsx | 8 +++++++- scripts/check-catalog.mjs | 10 ++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/CatalogImpact.tsx b/frontend/src/components/CatalogImpact.tsx index a7f64c5e..f3cebc67 100644 --- a/frontend/src/components/CatalogImpact.tsx +++ b/frontend/src/components/CatalogImpact.tsx @@ -83,10 +83,16 @@ export function CatalogImpactList({ sourceId, table, refreshKey, compact = false ) } +/** + * 「直接引用」用强调色:它说的是引用关系的强弱,不是警示——琥珀色在全站是「等待、要人处理」,用在这里像是出了问题。 + * 「可能涉及」用次要文字色 + */ function ImpactBadge({ impact }: { impact: 'direct' | 'possible' }) { return ( {T.impact[impact]} diff --git a/scripts/check-catalog.mjs b/scripts/check-catalog.mjs index b34df21a..d86101b3 100644 --- a/scripts/check-catalog.mjs +++ b/scripts/check-catalog.mjs @@ -919,6 +919,16 @@ await section('数据目录 · 引用这张表的模板(影响面)', async ( const daily = sec.locator('[data-impact-template="wf-daily"]') check('直接引用:模板名、版本、受管、「直接引用」', ['入园日报', 'v4', '受管', '直接引用'].every((x) => text.includes(x)) && await daily.getAttribute('data-impact-level') === 'direct') + // 「直接引用」不是警示:用强调色,不用琥珀色(全站的「等待、要人处理」) + const directLook = await daily.locator('[data-impact="direct"]').first().evaluate((el) => { + const probe = document.createElement('span') + document.body.append(probe) + const tone = (v) => { probe.style.color = `var(${v})`; return getComputedStyle(probe).color } + const out = { color: getComputedStyle(el).color, accent: tone('--accent'), waiting: tone('--st-waiting') } + probe.remove() + return out + }) + check('「直接引用」用强调色,不用警示的琥珀色', directLook.color === directLook.accent && directLook.color !== directLook.waiting, JSON.stringify(directLook)) check('合并查询写明经由哪个输入', (await daily.locator('[data-impact-node="m"]').innerText()).includes('经由输入「查询入园人数」')) check('Agent 写「可能涉及」,悬停说明原因', (await sec.locator('[data-impact-template="wf-ask"] [data-impact="possible"]').getAttribute('title')).includes('运行时生成')) check('模板名点进去是画布,定位到那个节点', (await daily.locator('a').first().getAttribute('href')) === '/studio/wf-daily?focus=q')