Skip to content

fix(palette): trim search query before matching (flaky Property 41)#37

Merged
omrsamer merged 1 commit into
mainfrom
fix/palette-search-trim
Jul 20, 2026
Merged

fix(palette): trim search query before matching (flaky Property 41)#37
omrsamer merged 1 commit into
mainfrom
fix/palette-search-trim

Conversation

@omrsamer

Copy link
Copy Markdown
Contributor

Fixes the intermittent paletteSearch property-test failure (seen on the main CI run after #35, and inside #34's run): the filter trimmed the query only for the emptiness check but matched with the untrimmed string, so a query with trailing whitespace ('A ') wrongly excluded items. Trailing/leading whitespace now never changes results. Verified across 5 randomized fast-check runs + full suite (253 tests).

🤖 Generated with Claude Code

The palette filter checked query.trim() for emptiness but matched with the
UNTRIMMED query, so 'a ' excluded items containing 'a' — trailing whitespace
changed search results. The fast-check exclusion property caught this
intermittently (counterexample 'A '; property tests are seed-random, which is
why CI was green on some runs and red on others — including the main run after
the xyflow merge). Trim before matching in both ComponentPalette and the
extracted test copy; 253 frontend tests pass, palette property suite verified
across 5 randomized runs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@omrsamer
omrsamer merged commit d1e04ca into main Jul 20, 2026
8 checks passed
@omrsamer
omrsamer deleted the fix/palette-search-trim branch July 20, 2026 10:44
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.

1 participant