refactor(cli): extract mouse hit-test helpers into module#614
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Step 7 of the
cli/src/app.rsgod-object split (Finding #5). Moves the mouse hit-test helpers — the geometricAppmethods that compute which region was clicked (rect/bounds predicates,adjust_mouse_scrollback, etc.) — out ofapp.rsinto a newcrates/cli/src/app/mouse.rsas animpl App { ... }block.Scope / safety
on_mouseis NOT moved (nor any hot method) — it stays inapp.rsand keeps calling the helpers viaself.(helpers madepub(super)).mod mouse;+ minimal visibility. Verified: every non-glue line removed fromapp.rsreappears inmouse.rs.app.rs−293;mouse.rs+289.cargo build,cargo test -p agentd-cli(461 passed),cargo test -p agentd --lib(114 passed). (The cli perf testpty_render::...stay_fast_as_history_growsflaked once under concurrent load; passes 3/3 in isolation — unrelated, this PR doesn't touchpty_render.rs.)Continues steps 1–6. Relevant binary:
construct(cli crate).