Skip to content

fix(settings): preserve settings panel scroll offset - #940

Open
Oud-Idk wants to merge 2 commits into
mainfrom
fix/scroll-settings
Open

Oud-Idk wants to merge 2 commits into
mainfrom
fix/scroll-settings

Conversation

@Oud-Idk

@Oud-Idk Oud-Idk commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Preserve the settings list’s scroll offset between frames and clamp it when the list shrinks. Adds regression coverage for both behaviors.

Testing

  • cargo fmt --all
  • cargo clippy --no-default-features --features telemetry,tui -- -D warnings
  • cargo test --no-default-features --features telemetry,tui
  • cargo test --no-default-features --features telemetry,tui settings_scroll_offset_survives_frames_and_clamps_when_the_list_shrinks

Additional notes

This fixes scrolling behavior without changing the settings screen’s appearance.

Summary by CodeRabbit

  • Bug Fixes
    • The Settings list now retains its scroll position between screen updates and adjusts it when the list gets shorter, keeping the visible selection within the available options.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 1e25bec and eeb53de.

Files selected for processing: 2
  • src/core/app/view.rs
  • src/tui/ui/settings.rs

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

The Settings view now stores its list scroll offset across frames. The renderer clamps the offset to the current list’s maximum valid position. A test checks offset persistence and clamping after the list shrinks.

Changes: Settings List Scrolling

Layer / File(s) Summary
Persist and clamp the settings list offset
src/core/app/view.rs, src/tui/ui/settings.rs
ViewState stores the settings scroll offset. draw_settings passes it to draw_settings_list, which clamps the offset before rendering and saves it afterward. A test checks persistence across frames and clamping when the list shrinks.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Merge Risk: Minimal · up to eeb53

The settings scroll change is ready to merge after normal checks.

Pre-merge checks: Passed 4
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title uses the valid fix(settings): conventional-commit prefix, clearly describes preserving the settings panel scroll offset, and uses a concise imperative subject.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Oud-Idk
Oud-Idk marked this pull request as ready for review October 26, 2026 07:42
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