Skip to content

chore(ui): demote 5 unused-export interfaces to file-private - #224

Merged
jackwener merged 1 commit into
mainfrom
yuejing/cleanup-unused-exports
Jun 24, 2026
Merged

chore(ui): demote 5 unused-export interfaces to file-private#224
jackwener merged 1 commit into
mainfrom
yuejing/cleanup-unused-exports

Conversation

@jackwener

Copy link
Copy Markdown
Member

Lane 3 (simplification), reminder fire #1 of WAWQAQ's new mandate.

Bug

5 `export interface` / `export type` declarations in `packages/ui/src/components.tsx` have zero external consumers but were still being re-exported through the `@maka/ui` barrel (`index.ts: export * from './components.js'`):

Symbol Line Internal use
`SessionFilter` 218 sidebar filter union
`SessionRowActions` 375 row action callbacks
`DailyReviewBridge` 1357 daily-review IPC bridge type
`SearchModalDeps` 2793 search modal IPC bridge type
`LoadToolResultDescription` 6071 internal helper return type

Verification

```bash
grep -rE "^import.\\b\\b" --include=".tsx" --include="*.ts" \\
apps/desktop/src packages/ui/src
```

Returns zero matches for each — none of them are imported anywhere outside `components.tsx` itself.

Fix

Drop the `export` keyword. They're still defined in the file and TypeScript resolves them locally just fine for the internal call sites.

Why

  1. Stops leaking internal-shape types as if they were public API.
  2. Makes future "what's actually public" review easier.
  3. Removes 5 names from IDE auto-import suggestions.

If a future consumer legitimately needs one of these, re-adding `export` is a one-line follow-up.

Diff

`1 file changed, 5 insertions(+), 5 deletions(-)` — pure metadata change. Zero runtime impact (TS type elision means these don't exist in emitted JS). Zero visual change. No other open PR touches these specific lines.

WAWQAQ asked for dead-code simplification. These 5 exported types
in `packages/ui/src/components.tsx` have ZERO external consumers
across `apps/desktop/src` and `packages/ui/src` — they're only used
internally to type props within the same file:

  - `SessionFilter` (line 218 — sidebar filter union)
  - `SessionRowActions` (line 375 — row action callbacks)
  - `DailyReviewBridge` (line 1357 — daily-review IPC bridge)
  - `SearchModalDeps` (line 2793 — search modal IPC bridge)
  - `LoadToolResultDescription` (line 6071 — internal helper return type)

Demoting from `export interface` / `export type` to plain `interface` /
`type` shrinks the public surface area of the `@maka/ui` barrel
(`index.ts` re-exports `export * from './components.js'`), which:

1. Stops leaking internal-shape types as if they were public API.
2. Makes future "what's actually public" review easier.
3. Eliminates 5 names from the IDE auto-import suggestions.

If a future consumer legitimately needs one of these, re-adding
`export` is a one-line follow-up.

Verified safe via:
  grep -rE "^import.*\b<name>\b" --include="*.tsx" --include="*.ts" \\
    apps/desktop/src packages/ui/src
returns zero matches for each of the 5 names.

Zero runtime impact (TS type elision means these don't exist in
the emitted JS). Zero visual change.
@jackwener
jackwener merged commit 7f528c3 into main Jun 24, 2026
@jackwener
jackwener deleted the yuejing/cleanup-unused-exports branch June 24, 2026 19:44
jackwener added a commit that referenced this pull request Jun 24, 2026
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<name>\\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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant