Skip to content

feat(hybridFilter): add shift-click range selection#108367

Merged
JonasBa merged 8 commits intomasterfrom
jb/pagefilters/shift-select
Feb 17, 2026
Merged

feat(hybridFilter): add shift-click range selection#108367
JonasBa merged 8 commits intomasterfrom
jb/pagefilters/shift-select

Conversation

@JonasBa
Copy link
Copy Markdown
Member

@JonasBa JonasBa commented Feb 17, 2026

Split away from #108294 as we de didn't merge the upstream change

Implements shift-click multi-selection for hybrid filter components,
allowing users to select a range of items by holding shift and clicking.
This works alongside existing Cmd/Ctrl modifier for individual toggles.

- Separate shift key detection from Cmd/Ctrl modifiers
- Add range selection logic that selects all items between anchor and clicked item
- Extract performSingleToggle helper to reduce code duplication
- Track last selected item as anchor point for range selection
- Clear text selection on shift-click to prevent UI glitches
- Keep menu open during shift operations
- Add comprehensive unit tests for shift-click functionality
- Update all consumers to pass options array to hook
- Use Ctrl+row clicks to set anchor instead of checkbox clicks
- This ensures keyboard events are properly captured by CompactSelect
- Fix array ordering in shiftToggleRange to preserve option order
- All 13 tests now passing
The text selection clearing isn't needed for the shift-click functionality.
@JonasBa JonasBa requested review from a team as code owners February 17, 2026 19:05
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 17, 2026
Copy link
Copy Markdown
Contributor

@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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

…ift-click in portal overlays

The onKeyDown/onKeyUp handlers on the CompactSelect wrapper div never
fired during dropdown interactions because the overlay renders in a
portal, so keyboard events don't bubble back up to the outer div.

Switch to window.addEventListener for keydown/keyup to reliably track
modifier key state regardless of which element is focused. Use useRef
for synchronous access in event handlers (avoiding stale closures), and
import the isModifierKeyPressed utility that was added but unused.
SelectKey is string | number, so a value of 0 or "" would pass a falsy
check and incorrectly treat a valid anchor as unset. Use === null instead.
@JonasBa JonasBa force-pushed the jb/pagefilters/shift-select branch from a46f115 to fe37d8c Compare February 17, 2026 19:57
@JonasBa JonasBa force-pushed the jb/pagefilters/shift-select branch from 5ce1339 to fe37d8c Compare February 17, 2026 21:03
@JonasBa JonasBa merged commit 1dd5d51 into master Feb 17, 2026
115 checks passed
@JonasBa JonasBa deleted the jb/pagefilters/shift-select branch February 17, 2026 21:20
mchen-sentry pushed a commit that referenced this pull request Feb 24, 2026
Split away from #108294 as we de
didn't merge the upstream change
@github-actions github-actions bot locked and limited conversation to collaborators Mar 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants