Repository navigation
Description
Context
maka has accumulated several oversized sink files that slow iteration and amplify change risk. The problem is not file length by itself. The root cause is unrelated responsibilities sharing one module, so a change to one concern risks another and components cannot be reused, tested, or reviewed in isolation.
This issue tracks the approved first pass: govern the large files one by one before any visual polish. Visual refresh and fine-grained component design are follow-ups, not bundled into these file-boundary PRs.
Completed precedent:
- PR feat(ui): add Storybook renderer baseline #370 stood up the Storybook renderer baseline.
- PR refactor(ui): extract non-chat component groups #372 extracted the non-chat dependency groups from
packages/ui/src/components.tsxwith zero intended behavior/visual change. - PR refactor(ui): split components surfaces #378 finished the remaining
components.tsxmechanical split and leftcomponents.tsxas a compatibility barrel. - PR refactor(desktop): split provider settings flows #377 split
ProvidersPanel.tsxinto provider settings sibling files and leftProvidersPanel.tsxas a facade. - PR refactor(desktop): split settings modal pages #381 split
SettingsModal.tsxinto a thin entrypoint plus focused settings shell, nav, shared helper, and page files. - PR refactor(desktop): split renderer main entry #383 split
renderer/main.tsxinto a thin renderer entry plus focused renderer shell/helper files. - PR refactor(desktop): split main process orchestration #385 split
apps/desktop/src/main/main.tsinto focused main-process orchestration, service, and IPC modules.
Current Evidence
Current main after PR #377, PR #378, PR #381, PR #383, and PR #385:
packages/ui/src/components.tsxis now a 14-line compatibility barrel, so it is no longer in the remaining sink list.apps/desktop/src/renderer/settings/ProvidersPanel.tsxis now a 381-line facade over provider settings sibling files, so it is no longer in the remaining sink list.apps/desktop/src/renderer/settings/SettingsModal.tsxis now a thin entrypoint over settings shell/page files, so it is no longer in the remaining sink list.apps/desktop/src/renderer/main.tsxis now a thin renderer entry overapp.tsx,app-shell.tsx, and focused renderer helper files, so it is no longer in the remaining sink list.apps/desktop/src/main/main.tsis now a composition/startup layer over focused main-process modules, so it is no longer in the remaining first-pass sink list.
The approved first-pass file-boundary治理 tracked by this issue is complete. A fresh second-pass sink scan should be tracked in a follow-up issue rather than expanding this one just because another file is long.
Calibration counter-example: a large but single-responsibility data/test file is not automatically in scope. We split by responsibility and verification boundary, not by line count.
Order Of Work
- File-boundary governance first. Move cohesive large blocks into focused files while preserving behavior and public APIs.
- Component/primitives work second. Once files have sane boundaries, split smaller UI primitives only where it reduces real coupling.
- Visual polish last. No redesign, markup refresh, or style refactor in the sink-file PRs unless it is required to preserve behavior.
For visually exposed frontend slices, use GLM 5.2 as a scope/review guard: check whether the PR accidentally changes DOM, CSS, interaction, or visual behavior. Do not use it to drive a redesign in this issue.
Invariants
- Behavior- and visually-neutral unless a slice explicitly says otherwise.
- Preserve public imports. If a moved symbol is already public through
@maka/ui, keep re-export compatibility. - Avoid reverse imports. New leaf files must not import
@maka/ui,./index.js, or./components.js. - Co-migrate source-reading contract tests to the new file paths.
- Keep PRs flat off
main, one independently reviewable file/scope at a time. - Verification should be proportional: typecheck/build plus targeted contract tests for pure moves; broader visual/cascade checks only when markup/CSS actually changes.
Slices
-
PR1 — Storybook baseline. Add renderer Storybook setup and seed primitive stories. Keep it out of mandatory CI for now. Merged as feat(ui): add Storybook renderer baseline #370.
-
PR2 — Extract non-chat
components.tsxdependency groups. Move shared helpers and non-chat components into sibling files, keepcomponents.tsxre-exports, migrate tests, and guard againstcomponents.jscycles. Merged as refactor(ui): extract non-chat component groups #372. -
PR3 — Finish
components.tsxas a mechanical file-boundary split. Moved the remaining cohesive groups out while keepingcomponents.tsxas the compatibility re-export surface:module-panels.tsx:SkillsModuleMain,SkillLibraryPanel,DailyReviewPanel,PlanReminderPanel, and their local helpers/constants.chat-view.tsx:ChatView,ChatHeaderAlert, session/status badges, turn/message/streaming helpers,TurnFooterActionMeta,TurnLineageBadge, andmergeTools.composer.tsx:Composer,ComposerHandle, composer copy/constants, import action helpers, and draft/history wiring used only by Composer.relative-time.tsx:RelativeTime.- Updated source-reading tests to point at the new files. No visual redesign. Merged as refactor(ui): split components surfaces #378.
-
PR4 — Split
SettingsModal.tsxby settings page/flow. Split Settings into a thin modal entrypoint plus focused settings shell, nav, shared helper, and page files. Source-reading tests now scan the split Settings source set. Merged as refactor(desktop): split settings modal pages #381. -
PR5 — Split
ProvidersPanel.tsx. Kept provider/OAuth/model connection contracts intact, moved provider flows into sibling files, and leftProvidersPanel.tsxas the facade for stable imports. Merged as refactor(desktop): split provider settings flows #377. -
PR6 — Split
apps/desktop/src/renderer/main.tsx. Split the renderer entry into a thin bootstrap plusapp.tsx,app-shell.tsx, and focused renderer shell/helper files. Source-reading contracts now scan the split renderer shell source set. Merged as refactor(desktop): split renderer main entry #383. -
PR7 — Split
apps/desktop/src/main/main.ts. Main-process governance: app lifecycle, window wiring, IPC registration, service orchestration, prompt policy, subscription/memory/usage/daily-review/web-search/workspace-resource IPC, bot incoming flow, and OAuth helpers moved apart along existing responsibility boundaries. Merged as refactor(desktop): split main process orchestration #385.
After these slices landed, the first-pass sink-file governance scope is complete. Rerun a fresh sink scan in a follow-up issue if runtime/test/front-end second-pass files need their own治理. Do not keep expanding this issue just because another file is long.
Out Of Scope
- Visual redesign or visual polish.
- Breaking public imports.
- Splitting large single-purpose data files only for line count.
- Rewriting runtime behavior while moving files.
- Adding new dependency or import-cycle tooling unless a slice proves it is necessary.
References
- feat(ui): add Storybook renderer baseline #370 Storybook baseline.
- refactor(ui): extract non-chat component groups #372
components.tsxnon-chat dependency extraction. - refactor(ui): split components surfaces #378
components.tsxremaining mechanical split. - refactor(desktop): split provider settings flows #377 ProvidersPanel split.
- refactor(desktop): split settings modal pages #381
SettingsModal.tsxsettings page/flow split. - refactor(desktop): split renderer main entry #383
renderer/main.tsxrenderer shell split. - refactor(desktop): split main process orchestration #385
main/main.tsmain-process orchestration split. - feat(ui): govern chat conversation-flow display onto @maka/ui Base UI primitives #332 / feat(ui): govern tool-result preview surfaces onto @maka/ui previewVariants (#332 PR4) #362 chat primitive precedent with zero visual change.
Activity
refactor(ui): extract non-chat component groups
[-]RFC: refactor(ui): split renderer sink files by responsibility and add Storybook isolation[/-][+]RFC: refactor: split sink files before visual polish[/+][-]RFC: refactor: split sink files before visual polish[/-][+]refactor: split sink files before visual polish[/+]refactor(desktop): split renderer main entry
Astro-Han commentedon Jul 1, 2026
Closed as complete.
The approved first-pass sink-file governance scope is now done:
components.tsxProvidersPanel.tsxSettingsModal.tsxrenderer/main.tsxmain/main.tsA fresh second-pass sink scan should be tracked in a follow-up issue rather than expanding this one just because another file is long.