You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(site): tighten interface design for various frontend utility functions (coder#18894)
Precursor to coder#18895
Splitting this off so that the changes are easier to review.
## Changes made
- Improve type-safety for the `withQuery` Storybook decorator
- Centralized almost all queries that deal with template versions to use
a shared, exported query key prefix
- Updated `useFilter` and `usePagination` to have much more strict
return types, and decoupled them from React Router at the interface
level
- Also added some extra input validation and performance optimizations
to `useFilter` and `usePagination`
- Removed a stale data when working with checked workspaces for the
`/workspaces` page
- Removed hacky `useEffect` call for syncing URL state to checked
workspaces, in favor of explicit state syncs
- Did some extra cleanup and removed unused values
## Notes
- Many of the changes here were in service of the main PR. I'll try to
highlight notable areas, but if there's anything that's not clear, feel
free to post a comment in this PR. Ideally you shouldn't really have to
look at the other PR to understand this one, so if something's
confusing, that's a sign that something's wrong
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Refactor**
* Improved handling of URL search parameters and state synchronization
in filter and pagination features across multiple pages.
* Centralized and clarified state management for workspace selection and
batch actions on the Workspaces page.
* Enhanced type safety and naming consistency in batch actions and
filter components.
* Updated filter and pagination hooks to accept explicit parameters and
callbacks for better maintainability.
* Streamlined prop naming and menu handling in workspace filter
components for clarity.
* **Bug Fixes**
* Prevented unnecessary state updates when filter values remain
unchanged.
* **Tests**
* Updated tests for improved type safety and more precise assertions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
0 commit comments