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
New aggregates feature handling of frontend queries and cache.
Current behavior
Currently the total count aggregate is part of any request that fetches data.
The problem is that we cannot easily do optimistic rendering of aggregates.
Expected behavior
We want to separate data request from aggregate request, so that we can do optimistic rendering for the data part and trigger a network refresh for the aggregate part.
The difficulty to keep things clean is to tie each data request to its aggregate counterpart and be able to easily refresh the aggregate request from any part of the app.
For example we could have a Pill component in the ViewBar dropdown and this component would display the total count for each view and their filter, thus we would need to fetch only the aggregate for each request parameters of each view.
We could copy the prefetch query system and have generic logic to get aggregate / data query from a unique map of queries, this could be a meaningful family state like "record-table-data-query" => { filters: { ... }, orderBy: { ... } }, this recoil state would be updated by the parts of the code that compute the parameters of the request.
The text was updated successfully, but these errors were encountered:
This commit implements a new system for managing aggregate queries separately
from data queries, enabling optimistic rendering and independent refresh of
aggregate data.
Key changes:
- Add aggregateQueriesState to store query parameters
- Create useAggregateQueries hook for managing aggregate queries
- Add query key generation utilities
- Implement useLinkedAggregateQuery hook to tie data and aggregate queries
This addresses issue twentyhq#8542 by:
1. Separating data and aggregate requests
2. Enabling optimistic rendering of aggregates
3. Supporting independent refresh of aggregate data
4. Providing clean integration with ViewBar Pill components
Breaking Changes: None
Scope & Context
New aggregates feature handling of frontend queries and cache.
Current behavior
Currently the total count aggregate is part of any request that fetches data.
The problem is that we cannot easily do optimistic rendering of aggregates.
Expected behavior
We want to separate data request from aggregate request, so that we can do optimistic rendering for the data part and trigger a network refresh for the aggregate part.
The difficulty to keep things clean is to tie each data request to its aggregate counterpart and be able to easily refresh the aggregate request from any part of the app.
For example we could have a Pill component in the ViewBar dropdown and this component would display the total count for each view and their filter, thus we would need to fetch only the aggregate for each request parameters of each view.
We could copy the prefetch query system and have generic logic to get aggregate / data query from a unique map of queries, this could be a meaningful family state like "record-table-data-query" => { filters: { ... }, orderBy: { ... } }, this recoil state would be updated by the parts of the code that compute the parameters of the request.
The text was updated successfully, but these errors were encountered: