webview: Fix Template Gallery search inconsistency between language search and…#2347
Open
gavin-aguiar wants to merge 2 commits into
Open
webview: Fix Template Gallery search inconsistency between language search and…#2347gavin-aguiar wants to merge 2 commits into
gavin-aguiar wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR extracts Template Gallery filtering logic into a standalone, unit-testable module and enhances search to match language display names (e.g., “.NET”) consistently with language filter chips.
Changes:
- Added
createApplyFiltershelper module and expanded search to include language keys + display names. - Updated
TemplateGalleryViewreducer to consume the extracted filter helper. - Added unit tests validating search/filter parity and edge cases.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| webview/src/webview/TemplateGallery/applyFilters.ts | New shared filtering/search implementation, decoupled from React for unit testing. |
| webview/src/webview/TemplateGallery/TemplateGalleryView.tsx | Replaces inline filtering logic with the extracted createApplyFilters. |
| webview/test/TemplateGallery/applyFilters.test.ts | Adds unit tests for filtering/search behavior, including display-name search. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description:
Fixes: microsoft/vscode-azurefunctions#5072
Problem
In the Template Gallery, searching a language (e.g. ".NET") returned a different set than selecting the matching language filter chip. The .NET chip showed 21 templates; searching ".NET" showed only 1. Fixes #5072.
Root cause
The language filter matches through languageFilterMap (CSharp → dotnet), but the search predicate in applyFilters only checked displayName, shortDescription, and tags — never the template's languages or their display names. So ".NET" only matched the one template with ".NET" literally in its name.
Fix