Skip to content

refactor(pageFilters): abstract hybridFilters logic to hook#108217

Merged
JonasBa merged 32 commits intomasterfrom
jb/hybridfilters/hook
Feb 17, 2026
Merged

refactor(pageFilters): abstract hybridFilters logic to hook#108217
JonasBa merged 32 commits intomasterfrom
jb/hybridfilters/hook

Conversation

@JonasBa
Copy link
Member

@JonasBa JonasBa commented Feb 13, 2026

HybridFilters is just a glorified wrapper around CompactSelect, which should not exist. Instead, what we want is a headless control over compactSelect in the form of a hook. This has the benefit of being composable, deferring some options like hasExternal changes to callers (simply by virtue of not abstracting over the view layer)

In the next change, I will streamline hybrid filter headers and move mappedOptions, menuHeaderTrailingItems and renderFooter to the callers, which then leaves hybridFilters worthless and up for removal

JonasBa and others added 16 commits February 11, 2026 11:50
Moves checkbox position to the beginning of the row and unwinds the mess
of checkwraps.

<img width="666" height="624" alt="CleanShot 2026-02-11 at 16 28 05@2x"
src="https://github.com/user-attachments/assets/4fe46a08-9619-49b7-9377-fb58088495cb"
/>

Fix DE-752
…dFilter

- Created useStagedCompactSelect hook that encapsulates all state management
  and business logic for staged selection (commit/cancel/toggle)
- Manages modifier key detection for hybrid single/multiple selection mode
- Hook returns all handlers and state as a single object (stagedSelect)
- Component now focuses on UI rendering while hook handles state logic
- All existing tests pass, no behavior changes
…electProps

- Hook now returns a typed `props` object that matches CompactSelectProps
- Props can be spread directly into CompactSelect: {...stagedSelect.props}
- Separates CompactSelect props from utility functions (commit, toggleOption, etc)
- Improves type safety and makes hook more reusable
- All tests pass, no behavior changes
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 13, 2026
Comment on lines +61 to +69
defaultValue: Value[];
handleReset: () => void;
hasStagedChanges: boolean;
modifierKeyPressed: boolean;
removeStagedChanges: () => void;
shouldShowReset: boolean;
stagedValue: Value[];
toggleOption: (val: Value) => void;
disableCommit?: boolean;
Copy link
Member Author

@JonasBa JonasBa Feb 13, 2026

Choose a reason for hiding this comment

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

I will be able to remove these when I create an abstraction for staged select UI components, at which point we can decide if we want to build them into a select multiple API or not

Base automatically changed from jb/projectfilters/search to master February 13, 2026 17:32
@JonasBa JonasBa marked this pull request as ready for review February 13, 2026 17:35
@JonasBa JonasBa requested review from a team as code owners February 13, 2026 17:35
Copy link
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.

Copy link
Collaborator

@TkDodo TkDodo left a comment

Choose a reason for hiding this comment

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

great win 🙌

@JonasBa JonasBa merged commit 452ef59 into master Feb 17, 2026
61 checks passed
@JonasBa JonasBa deleted the jb/hybridfilters/hook branch February 17, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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