🦣🦣🦣 Table virtualization (#14743)
This big PR implements table virtualization with an offset paging, allowing a way more fluid UX. It is a v1 that should be improved in the future with partial data loading and optimization of the browser display performance of a row. But with this PR we have the solid enough technical foundation, both frontend and backend, to get to a smooth table UX. Fixes and improvements after first successful round of development (needed to have main clean) : - [x] Delete should refresh virtualized portion only and reset all table - [x] Fix add new : top and bottom - [x] Table empty shouldn’t show when first loading - [x] Fix d&d - [x] Fix sorts - [x] Fix drag when scrolling after a full virtual page (it throws an error) - [x] Si update mais qu’on a un sort ou filter, alors il faut trigger le refresh - [x] Reset scroll position between tables - [x] Reset scroll shadows between tables - [x] Setup d&n for virtual list : https://github.com/hello-pangea/dnd/blob/main/docs/patterns/virtual-lists.md - [x] Full table re-render when entering edit mode - [x] Clean code and prepare for merge Fixes https://github.com/twentyhq/core-team-issues/issues/1613 that contains other bugs to be fixed before merge --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
+41
@@ -0,0 +1,41 @@
|
||||
import { createFamilyState } from '@/ui/utilities/state/utils/createFamilyState';
|
||||
|
||||
export type ObjectOperationData =
|
||||
| {
|
||||
type: 'update-one';
|
||||
result: {
|
||||
updateInput: any;
|
||||
updatedRecord: any;
|
||||
};
|
||||
}
|
||||
| {
|
||||
type: 'update-many';
|
||||
result: {
|
||||
updateInputs: any[];
|
||||
updatedRecords: any[];
|
||||
};
|
||||
}
|
||||
| {
|
||||
type:
|
||||
| 'create-one'
|
||||
| 'create-many'
|
||||
| 'destroy-one'
|
||||
| 'destroy-many'
|
||||
| 'delete-one'
|
||||
| 'delete-many'
|
||||
| 'restore-one'
|
||||
| 'restore-many'
|
||||
| 'merge-records';
|
||||
};
|
||||
|
||||
export type ObjectOperation = {
|
||||
id: string;
|
||||
data: ObjectOperationData;
|
||||
timestamp: number;
|
||||
};
|
||||
|
||||
export const objectOperationsByObjectNameSingularFamilyState =
|
||||
createFamilyState<ObjectOperation[], { objectNameSingular: string }>({
|
||||
key: 'objectOperationsByObjectNameSingularFamilyState',
|
||||
defaultValue: [],
|
||||
});
|
||||
Reference in New Issue
Block a user