Skip to content

Conversation

@ahrefabhi
Copy link
Contributor

@ahrefabhi ahrefabhi commented Dec 3, 2025

πŸ“„ Summary


βœ… Changes

  • Added fix for free text with quick filters issue.
Screen.Recording.2025-12-03.at.6.03.26.PM.mov

Note

Improves query parsing to retain incomplete free-text keys and updates filter value conversion to unquote quoted strings; adds a unit test for the scenario.

  • Query parsing (frontend/src/utils/queryContextUtils.ts)
    • Finalize current pair on conjunctions or new KEY tokens (regardless of completeness) to support free-text preceding valid filters.
  • Filter value formatting (frontend/src/components/QueryBuilderV2/utils.ts)
    • formatSingleValueForFilter now returns unquoted strings when values are quoted (via isQuoted/unquote).
  • Tests (frontend/src/utils/__tests__/queryContextUtils.test.ts)
    • Add test covering free-text followed by NOT IN list parsing.

Written by Cursor Bugbot for commit 73fdacf. This will update automatically on new commits. Configure here.

@github-actions github-actions bot added the bug Something isn't working label Dec 3, 2025
@ahrefabhi ahrefabhi changed the title fix: added fix free text with quick filter issue fix: added fix for free text with quick filter issue Dec 3, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

currentPair.key &&
(isConjunctionToken(token.type) ||
(token.type === FilterQueryLexer.KEY && isQueryPairComplete(currentPair)))
(isConjunctionToken(token.type) || token.type === FilterQueryLexer.KEY)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Incomplete pairs create malformed filters with empty operators

The removal of isQueryPairComplete(currentPair) allows incomplete query pairs (free text without operators) to be returned by extractQueryPairs. However, convertExpressionToFilters processes all pairs without checking isComplete, creating filters with empty operators and values. When these filters are later converted back to expressions via convertFiltersToExpression, it produces malformed expressions like "keyname ''" (double space with empty quoted value), which could cause parsing errors or unexpected query behavior downstream.

Additional Locations (1)

Fix in CursorΒ Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants