-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Record Page Navigation Arrows Cause Unnecessary skeleton loading #6367
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
The pull request addresses unnecessary skeleton loading when navigating between records by updating state management and removing conditional rendering logic.
- Modified
packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
to managetotalCount
state dynamically usinguseState
anduseEffect
. - Removed skeleton loading component and conditional rendering logic in
packages/twenty-front/src/modules/ui/layout/page/PageHeader.tsx
. - Eliminated
isLoadingPagination
state frompackages/twenty-front/src/pages/object-record/RecordShowPage.tsx
to streamline navigation.
3 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
Thanks @ehconitin! Could the "Chevron icon button" remain active so a user can click it multiple times? For instance, if I'm on record 8 and want to access record 11, I would like to click the By the way @ehconitin, are you on Discord? I would love to schedule a quick call to thank you for your contributions 🙏 |
Hey @Bonapara, let me get back to you regarding Yes I am on discord, would love to have a chat with you. |
I looked into how this can be achieved. Could it be done on counting the number of clicks and calling the function which navigates the records prev or next that many times? |
Hi @ehconitin, thanks for your answer. I think you're right; this requires a deeper refactor by @lucasbordeau. Instead of fetching the next ID when the page loads, we should fetch the next five and the previous five at once. This way, we can handle navigation without waiting for the page to load each time we want to move to the next record. @lucasbordeau WDYT? Should I create an issue? I think we can merge this PR in the meantime |
@Bonapara there is a bug when we refresh the page, the display |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Bonapara asked for a complete removal of the loader
EDIT: Forget it, wrong PR
Thanks @ehconitin for your contribution! |
@Bonapara
Issue #6325
The navigation should always be visible. Clicking on a Next/Previous arrow should immediately increment the number without switching to the skeleton loading step.
Done
Please let me know what do you think about this approach.
Thanks :)
2024-07-23.00-23-59.mp4