Skip to content

refactor: split oversized modules#1

Merged
whaclaw-bot merged 17 commits into
code0xff:devfrom
whackur:dev
Jul 25, 2026
Merged

refactor: split oversized modules#1
whaclaw-bot merged 17 commits into
code0xff:devfrom
whackur:dev

Conversation

@whaclaw-bot

Copy link
Copy Markdown
Collaborator

$## Summary\n- split oversized Rust modules into focused submodules\n- keep source files within the project size guideline\n\n## Verification\n- cargo build\n- cargo test\n- cargo clippy --all-targets --all-features -- -D warnings

whackur added 17 commits July 25, 2026 00:46
Split every source file exceeding 300 lines into focused submodules
and move inline #[cfg(test)] blocks into dedicated test files. The
LOC rule (200 = code smell, 300 = hard cap) is recorded in
.claude/rules/guardrails.md.

Module splits (non-test logic, tests moved to sibling files):
- main.rs -> cli, event_loop, key_dispatch, key_handlers, mouse,
  paste, splash, app_init, main_tests/
- app.rs -> app/app_impl, app/log_nav, app/scroll, app/tree_nav,
  app/file_view_load, app/commit_log_pagination, app/commit_log_apply
- config.rs -> config/{layout,log,panels,web}
- git/diff.rs -> git/diff/{types,snapshot,diff_load,commit_log}
- git/{path,tree}.rs -> git/{path,tree}/ directories
- runtime/terminal.rs -> runtime/terminal/{state,scroll,lifecycle,escape}
- runtime/emulator.rs -> runtime/emulator/{mod,view}
- input/mod.rs -> input/{routing,encode}
- web/server.rs -> web/server/{accept,http_routes,ws}
- web/protocol.rs -> web/protocol/{mod,decode}
- web/viewer/server.rs -> web/viewer/server/{dispatch,mutations,routes,handlers,http_util}
- web/viewer/{dto,terminal,catalog,runtime}.rs -> directories
- ui/mod.rs -> ui/{helpers,chrome,notice,hint_text,hint_bar,hit_test}
- ui/{diff_pane,diff_viewer,terminal_tab,project_tab,log_view,tree_view}.rs
  -> directories

Also: CLAUDE.md -> AGENTS.md (symlink kept for compatibility),
docs/architecture.md module tree updated to match the new layout.
Split App.tsx (2059→299), Terminal.tsx (616→273), api.ts (342→118)
into hooks/, components/, api/ modules. Add LOC rule to guardrails.md.
# Conflicts:
#	src/web/viewer/catalog.rs
#	src/web/viewer/server.rs
#	viewer-ui/dist/assets/Markdown-CKSGxvDC.js
#	viewer-ui/dist/assets/Markdown-D7nyj2B6.js
#	viewer-ui/dist/assets/Markdown-FGllwLLF.js
#	viewer-ui/dist/index.html
#	viewer-ui/src/App.tsx
#	viewer-ui/src/Terminal.tsx
#	viewer-ui/src/paneOrder.ts
@whaclaw-bot
whaclaw-bot merged commit 27c5a76 into code0xff:dev Jul 25, 2026
5 checks passed
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.

2 participants