From 95e1948a5fe2d869a8c70bbb3925cdee9a7a8d7d Mon Sep 17 00:00:00 2001 From: weichen Date: Thu, 15 Oct 2026 06:52:42 +0000 Subject: [PATCH] Distinguish retired and stale trace relations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why: Retired edges and compliance edges awaiting review both fell back to a generic lifecycle label. Evidence: Presentation tests, production build, knip, and diff checks pass. Impact: The trace network now shows 已停用 and 待复核 as distinct human-readable states. Refs: readable trace network --- src/components/RdmAuditWorkspace.tsx | 2 +- src/rdmAuditPresentation.test.ts | 2 ++ src/rdmAuditPresentation.ts | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/RdmAuditWorkspace.tsx b/src/components/RdmAuditWorkspace.tsx index d58cfaa..c742cbe 100644 --- a/src/components/RdmAuditWorkspace.tsx +++ b/src/components/RdmAuditWorkspace.tsx @@ -520,7 +520,7 @@ function RelationRow({ r, selected }: { r: RelationEntry; selected: { kind: stri {readable.layer} {readable.type} {humanizeKind(other?.kind)}“{other?.title || other?.id || '未知对象'}”{other?.ver ? `(版本 ${other.ver})` : ''} - {readable.state} + {readable.state} ) } diff --git a/src/rdmAuditPresentation.test.ts b/src/rdmAuditPresentation.test.ts index 488242b..e359c4d 100644 --- a/src/rdmAuditPresentation.test.ts +++ b/src/rdmAuditPresentation.test.ts @@ -80,6 +80,8 @@ describe('RDM audit presentation', () => { it('humanizes tree, relationship, and lifecycle vocabulary', () => { expect(humanizeKind('section')).toBe('章节') expect(humanizeState('candidate')).toBe('待确认') + expect(humanizeState('retired')).toBe('已停用') + expect(humanizeState('stale')).toBe('待复核') expect(humanizeRelation({ layer: 'compliance', type: 'verifies', state: 'active' })).toEqual({ layer: '合规关系', type: '验证', diff --git a/src/rdmAuditPresentation.ts b/src/rdmAuditPresentation.ts index 4202761..0370386 100644 --- a/src/rdmAuditPresentation.ts +++ b/src/rdmAuditPresentation.ts @@ -34,6 +34,7 @@ const KIND_LABELS: Record = { const STATE_LABELS: Record = { active: '已生效', candidate: '待确认', pending: '待处理', baselined: '已建立基线', + retired: '已停用', stale: '待复核', approved: '已批准', rejected: '已拒绝', revoked: '已撤销', superseded: '已被取代', failed: '失败', committed: '已生效', accepted: '已接受', cancelled: '已取消', delivered: '已记录',