-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix: view group followup #9162
fix: view group followup #9162
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
This PR implements significant improvements to the group by and sort functionalities in Twenty's record management system. The changes focus on fixing UI/UX issues and enhancing performance.
- Switched from component selectors to family selectors for record groups with explicit view type parameters, improving state management granularity and performance
- Added confirmation modal for switching from alphabetical to manual sorting when reordering groups, with proper state handling via
recordGroupPendingDragEndReorderState
- Implemented view-specific behavior for hiding empty groups using
recordIndexRecordGroupHideComponentFamilyState
, with different defaults for Table (hidden) and Kanban (visible) views - Improved dropdown menu interactions by keeping menus open during sort changes and adding contextual text for group by and sort options
- Optimized view group persistence by replacing individual Apollo mutations with batch operations for better performance
32 file(s) reviewed, 13 comment(s)
Edit PR Review Bot Settings | Greptile
...odules/object-record/object-options-dropdown/components/ObjectOptionsDropdownMenuContent.tsx
Outdated
Show resolved
Hide resolved
...front/src/modules/object-record/record-group/states/recordGroupPendingDragEndReorderState.ts
Show resolved
Hide resolved
...front/src/modules/object-record/record-group/states/recordGroupPendingDragEndReorderState.ts
Show resolved
Hide resolved
...ront/src/modules/object-record/record-group/hooks/useRecordGroupReorderConfirmationModal.tsx
Outdated
Show resolved
Hide resolved
...ront/src/modules/object-record/record-group/hooks/useRecordGroupReorderConfirmationModal.tsx
Outdated
Show resolved
Hide resolved
.../object-record/record-group/states/selectors/visibleRecordGroupIdsComponentFamilySelector.ts
Show resolved
Hide resolved
.../object-record/record-group/states/selectors/visibleRecordGroupIdsComponentFamilySelector.ts
Show resolved
Hide resolved
.../modules/object-record/record-index/states/recordIndexRecordGroupHideComponentFamilyState.ts
Show resolved
Hide resolved
packages/twenty-front/src/modules/views/hooks/internal/usePersistViewGroupRecords.ts
Outdated
Show resolved
Hide resolved
packages/twenty-front/src/modules/views/hooks/internal/usePersistViewGroupRecords.ts
Outdated
Show resolved
Hide resolved
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.
Some remarks :)
1 - I observed a weird behaviour when creating a view group from an empty records page:
https://github.com/user-attachments/assets/26d4aa3f-6556-4bf4-8cd8-3638f1aaf719
2 - nit but in the dropdown on Sort, when opening the Ascending / Descending dropdown, the submenu is "merged" with the bigger dropdown, maybe not intended?
https://github.com/user-attachments/assets/56dacc61-a0df-498f-98a0-222e51b0841f
/> | ||
)} | ||
{(viewType === ViewType.Kanban || isViewGroupEnabled) && | ||
currentView?.key !== 'INDEX' && ( |
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.
Why do we have this change ? I can't see the group by option from the table view, had to remove it to be able to create a view group
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.
Oh I see, it is to disable the option from the main view right ?
I feel this may prevent users from discovering the feature. Instead I would create a new view when selecting group by. wdyt @Bonapara ?
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 not sure you have seen this comment, would just like to double check that it is the intended behaviour
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.
@ijreilly It was actually decided on Discord with @charlesBochet to go that way for now
...bject-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupsContent.tsx
Show resolved
Hide resolved
…ield selection" menu
5598091
to
c74f477
Compare
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.
Some issues
-
Change in ScrollWrapper breaks needed scroll in some pages (see comments)
-
Issue with the visible groups (see comments)
-
Dropdown UI feels a bit weird: ultimate dropdown content is smaller than previously while it does not allow to see the options well (in the recording, "employees"), + there is a big white space under "Create select field"
https://github.com/user-attachments/assets/437313c3-d388-4d2d-8b3c-aa63c661b6ad -
maybe not very important but:
I think the behaviour for empty record pages is still weird. I disabled "hide empty groups' but they only show when clicking '+'.
I understand though that we usually have our empty record pages that we want to show. Not sure what is the right behaviour then, but it does will a bit weird design-wise:
https://github.com/user-attachments/assets/93f0a2bf-87f5-4643-95cf-2802a91b7126
packages/twenty-front/src/modules/ui/utilities/scroll/components/ScrollWrapper.tsx
Outdated
Show resolved
Hide resolved
...-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupFieldsContent.tsx
Show resolved
Hide resolved
.../object-record/record-group/states/selectors/visibleRecordGroupIdsComponentFamilySelector.ts
Show resolved
Hide resolved
.../object-record/record-group/states/selectors/visibleRecordGroupIdsComponentFamilySelector.ts
Show resolved
Hide resolved
...-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupFieldsContent.tsx
Show resolved
Hide resolved
...bject-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupsContent.tsx
Outdated
Show resolved
Hide resolved
packages/twenty-front/src/modules/object-record/record-board/components/RecordBoard.tsx
Outdated
Show resolved
Hide resolved
...c/modules/object-record/record-table/empty-state/components/RecordTableEmptyStateDisplay.tsx
Show resolved
Hide resolved
...src/modules/object-record/record-table/states/selectors/hasPendingRecordComponentSelector.ts
Outdated
Show resolved
Hide resolved
packages/twenty-front/src/modules/ui/utilities/scroll/components/ScrollWrapper.tsx
Outdated
Show resolved
Hide resolved
b0723bb
to
7cb6073
Compare
This PR fixes all followup that @Bonapara add on Discord.
Performance improvement:
https://github.com/user-attachments/assets/fd2acf66-0e56-45d0-8b2f-99c62e57d6f7
https://github.com/user-attachments/assets/80f1a2e1-9f77-4923-b85d-acb9cad96886
Also fix #9036