数据目录 F2b / C3:剖析报告里关系的结论(升为已验证、仍为已验证、保持推断……)不再是像链接的蓝色正文,改成状态标签的样子:带框的小标签,图标着状态色,文字用次要文字色;补检查脚本的断言

This commit is contained in:
ThearchyHelios
2026-10-04 02:09:54 +08:00
parent 163f3b96b3
commit 434d825926
2 changed files with 24 additions and 1 deletions
+8 -1
View File
@@ -408,6 +408,7 @@ function relationOutcome(f: CatalogProfileRelationFinding): { kind: RelationOutc
function RelationLine({ f }: { f: CatalogProfileRelationFinding }) {
const outcome = relationOutcome(f)
const Icon = outcome.icon
return (
<li className="text-xs" data-profile-finding="relation" data-status={f.status} data-path={f.path}>
<div className="flex flex-wrap items-center gap-x-1.5 gap-y-0.5">
@@ -421,7 +422,13 @@ function RelationLine({ f }: { f: CatalogProfileRelationFinding }) {
{' · '}
{PT.sampled(f.sample, f.matched)}
</div>
<div className="mt-0.5 text-2xs" style={{ color: outcome.tone }} data-profile-outcome={outcome.kind}>{outcome.text}</div>
{/* 结论是状态说明,不是链接:用状态标识的样子(带框的小标签、图标着状态色),正文用次要文字色 */}
<div className="mt-1">
<span className="chip !text-2xs" data-profile-outcome={outcome.kind}>
<Icon size={10} className="shrink-0" style={{ color: outcome.tone }} aria-hidden />
{outcome.text}
</span>
</div>
</li>
)
}
+16
View File
@@ -1496,6 +1496,22 @@ await section('数据目录 · 数据剖析', async () => {
&& (await gate.locator('[data-profile-cardinality]').innerText()) === '多对一' && (await gate.innerText()).includes('抽样 300 个键值,对上 296 个')
&& (await gate.locator('[data-profile-outcome]').innerText()) === '升为已验证' && (await gate.getAttribute('data-status')) === 'verified',
(await gate.innerText()).replace(/\s+/g, ' '))
// 结论是状态说明,不是链接:带框的小标签,文字用次要文字色(不是强调蓝),不能点
const outcomeLook = await gate.locator('[data-profile-outcome]').evaluate((el) => {
const probe = document.createElement('span')
probe.style.color = 'var(--accent)'
document.body.append(probe)
const accent = getComputedStyle(probe).color
probe.style.color = 'var(--text-dim)'
const dim = getComputedStyle(probe).color
probe.remove()
const cs = getComputedStyle(el)
return { tag: el.tagName, color: cs.color, accent, dim, border: cs.borderTopStyle, cursor: cs.cursor, kind: el.getAttribute('data-profile-outcome'),
clickable: !!el.closest('a, button') }
})
check('……结论用状态标签的样子:带框、次要文字色,不是蓝色正文、不像链接', outcomeLook.kind === 'raised' && outcomeLook.color === outcomeLook.dim
&& outcomeLook.color !== outcomeLook.accent && outcomeLook.border === 'solid' && outcomeLook.cursor !== 'pointer' && !outcomeLook.clickable,
JSON.stringify(outcomeLook))
const member = visitsCard.locator(`[data-profile-finding="relation"][data-path="relations.${MEMBER_REL}"]`)
check('……覆盖率不够的保持推断,写明原因', (await member.locator('[data-profile-outcome]').innerText()) === '保持推断:覆盖率不足,可能不是这条关系'
&& (await member.locator('[data-profile-coverage]').innerText()) === '覆盖率 62%')