You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(settings): add the scroll offset when a click selects a settings row - #744
Fixes#661. A click in a scrolled Settings list counted rows from the top of the box without the scroll offset, so it selected a row out of view. select_clicked_setting now uses list_item_index_from_click with the drawn selection's position (selected_setting_position), like the other lists. The unused settings_item_index_from_click is removed. Two tests in mouse.rs cover a scrolled and an unscrolled list; CHANGELOG has a Fixed entry.
Testing
cargo test --no-default-features --features telemetry,tui handlers::mouse: 42 passed; on the test-only commit the scrolled test fails (left: 0, right: 26).
Full cargo test --locked --no-default-features --features telemetry,tui: 1508 passed, 0 failed.
Not clicked through in a real terminal; the tests drive the handler at a 100x20 viewport. Written with help from an AI coding agent; I read the diff and ran the checks above.
Summary by CodeRabbit
Bug Fixes
Fixed row selection in scrolled Behavior and Keybindings settings lists so clicks select the correct setting.
Fixed clicks in filtered settings lists so they select the setting under the pointer after scrolling.
Reviewing files that changed from the base of the PR and between 5af8200 and 19eac36.
📒 Files selected for processing (1)
CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (1)
CHANGELOG.md
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
📝 Walkthrough
Walkthrough
Settings-row clicks now account for list scrolling when mapping mouse positions to filtered settings. The change removes the previous top-based row mapping and adds tests for clicks in scrolled and unscrolled lists.
Changes
Settings row selection
Layer / File(s)
Summary
Map clicks to visible settings rows src/tui/handlers/mouse.rs, CHANGELOG.md
The mouse handler uses the selected setting’s position in the filtered view to map clicks to visible rows and removes the previous row-mapping helper. Tests cover clicks before and after scrolling. The changelog describes the fix.
No actionable issue is identified in the reviewed change; it is mergeable after normal checks.
Pre-merge checks | 4
✅ Passed checks (4 passed)
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title uses the accepted conventional-commit prefix fix(settings):, clearly describes the scroll-offset correction, and uses a concise imperative subject.
Linked Issues check
Issue #661 requires scroll-aware Settings click mapping for Behavior and Keybindings, use of the drawn filtered-list position, and automated scrolled and unscrolled tests. The PR uses `selected_settin…
Out of Scope Changes check
The changes stay within issue #661. They update Settings click mapping, add focused mouse-handler tests, and add the related changelog entry. No unrelated state change, draw-function write, or gate-co…
✨ Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
✨ Simplify code
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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.
Summary
Fixes #661. A click in a scrolled Settings list counted rows from the top of the box without the scroll offset, so it selected a row out of view.
select_clicked_settingnow useslist_item_index_from_clickwith the drawn selection's position (selected_setting_position), like the other lists. The unusedsettings_item_index_from_clickis removed. Two tests inmouse.rscover a scrolled and an unscrolled list; CHANGELOG has a Fixed entry.Testing
cargo test --no-default-features --features telemetry,tui handlers::mouse: 42 passed; on the test-only commit the scrolled test fails (left: 0, right: 26).cargo test --locked --no-default-features --features telemetry,tui: 1508 passed, 0 failed.cargo clippy ... -D warnings,cargo fmt --check,tools/check_gates_ratchet.sh: clean.Additional notes
Not clicked through in a real terminal; the tests drive the handler at a 100x20 viewport. Written with help from an AI coding agent; I read the diff and ran the checks above.
Summary by CodeRabbit