Skip to content

Conversation

@FilipCondac
Copy link

@FilipCondac FilipCondac commented Oct 6, 2025

Search feature

Screen.Recording.2025-10-06.at.15.42.43.mov

Motivation

I work in an env with a lot of containers and can be quite annoying to always try track them down.


Implementation Details

Core Logic

  • Implemented in src/commands/filterTree.ts
  • Filters across multiple properties: label, description, and metadata
  • Case-insensitive and partial matching for flexibility
  • Maintains filter state per view during session

Telemetry

  • Tracks filter application and clearing actions
  • Logs filter text length and item count

Files Changed

New

  • src/commands/filterTree.ts — core filter logic and commands

Modified

  • src/tree/LocalRootTreeItemBase.ts — integrated filtering into tree item loading
  • src/commands/registerCommands.ts — registered six new filter commands
  • package.json — added command definitions and menu contributions
  • package.nls.json — added localisation strings

@FilipCondac FilipCondac requested a review from a team as a code owner October 6, 2025 14:54
@FilipCondac
Copy link
Author

@microsoft-github-policy-service agree

@microsoft-github-policy-service agree

@bwateratmsft
Copy link
Collaborator

bwateratmsft commented Oct 6, 2025

@isidorn tree views used to filter when you just started typing while focused on the tree view, but it seems like that's gone now? Additionally, I can't get Ctrl+F to work either.

@isidorn
Copy link

isidorn commented Oct 7, 2025

@benibenj should be able to help with this

@benibenj
Copy link

benibenj commented Oct 7, 2025

@bwateratmsft they keybiding is Alt + Ctrl + F. You can change the keybinding for list.find

@FilipCondac
Copy link
Author

@bwateratmsft they keybiding is Alt + Ctrl + F. You can change the keybinding for list.find

This wasn't defined by default in my VSCode settings. Had to create a custom keybind which does now allow me to activate the search bar feature.

[
  {
    "key": "cmd+f",
    "command": "list.find",
    "when": "listFocus && !inputFocus"
  }
]

@FilipCondac
Copy link
Author

I get the point about list.find, but this feature goes a bit beyond that. list.find only highlights matches, it doesn’t actually filter the list or reduce clutter. Plus, it’s not enabled by default and requires a keybind (not sure if all users?), so some users won't know that exists.

@bwateratmsft
Copy link
Collaborator

bwateratmsft commented Oct 7, 2025

I get the point about list.find, but this feature goes a bit beyond that. list.find only highlights matches, it doesn’t actually filter the list or reduce clutter. Plus, it’s not enabled by default and requires a keybind (not sure if all users?), so some users won't know that exists.

I agree, this PR definitely goes beyond the features that list.find provides. There is a little button that toggles between highlighting and filtering in list.find though. However, I did not have to set the keybinding for it--are you on Mac or Windows?

You're right though, discoverability of this feature has always been a problem.

@FilipCondac
Copy link
Author

FilipCondac commented Oct 7, 2025

I get the point about list.find, but this feature goes a bit beyond that. list.find only highlights matches, it doesn’t actually filter the list or reduce clutter. Plus, it’s not enabled by default and requires a keybind (not sure if all users?), so some users won't know that exists.

I agree, this PR definitely goes beyond the features that list.find provides. There is a little button that toggles between highlighting and filtering in list.find though. However, I did not have to set the keybinding for it--are you on Mac or Windows?

You're right though, discoverability of this feature has always been a problem.

I am on a Mac. It seems it was an issue for a few of my colleagues but for a few it just worked.

One thing I did find is that the filtering feature doesn't work, at least in the containers tab.

@FilipCondac
Copy link
Author

I get the point about list.find, but this feature goes a bit beyond that. list.find only highlights matches, it doesn’t actually filter the list or reduce clutter. Plus, it’s not enabled by default and requires a keybind (not sure if all users?), so some users won't know that exists.

I agree, this PR definitely goes beyond the features that list.find provides. There is a little button that toggles between highlighting and filtering in list.find though. However, I did not have to set the keybinding for it--are you on Mac or Windows?
You're right though, discoverability of this feature has always been a problem.

I am on a Mac. It seems it was an issue for a few of my colleagues but for a few it just worked.

One thing I did find is that the filtering feature doesn't work, at least in the containers tab.

@bwateratmsft

Filtering not working

This wasn't a problem only on my machine. Tested only on Mac.

Screen.Recording.2025-10-13.at.10.58.16.mov

@bwateratmsft
Copy link
Collaborator

I can repro this. It seems that the built-in filtering feature will not hide unexpanded nodes. Only once the entire tree is expanded will it hide the node. @isidorn or @benibenj is this intentional behavior?

Since our containers view includes the filesystem in the tree view, that will basically never happen (nobody would ever expand the entire filesystem tree), so the built-in filtering will never really work in the containers view.

@benibenj
Copy link

Yes this is the expected behaviour currently

Copy link
Collaborator

@bwateratmsft bwateratmsft left a comment

Choose a reason for hiding this comment

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

I have a few general pieces of feedback.

  • I'd prefer for the search icon to change to $(search-stop) and a single click to that to clear the search terms. This could be implemented similar to how we do the commands vscode-containers.images.showDangling and vscode-containers.images.hideDangling. Unfortunately, this doubles the number of commands which is a bummer.
  • Fuzzy search is pretty deeply ingrained into the habits of VSCode users, I'm wondering if there's a reasonably simple way we can support that. The builtin search/filter feature does include that.
  • We could probably get away with supporting this only for images and containers. It's not common for other types (networks, volumes etc.) to have so many instances.

In the past, we have considered supporting a group-by-arbitrary-label feature. Right now for example, the default container grouping is by compose project, which comes from labels on the containers. #104 is related but not exactly the same.

Would your use case be served as well by being able to set arbitrary labels on the containers, and use them for grouping? While not the same as filtering, that would at least allow you to group in any way you want.

Copy link
Collaborator

@bwateratmsft bwateratmsft left a comment

Choose a reason for hiding this comment

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

(changes requested mentioned above)

@FilipCondac
Copy link
Author

(changes requested mentioned above)

Will tend to these in the next 1-2 days 🫡

@FilipCondac
Copy link
Author

I have a few general pieces of feedback.

  • I'd prefer for the search icon to change to $(search-stop) and a single click to that to clear the search terms. This could be implemented similar to how we do the commands vscode-containers.images.showDangling and vscode-containers.images.hideDangling. Unfortunately, this doubles the number of commands which is a bummer.
  • Fuzzy search is pretty deeply ingrained into the habits of VSCode users, I'm wondering if there's a reasonably simple way we can support that. The builtin search/filter feature does include that.
  • We could probably get away with supporting this only for images and containers. It's not common for other types (networks, volumes etc.) to have so many instances.

In the past, we have considered supporting a group-by-arbitrary-label feature. Right now for example, the default container grouping is by compose project, which comes from labels on the containers. #104 is related but not exactly the same.

Would your use case be served as well by being able to set arbitrary labels on the containers, and use them for grouping? While not the same as filtering, that would at least allow you to group in any way you want.

I think the group-by-arbitrary-label feature would be also great addition, especially for developers working in monorepos or microservice heavy environments. It would be genuinely useful to visually group related services.

However, I personally see filtering as the more universally valuable feature. Speaking for myself (and likely many other developers), I often prioritise features that just work out of the box. Setting up labels adds a layer of manual organisation. In practice it could be time consuming for big projects but beneficial for those who love organisation.

@bwateratmsft
Copy link
Collaborator

That makes sense! By the way, your formatter went a little mad with power 😄

Can you revert the formatted lines? Don't want to put you on the git blame for everything

@FilipCondac
Copy link
Author

That makes sense! By the way, your formatter went a little mad with power 😄

Can you revert the formatted lines? Don't want to put you on the git blame for everything

All will be fixed 😭I up arrowed the git push into my terminal by accident.

@FilipCondac
Copy link
Author

  • Removed

That makes sense! By the way, your formatter went a little mad with power 😄

Can you revert the formatted lines? Don't want to put you on the git blame for everything

Oh phew, slightly embarrassing but all fixed. One wrong command is all it takes sometimes.

@FilipCondac
Copy link
Author

I merged main and am having trouble compiling with unrelated issues to this feature. Is this a known issue?

@bwateratmsft
Copy link
Collaborator

What's the error and in what phase of building? If it's happening during npm run test, it's probably due to the current Azure outage.

@FilipCondac
Copy link
Author

What's the error and in what phase of building? If it's happening during npm run test, it's probably due to the current Azure outage.

/src/commands/registries/inspectRemoteImageManifest.ts(21,43)
TS2551: Property 'getManifest' does not exist on type 'RegistryV2DataProvider'. Did you mean 'getManifestV1'?

This came in from the most recent main merge 🤔

@FilipCondac
Copy link
Author

FilipCondac commented Oct 29, 2025

What's the error and in what phase of building? If it's happening during npm run test, it's probably due to the current Azure outage.

/src/commands/registries/inspectRemoteImageManifest.ts(21,43)
TS2551: Property 'getManifest' does not exist on type 'RegistryV2DataProvider'. Did you mean 'getManifestV1'?

This came in from the most recent main merge 🤔

All working, for some reason updating VSCode fixed this and allowed me to build. I wasn't able to build or view the feature otherwise. I don't understand the correlation.

@FilipCondac
Copy link
Author

Latest commits:

  • Added fuzzy search.
  • Removed support for networks, volumes etc.
  • Implemented the $(search-stop) single click clear.

@bwateratmsft
Copy link
Collaborator

/src/commands/registries/inspectRemoteImageManifest.ts(21,43)
TS2551: Property 'getManifest' does not exist on type 'RegistryV2DataProvider'. Did you mean 'getManifestV1'?

This came in from the most recent main merge 🤔

All working, for some reason updating VSCode fixed this and allowed me to build. I wasn't able to build or view the feature otherwise. I don't understand the correlation.

Oh, I bet it was due to the TS language server getting confused due to the dependencies changing when you did npm install, after merging from main. I usually will run the "Restart TS Server" command or just reload VSCode entirely when that happens.

@FilipCondac
Copy link
Author

@bwateratmsft Forgot to ask if you want a demo video of the new iteration.

@bwateratmsft
Copy link
Collaborator

@bwateratmsft Forgot to ask if you want a demo video of the new iteration.

Sure! Thanks!

Copy link
Collaborator

@bwateratmsft bwateratmsft left a comment

Choose a reason for hiding this comment

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

Thanks for all this--I'll try to take a look soon.

@bwateratmsft bwateratmsft self-requested a review October 31, 2025 15:20
@bwateratmsft bwateratmsft dismissed their stale review October 31, 2025 15:21

I'm allowed to dismiss my own review

@FilipCondac
Copy link
Author

Demo for fuzzy matches and new one click clear

Demo2.mov

@FilipCondac
Copy link
Author

@bwateratmsft hello, just wondering if there is any progress on this. Appreciate any feedback / updates that I could work towards in the mean time. Thanks!

@bwateratmsft
Copy link
Collaborator

Yeah! I'm planning to take a look soon. We just got the 2.3.0 release out the door on Monday, and want to get this in for the 2.4.0 release. That said, next week is Microsoft's Ignite conference so we're doing some things for that, and the week after is Thanksgiving...so it might be a few weeks yet. Sorry for the delays.

@FilipCondac
Copy link
Author

FilipCondac commented Nov 12, 2025

Yeah! I'm planning to take a look soon. We just got the 2.3.0 release out the door on Monday, and want to get this in for the 2.4.0 release. That said, next week is Microsoft's Ignite conference so we're doing some things for that, and the week after is Thanksgiving...so it might be a few weeks yet. Sorry for the delays.

No worries! Just looking for an update.

Happy Thanksgiving! Enjoy🙏🏻

@bwateratmsft bwateratmsft added this to the 2.4.0 milestone Nov 12, 2025
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.

4 participants