Skip to content

fix: keep Select dimension filter from auto-switching to In List on commas#9589

Open
rohithreddykota wants to merge 1 commit into
mainfrom
rohithreddykota/fix-dimension-filter-select-auto-switch
Open

fix: keep Select dimension filter from auto-switching to In List on commas#9589
rohithreddykota wants to merge 1 commit into
mainfrom
rohithreddykota/fix-dimension-filter-select-auto-switch

Conversation

@rohithreddykota

Copy link
Copy Markdown
Contributor

In a Select-mode dimension filter, typing or pasting values containing commas (e.g. val1, val2) was silently switching the filter mode to In List. This made it impossible to search for dimension values that legitimately contain commas, and surprised users who picked Select on purpose.

  • checkSearchText now early-returns unless the filter is already in InList mode, so Select and Contains treat the input as plain search text.
  • The In List path is unchanged: switching to In List explicitly still parses comma/newline-separated bulk values via splitDimensionSearchText.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@AdityaHegde

Copy link
Copy Markdown
Collaborator

This changes the behaviour as seen from test failure. Pasting a large comma separated list will not work anymore. Is this intended?

@nishantmonu51

Copy link
Copy Markdown
Collaborator

Auto switching is a good UX, is there an escaping that a user can do to not elect fr switching ?
the issue we are trying to address is some dimension values have , in the actual value.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Prevents Select-mode dimension filters from silently switching to In List when the user types/pastes text containing commas, allowing searches for dimension values that legitimately include commas.

Changes:

  • Updated checkSearchText to only parse/split comma/newline bulk input when the current mode is already InList.
  • Removed the auto-switch-to-InList behavior when multiple values are detected from the search text.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +243 to 247
// Include both existing selected values and new search values so the
// below-fold query can find existing selected values that might not be
// in the top 250.
searchedBulkValues = [...new Set([...selectedValues, ...values])];
inListTooLong = isUrlTooLongAfterInListFilter(values);
Comment on lines +231 to +234
// Only parse bulk values / auto-recalc when already in InList mode.
// Select and Contains modes should treat the input as plain search text
// and never auto-switch based on the presence of commas.
if (curMode !== DimensionFilterMode.InList) return;
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.

4 participants