Closed lucasbordeau closed 1 month ago
Fix RecordShowPage story: Update the MSW mocks in RecordShowPage.stories.tsx
to match the new request structure.
Merge useScrollToPosition and useScrollRestoration: Combine logic from useScrollToPosition
and useScrollRestoration
in /src/hooks/
into a single hook, ensuring all scroll restoration functionality is preserved.
Rename RecordIndexRecordChip to RecordIdentifierChip: Rename the component in /src/modules/object-record/record-index/components/RecordIndexRecordChip.tsx
to RecordIdentifierChip.tsx
and update all imports.
Rename isFieldChipDisplay to isFieldIdentifierDisplay: Rename the variable in /src/modules/object-record/record-field/meta-types/display/components/RelationFromManyFieldDisplay.tsx
and update all references.
Refactor RecordIndexContainer: Move logic from /src/modules/object-record/record-index/components/RecordIndexContainer.tsx
to a separate hook or utility file. Use useGeCurrent
for fetching current state.
Use recoil state instead of useFindRecordCursorFromFindManyCacheRootQuery: Replace useFindRecordCursorFromFindManyCacheRootQuery
with a recoil state in /src/modules/object-record/record-index/components/RecordIndexContainer.tsx
.
Refactor useRecordIdsFromFindManyCacheRootQuery: Modify useRecordIdsFromFindManyCacheRootQuery
in /src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
to only execute if a cursor exists in the recoil state.
Refactor findView and view: any: Update findView
function and view
type in /src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
to use a more specific type.
Refactor useRecordShowPagePagination: Generalize useRecordShowPagePagination
in /src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
to work with different views.
Refactor ROW_HEIGHT extract: Extract ROW_HEIGHT
constant to a shared constants file and update all references.
Refactor URL building: Move URL building logic to a shared utility file and update all instances where URLs are constructed.
/packages/twenty-front/src/pages/object-record/RecordShowPage.tsx /packages/twenty-front/src/hooks/useScrollRestoration.ts /packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexContainer.tsx /packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowPage.ts /packages/twenty-front/src/modules/object-record/record-show/graphql/operations/factories/findOneRecordForShowPageOperationSignatureFactory.ts /packages/twenty-front/src/modules/object-record/record-show/components/RecordShowContainer.tsx /packages/twenty-front/src/modules/object-record/record-show /packages/twenty-front/src/modules/object-record/record-index/components /packages/twenty-front/src/modules/object-record/record-show/hooks /packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components /packages/twenty-front/src/modules/object-record/record-right-drawer/components /packages/twenty-front/src/modules/object-record/record-field/meta-types/display/components/RelationFromManyFieldDisplay.tsx
@FelixMalfait @charlesBochet
Passing the cursor from table seems useless, because we can already have it from the return of the findOne request by using the same query variables than the passed view.
we decided to base the behavior on saved views only, thus passing a cursor seems redundant because we already have the view + the recordId
we have to request the record id if we don't come from a table page, thus requesting it when we come from the table page seems to be ok conceptually because the common denominator is the view+recordId not the cursor.
this way we'll always have the right position, no matter the cursor position (it should be the same but in any case)
The assumption that led to passing the parameter was that recomputing the position / converting the sorts into filters would be too expensive, but great if it's not!
Scope & Context
After merge of https://github.com/twentyhq/twenty/pull/6031, we have a lot of small fixes and refactors to do. We left them aside to release a working feature.
Technical inputs