From 206ff98df36a2fcde9e78e0a1f63a89d8a846e69 Mon Sep 17 00:00:00 2001 From: Tom Tang <4220945+shiba4life@users.noreply.github.com> Date: Tue, 12 May 2026 21:12:43 +0800 Subject: [PATCH] refactor(discovery/utils): drop 2 dead exports + unexport 2 internal types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit discoveryUtils.ts exported TRUST_TIER_LABELS and trustTierLabel with zero references anywhere in the codebase — deleted. inferCategory and PreviewItem were exported but only consumed inside this file (groupByCategory calls inferCategory; buildPreviewItems returns PreviewItem) — dropped the export keyword, kept the definitions. Continues #1014/#1015/#1017/#1018/#1022/#1023. --- .../components/tabs/discovery/discoveryUtils.ts | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/server/static-react/src/components/tabs/discovery/discoveryUtils.ts b/src/server/static-react/src/components/tabs/discovery/discoveryUtils.ts index 5454b396..a2bf58c6 100644 --- a/src/server/static-react/src/components/tabs/discovery/discoveryUtils.ts +++ b/src/server/static-react/src/components/tabs/discovery/discoveryUtils.ts @@ -10,7 +10,7 @@ interface SchemaLike { /** Derive a category from schema field_interest_categories. * Returns the most common interest category across the schema's fields, * falling back to schema name if no interest categories are assigned. */ -export function inferCategory(schema: Schema | SchemaLike): string { +function inferCategory(schema: Schema | SchemaLike): string { const s = schema as SchemaLike if (s.field_interest_categories) { const counts: Record = {} @@ -45,7 +45,7 @@ export function fieldCount(schemas: Array): number { return count } -export interface PreviewItem { +interface PreviewItem { schema: string field: string type: string @@ -65,19 +65,6 @@ export function buildPreviewItems(schemas: Array): PreviewI return items } -/** Map numeric trust tier to human-readable label. */ -export const TRUST_TIER_LABELS: Record = { - 0: 'Public', - 1: 'Outer', - 2: 'Trusted', - 3: 'Inner', - 4: 'Owner', -} - -export function trustTierLabel(tier: number): string { - return TRUST_TIER_LABELS[tier] ?? `Tier ${tier}` -} - export function isLocalModeError(msg: string | null | undefined): boolean { return Boolean(msg) && ( msg!.includes('503') ||