Skip to content

Keep commas in search filter values - #4496

Merged
mikecao merged 2 commits into
umami-software:devfrom
justadityaraj:fix/4489-preserve-regex-commas
Sep 11, 2026
Merged

mikecao merged 2 commits into
umami-software:devfrom
justadityaraj:fix/4489-preserve-regex-commas

Conversation

@justadityaraj

@justadityaraj justadityaraj commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Editing a search filter initialized every string value by splitting on commas. Regex quantifiers such as {21,22} were therefore truncated in the input even though the URL parser had preserved the full expression.

Fix

Keep search-operator values as one string when initializing FilterRecord; retain comma splitting for the existing multi-value operators. Add a component regression using the reported regex shape.

User impact

Regex, contains, and other free-text filter values containing commas remain fully visible and editable instead of showing only the prefix before the first comma.

Verification

  • Focused regressions: 2 passed, including an operator transition that preserves the full comma-bearing value.
  • TypeScript: tsc --noEmit passed after generating the Prisma client with a placeholder local database URL.
  • Biome check on both changed files passed.
  • Full Vitest run: 93 files and 732 tests passed; 4 unrelated suites could not load the repository's PostCSS plugin on this Windows environment.
  • Full repository lint reaches existing diagnostics outside this diff; both changed files are clean.
  • git diff --check passed.

Fixes #4489


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

@justadityaraj is attempting to deploy a commit to the Umami Software Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR preserves comma-bearing values for search operators and resynchronizes selected filter state when the operator or value changes.

  • Adds operator-aware parsing that keeps search values intact while retaining comma splitting for multi-value operators.
  • Adds regressions for initial regex rendering and an equals-to-regex operator transition.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/components/common/FilterRecord.tsx Adds operator-aware selected-value initialization and prop synchronization, resolving the previously reported stale split state.
src/components/common/FilterRecord.test.tsx Covers comma preservation both on initial rendering and when transitioning from a multi-value operator to regex.

Reviews (2): Last reviewed commit: "fix(filters): sync values when operators..." | Re-trigger Greptile

Comment thread src/components/common/FilterRecord.tsx Resolved
@mikecao

mikecao commented Sep 11, 2026

Copy link
Copy Markdown
Member

@greptile

@mikecao
mikecao merged commit cd0f4fe into umami-software:dev Sep 11, 2026
2 of 6 checks passed
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.

2 participants