Skip to content

refactor(cli): extract mouse hit-test helpers into module#614

Merged
edwin-zvs merged 1 commit into
mainfrom
refactor/app-split-step7
Jun 29, 2026
Merged

refactor(cli): extract mouse hit-test helpers into module#614
edwin-zvs merged 1 commit into
mainfrom
refactor/app-split-step7

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

What

Step 7 of the cli/src/app.rs god-object split (Finding #5). Moves the mouse hit-test helpers — the geometric App methods that compute which region was clicked (rect/bounds predicates, adjust_mouse_scrollback, etc.) — out of app.rs into a new crates/cli/src/app/mouse.rs as an impl App { ... } block.

Scope / safety

  • on_mouse is NOT moved (nor any hot method) — it stays in app.rs and keeps calling the helpers via self. (helpers made pub(super)).
  • Pure move — bodies copied verbatim; diff is relocation + mod mouse; + minimal visibility. Verified: every non-glue line removed from app.rs reappears in mouse.rs.
  • app.rs −293; mouse.rs +289.
  • Green: cargo build, cargo test -p agentd-cli (461 passed), cargo test -p agentd --lib (114 passed). (The cli perf test pty_render::...stay_fast_as_history_grows flaked once under concurrent load; passes 3/3 in isolation — unrelated, this PR doesn't touch pty_render.rs.)

Continues steps 1–6. Relevant binary: construct (cli crate).

Move the geometric mouse hit-test helper App methods (rect/bounds
predicates, adjust_mouse_scrollback, etc.) out of app.rs into
crates/cli/src/app/mouse.rs as an impl App block. on_mouse stays in
app.rs. Pure move (bodies verbatim; only mod decl + pub(super)/pub(crate)
visibility). app.rs -293 / mouse.rs +289. Build + tests green
(agentd-cli 461, agentd 114).
@edwin-zvs
edwin-zvs merged commit 97f95af into main Jun 29, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the refactor/app-split-step7 branch June 29, 2026 15:14
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