Fix type filter silently dropped on Vocabulary page#180
Draft
Copilot wants to merge 2 commits into
Draft
Conversation
- Add 'type' to FilterToken.ValidTypes so type:sentence/word/phrase passes IsValid check - Add 'type' to SearchQueryParser.FilterPattern regex so it's recognized and parsed - Add 'type' to SearchQueryParser.DetectActiveFilter regex for autocomplete support - Add unit tests covering type:word, type:phrase, type:sentence, mixed queries" Agent-Logs-Url: https://github.com/davidortinau/SentenceStudio/sessions/7ef0d148-4758-461b-be3d-0b2760b18ee6 Co-authored-by: davidortinau <41873+davidortinau@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix type filtering on Vocabulary page for 'Sentence'
Fix type filter silently dropped on Vocabulary page
Apr 29, 2026
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.
The
type:sentence/word/phrasefilter (both from the dropdown and typed directly) had no effect because the parser discarded it before it ever reachedApplyFilters.Root Cause
"type"was missing from three places in the search parser stack:FilterToken.ValidTypes— caused everytype:*token to failIsValidand be silently droppedSearchQueryParser.FilterPatternregex —type:sentencewas never matched, falling through as free textSearchQueryParser.DetectActiveFilterregex — typingtype:in the search bar triggered no autocompleteApplyFiltersinVocabulary.razoralready had correctLexicalUnitTypeswitch logic; it simply never received the filter.Changes
FilterToken.cs— add"type"toValidTypesSearchQueryParser.cs— addtypeto bothFilterPatternandDetectActiveFilterregex alternation groupsSearchQueryParserTests.cs— add theory tests fortype:word,type:phrase,type:sentence, mixed queries, andIsValidFilterTokentype values