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

File Browser: add support for filtering directories on search #12342

Merged
merged 10 commits into from Apr 13, 2022

Conversation

jtpio
Copy link
Member

@jtpio jtpio commented Apr 4, 2022

References

Fixes #12055

Code changes

Add a setting to also filter directories when searching for files in the file browser.

User-facing changes

In this PR the new setting is true by default.

filter-directories.mp4

Backwards-incompatible changes

None (new parameters are optional).

@jupyterlab-probot
Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

Copy link
Member

@fcollonval fcollonval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small suggestions otherwise it looks good.

packages/filebrowser/src/model.ts Show resolved Hide resolved
filterDirectories = settings.get('filterDirectories')
.composite as boolean;

browser.model.filterDirectories = filterDirectories;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be nice to refactor all those setters to a single updateFromSettings function to be connected to settings.changed and called for initialization.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Either we can do it in this PR. Otherwise happy to track it separately as a 4.0 item but should be done before release, since it is likely to be breaking change.

Copy link
Member

@fcollonval fcollonval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jtpio

@github-actions
Copy link
Contributor

Benchmark report

The execution time (in milliseconds) are grouped by test file, test type and browser.
For each case, the following values are computed: min <- [1st quartile - median - 3rd quartile] -> max.

The mean relative comparison is computed with 95% confidence.

Results table
Test file large_code_notebook large_md_notebook
open
chromium
actual 3620 <- [3699 - 3762 - 3914] -> 4357 2577 <- [2671 - 2726 - 2820] -> 3181
expected 3612 <- [3746 - 3857 - 4904] -> 5193 2481 <- [2614 - 2659 - 2713] -> 3309
Mean relative change -9.8% ± 2.6% 2.4% ± 1.4%
switch-from
chromium
actual 650 <- [698 - 745 - 834] -> 974 479 <- [511 - 529 - 912] -> 1059
expected 620 <- [715 - 862 - 930] -> 1249 469 <- [509 - 539 - 966] -> 1127
Mean relative change -7.3% ± 3.3% -10.2% ± 8.1%
switch-to
chromium
actual 317 <- [378 - 389 - 402] -> 520 252 <- [276 - 283 - 290] -> 372
expected 319 <- [386 - 403 - 424] -> 650 252 <- [274 - 281 - 291] -> 318
Mean relative change -3.9% ± 2.3% 0.4% ± 1.3%
close
chromium
actual 560 <- [963 - 981 - 1015] -> 1081 458 <- [484 - 492 - 509] -> 586
expected 641 <- [962 - 1002 - 1037] -> 1215 466 <- [483 - 489 - 504] -> 596
Mean relative change -1.8% ± 2.0% 0.6% ± 1.4%

Changes are computed with expected as reference.

@fcollonval fcollonval merged commit a75c8fe into jupyterlab:master Apr 13, 2022
@michaelaye
Copy link

is it too big a change to get it backported to the 3.x release line? I can't wait for this, as my server always launches inside a huge directory with all my repos... thanks for this patch!

@fcollonval fcollonval mentioned this pull request Sep 9, 2022
8 tasks
@fcollonval
Copy link
Member

@michaelaye I added it to the list of features for 3.5.0 - feel free to add suggestions of other features you like to see backported. We will look if it is possible (aka not breaking the API).

@fcollonval
Copy link
Member

@meeseeksdev please backport to 3.5.x

@lumberbot-app
Copy link

lumberbot-app bot commented Oct 4, 2022

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 3.5.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 a75c8fed7d04ca634f464e9a5073091ff0666b66
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #12342: File Browser: add support for filtering directories on search'
  1. Push to a named branch:
git push YOURFORK 3.5.x:auto-backport-of-pr-12342-on-3.5.x
  1. Create a PR against branch 3.5.x, I would have named this PR:

"Backport PR #12342 on branch 3.5.x (File Browser: add support for filtering directories on search)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

fcollonval pushed a commit to fcollonval/jupyterlab that referenced this pull request Oct 5, 2022
fcollonval added a commit that referenced this pull request Oct 5, 2022
…es on search (#13186)

Co-authored-by: Jeremy Tuloup <jeremy.tuloup@gmail.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File browser filter should filter folders as well
3 participants