fix(sections-editor): make the "Always" matcher option searchable by its translated label - #6437
Merged
Merged
Conversation
…its translated label The CommandItem's search value was hardcoded to the English string "always Target all users", the same bug class fixed in #6408 for the task-board filters: cmdk filters by the value prop, not the rendered children, so a pt-BR user typing what they actually see ("Sempre", "Direcionar todos os usuários") can't find this option. Build the search value from the same translated strings already rendered.
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.
Follows the same bug class fixed in #6408 (task-board filters), found while hunting for hardening follow-ups to recent merges.
Bug: In
matcher-picker.tsx, the "Always" rule'sCommandItemhad a hardcoded English searchvalue("always Target all users") while its rendered label is fully translated (alwaysLabel/targetAllUsers). cmdk's fuzzy filter matches against thevalueprop, not the rendered children, so a pt-BR user typing what they actually see on screen ("Sempre", "Direcionar todos os usuários") gets zero results and can't find the option — exactly the failure #6408 fixed for the assignee/repo filters.Fix: build the search value from the same two translation keys already used for the visible label, so the searchable text always matches what's rendered in the active locale.
Verify: open the matcher picker (sections-editor rule dialog) with
language: pt-BRin preferences and type "Sempre" — the "Always / Target all users" option should now show up.Checks run locally:
bun run fmt,bun test apps/web/src/components/sections-editor/matcher-picker.test.ts(8 pass),bunx oxlint apps/web/src/components/sections-editor/matcher-picker.tsx(0 warnings/errors),cd apps/web && bunx tsc --noEmit(clean). Full CI validates the rest.Summary by cubic
Makes the "Always" matcher option searchable in all locales by building its search value from the same translated strings used in the label. Previously the
CommandItem.valuewas hardcoded to English, socmdksearch failed for non-English users; now it matches the rendered locale with no UI change.Written for commit dae1a8c. Summary will update on new commits.