-
Notifications
You must be signed in to change notification settings - Fork 0
[CLEAN] Synthetic Benchmark PR #102792 - feat(dashboards): Use a single value selector for boolean filters #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: base_pr_102792_20251204_5578
Are you sure you want to change the base?
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
User description
Benchmark PR getsentry#102792
Type: Clean (correct implementation)
Original PR Title: feat(dashboards): Use a single value selector for boolean filters
Original PR Description: Boolean filters previously used the multi select. If a list of booleans (e.g. [true,false]) is used in a widget query, an error is thrown by the backend because booleans are expected to be single values. To avoid this error completely, this PR uses a single value compact select for booleans (and any other filter token that doesn't support multi select).
Original PR URL: getsentry#102792
PR Type
Enhancement
Description
Export
tokenSupportsMultipleValuesfunction for reuse across componentsUse single value
CompactSelectfor boolean and string filter typesAdd
IGNORE_DEFAULT_VALUESconstant to exclude string/boolean from default value initializationRefactor filter selector to support both multi-select and single-select modes
Extract menu header and trigger rendering into separate functions
Increase max menu width from 400 to 500 pixels
Diagram Walkthrough
flowchart LR A["valueCombobox.tsx<br/>Export tokenSupportsMultipleValues"] --> B["filterSelector.tsx<br/>Import and use function"] B --> C["Determine canSelectMultipleValues"] C --> D{Can select<br/>multiple?} D -->|No| E["Render CompactSelect<br/>single value mode"] D -->|Yes| F["Render HybridFilter<br/>multi-select mode"] G["addFilter.tsx<br/>Add IGNORE_DEFAULT_VALUES"] --> H["Skip default values<br/>for string/boolean"]File Walkthrough
valueCombobox.tsx
Export tokenSupportsMultipleValues functionstatic/app/components/searchQueryBuilder/tokens/filter/valueCombobox.tsx
tokenSupportsMultipleValuesfunction to make it available forexternal use
based on field definition
addFilter.tsx
Skip default values for string and boolean typesstatic/app/views/dashboards/globalFilter/addFilter.tsx
IGNORE_DEFAULT_VALUESconstant containing string and boolean fieldvalue types
and boolean types
empty
filterSelector.tsx
Implement single value selector for non-multi-select filtersstatic/app/views/dashboards/globalFilter/filterSelector.tsx
CompactSelectcomponent andtokenSupportsMultipleValuesfunction
canSelectMultipleValuesstate to determine which selectorcomponent to use
renderMenuHeaderTrailingItemsandrenderFilterSelectorTriggerinto separate functions
CompactSelectfor single-valuefilters,
HybridFilterfor multi-selectCompactSelectto handle single value selection with clear andremove filter buttons
canSelectMultipleValuesto options dependency array