Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically edit filter string when user is typing #93

Merged
merged 10 commits into from
Mar 5, 2024

Conversation

crumblingstatue
Copy link
Contributor

@crumblingstatue crumblingstatue commented Mar 5, 2024

Fixes #89

Requirements from #89

There are also a few points about when we want to avoid the behavior:

  • When the user presses Ctrl or Shift so that we can implement Key bindings in the future
    • Allow shift, but not other modifiers.
      Shift is probably desirable for capitalizing letters, so we want to allow editing while shift is being held down.
  • When the user is already in any input field
    This seems to be working.

Extra behavior added

  • The filter string is cleared when a new directory is entered. I think this behavior is desirable because it's much less likely that the user wants to keep the current filter when entering a new directory, rather than wanting to either see the unfiltered contents, or type a new filter from scratch. We could possibly add a way to configure this behavior in the future though.

Credits

@aymey made the changes to satisfy the requirements of not activating the behavior. Sorry, your commits got lost because I did a rebase against the latest develop revision.

@crumblingstatue
Copy link
Contributor Author

crumblingstatue commented Mar 5, 2024

I cleaned up the code as much as I can, this is now ready for review.
On demand, I can rebase to clean up the history.

@fluxxcode
Copy link
Owner

fluxxcode commented Mar 5, 2024

Thank you both for implementing this!
No need to rebase, I will squash the PR anyway :)

Clearing the search buffer (self.search_value.clear();) is now actually twice in FileDialog::load_directory since it was already implemented with v0.4.0. The other call for this is right at the beginning of the function. Could you remove the first call? I think where you've implemented it now it makes more sense.
Unfortunately I can't mark the lines in the review because you haven't made any changes there ^^

@crumblingstatue
Copy link
Contributor Author

Clearing the search buffer (self.search_value.clear();) is now actually twice in FileDialog::load_directory

Whoops, I missed that. I added a commit that removes my redundant clear.

@crumblingstatue
Copy link
Contributor Author

Could you remove the first call? I think where you've implemented it now it makes more sense.

Ah crap, sorry, I missed that you wanted to keep my change. Lazy reading, lol.
Fixed.

@fluxxcode fluxxcode merged commit 100a5b4 into fluxxcode:develop Mar 5, 2024
1 check passed
@fluxxcode fluxxcode mentioned this pull request Mar 5, 2024
@crumblingstatue crumblingstatue deleted the auto-filter-on-type branch April 5, 2024 13:06
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.

Automatically search upon typing
2 participants