From 3385863bd8f16bc4e2d5e1a46417500b81c9e2ee Mon Sep 17 00:00:00 2001 From: jackwener Date: Thu, 25 Jun 2026 03:58:41 +0800 Subject: [PATCH] chore(ui): demote 4 more unused-export interfaces to file-private MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to PR #224. After scanning a wider set of `components.tsx` exports, 4 more had zero external consumers: - `SkillEntry` (line 341 — skill catalog row shape) - `EmptyStateProps` (line 799 — empty-state component props) - `EmptyState` (line 811 — the component itself, used 10x internally) - `SearchModalCloseOptions` (line 2804 — internal close-event payload) `SkillEntry`: appears 5x in components.tsx (parent panel props, descriptor function, render helper) — internal-only. `EmptyState` + `EmptyStateProps`: PR-EMPTY-STATE-COMPONENT-0 (2026-05-19 task #8) extracted the shared component anticipating multi-file reuse. Three months later still only used inside components.tsx itself (10 call sites), all the surfaces that wanted empty states ended up using it via that route. Demote until a real external consumer materializes; re-add `export` is one-line then. `SearchModalCloseOptions`: 1 internal usage in the modal's `onClose` type — no consumer. Verified zero external imports of each name via: grep -rE "^import.*\\b\\b" --include="*.tsx" --include="*.ts" apps/desktop/src packages/ui/src Zero runtime impact (TS type elision). Zero visual change. 4 fewer names in the `@maka/ui` barrel's IDE auto-import surface. Same approach as PR #224 (5 demotions); this round catches what the first sweep missed. --- packages/ui/src/components.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/ui/src/components.tsx b/packages/ui/src/components.tsx index b5bafde4fb..391258d3db 100644 --- a/packages/ui/src/components.tsx +++ b/packages/ui/src/components.tsx @@ -338,7 +338,7 @@ function Count(props: { value: number }) { return {props.value}; } -export interface SkillEntry { +interface SkillEntry { id: string; name: string; description: string; @@ -796,7 +796,7 @@ export function SessionListPanel(props: { * `.maka-button.maka-empty-state-cta` so we never grow a competing * pile of "empty-state action variants". */ -export interface EmptyStateProps { +interface EmptyStateProps { Icon: typeof Search; title: string; body: ReactNode; @@ -808,7 +808,7 @@ export interface EmptyStateProps { dataEmptyView?: string; } -export function EmptyState(props: EmptyStateProps) { +function EmptyState(props: EmptyStateProps) { const className = cn( 'maka-empty-state rounded-xl border-border bg-card/70 p-8 text-card-foreground shadow-maka-panel', props.extraClassName, @@ -2801,7 +2801,7 @@ function searchModalThrownErrorMessage(error: unknown): string { return generalizedErrorMessageChinese(error, '搜索服务需要刷新,请重试。'); } -export interface SearchModalCloseOptions { +interface SearchModalCloseOptions { restoreFocus?: boolean; }