Fix selection/offset reset on filter change#11
Closed
walldmtd wants to merge 1 commit intoMjoyufull:mainfrom
Closed
Fix selection/offset reset on filter change#11walldmtd wants to merge 1 commit intoMjoyufull:mainfrom
walldmtd wants to merge 1 commit intoMjoyufull:mainfrom
Conversation
Owner
|
this was in fact kinda sorta intended but i think your approach is much better and will be merged internally as i am refactoring how commits and pr's are done to the project and doing an internal refactor for ease of commits for the projects. |
Contributor
Author
|
No worries, if it's getting merged internally then I don't mind having the PR closed. Good luck with the refactor! |
10 tasks
2 tasks
Mjoyufull
pushed a commit
that referenced
this pull request
Oct 29, 2025
fix: replace old selection reset logic in app_ui.rs Completes the selection reset refactor from PR #11. Replaced outdated conditional selection reset logic with cleaner approach that resets selection whenever filter changes. - Removed nested if/else blocks checking current_selected - Simplified to single reset when shown.is_empty() - Selection now properly resets to first item on filter change - Behavior now consistent with rest of codebase authored-by: @walldmtd pr #16 Closes #16
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.
This makes it so the selection and scroll offset are reset on any change to the filter query (typing or backspace). This is also similar to rofi.
Before, the selected row number would stay the same when the filter changed, and would only reset when list got shorter than the selected row. If this was intentional, I would still recommend changing it since it doesn't make sense to leave the selection in place when its value is changing anyway.