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

Project navigator file filtering #1896

Merged
merged 9 commits into from
Oct 7, 2024

Conversation

LeonardoLarranaga
Copy link
Contributor

Description

This pull request adds the ability to search files and folders in the navigator area. The following features were added:

  1. Typing in the "Filter" textfield now searches through files and folders.
  2. When a folder matches the filter, all of its content appears.
  3. When searching, all of the folders get expanded.
  4. The state of the folders that were expanded by the user before searching gets saved, so that when they finish searching, everything returns back to place.
  5. When searching, the characters/words in the file and folder names that match the search get bold.
  6. When there are no search results a label "No Filter Results" appears.
  7. The search, just like in Xcode, is case-insensitive.

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

(From description list)

  1. Typing in the "Filter" textfield now searches through files and folders.
Screen.Recording.2024-10-03.at.02.52.30.mov
  1. When a folder matches the filter, all of its content appears.
  2. When searching, all of the folders get expanded.
  3. When searching, the characters/words in the file and folder names that match the search get bold.
Screen.Recording.2024-10-03.at.02.53.06.mov
  1. The state of the folders that were expanded by the user before searching gets saved, so that when they finish searching, everything returns back to place.
Screen.Recording.2024-10-03.at.02.54.05.mov
  1. When there are no search results a label "No Filter Results" appears.
  2. The search, just like in Xcode, is case-insensitive.
Screen.Recording.2024-10-03.at.02.55.53.mov

@thecoolwinter
Copy link
Collaborator

Wow this looks awesome! I should have time to review very soon. Excited for this!

Copy link
Collaborator

@austincondiff austincondiff left a comment

Choose a reason for hiding this comment

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

This is incredible work @LeonardoLarranaga! Two quick UI-related tweaks:

  1. When "No Filter Results" appears as a result of not having any results, we should hide the root folder as well.
  2. When filter text is present and if matches are found amongst files and/or folders, bolded text should have a primary label color and unbolded text should have a secondary label color. If parent folders are shown but do not have a match, than the unbolded text has a primary color.

Copy link
Collaborator

@thecoolwinter thecoolwinter left a comment

Choose a reason for hiding this comment

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

A couple of quick changes.

LeonardoLarranaga and others added 3 commits October 6, 2024 14:34
- Changed  `workspace.filter` to `workspace.navigatorFilter` and added its respective comment.
- Returned `StandardTableViewCell` to a weak reference of the workspace object.
- Replaced the navigators own filter string with the workspace one and added throttle to the filter change.
- When closing the window, if there is a search going on, all the items don't get saved expanded anymore.
Copy link
Collaborator

@thecoolwinter thecoolwinter left a comment

Choose a reason for hiding this comment

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

Looks good to me

@austincondiff austincondiff merged commit 5967466 into CodeEditApp:main Oct 7, 2024
2 checks passed
@CodeEditApp CodeEditApp deleted a comment from allcontributors bot Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request navigator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants