Skip to content

Implement hide empty groups for grouped table view#16494

Merged
FelixMalfait merged 9 commits intomainfrom
feat/hide-empty-groups-table-view
Jan 9, 2026
Merged

Implement hide empty groups for grouped table view#16494
FelixMalfait merged 9 commits intomainfrom
feat/hide-empty-groups-table-view

Conversation

@abdulrahmancodes
Copy link
Copy Markdown
Contributor

No description provided.

- Replaced the `RecordTableRecordGroupBodyContextProvider` with a new `RecordTableRecordGroupWrapper` component to streamline the rendering of record groups.
- The new wrapper component encapsulates the logic for handling empty record groups and integrates the necessary context providers and droppable areas.
- This change improves code organization and enhances the readability of the `RecordTableRecordGroupsBody` component.
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Prompt for AI agents (all 1 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/twenty-front/src/modules/object-record/record-table/record-table-body/components/RecordTableRecordGroupsBody.tsx">

<violation number="1" location="packages/twenty-front/src/modules/object-record/record-table/record-table-body/components/RecordTableRecordGroupsBody.tsx:37">
P1: When the first record group (`index === 0`) is empty and `shouldHideEmptyRecordGroups` is true, `RecordTableCellPortals` will never render because the wrapper returns `null` before reaching the portal rendering logic. This would break table cell interactions (hover states, focus, edit mode, arrow key navigation). Consider moving `RecordTableCellPortals` outside the wrapper or checking if it&#39;s the first *visible* group rather than first group by index.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 11, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:6004

This environment will automatically shut down when the PR is closed or after 5 hours.

@abdulrahmancodes abdulrahmancodes marked this pull request as draft December 11, 2025 12:08
@abdulrahmancodes abdulrahmancodes removed the request for review from ijreilly December 11, 2025 12:08
- Removed the `RecordTableRecordGroupWrapper` component and integrated its logic directly into `RecordTableRecordGroupsBody`.
- Introduced filtering for empty record groups based on the `shouldHideEmptyRecordGroups` state.
- Enhanced the rendering logic to improve code organization and maintainability.
- Updated the component structure to utilize new context providers and droppable areas for better functionality.
@abdulrahmancodes abdulrahmancodes marked this pull request as ready for review December 11, 2025 12:40
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (all 1 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/twenty-front/src/modules/object-record/record-table/record-table-body/components/RecordTableRecordGroupsBody.tsx">

<violation number="1" location="packages/twenty-front/src/modules/object-record/record-table/record-table-body/components/RecordTableRecordGroupsBody.tsx:46">
P2: Using `useRecoilCallback` with immediate invocation during render may cause reactivity issues. The component reads `recordIdsByGroup` from snapshot without subscribing to it, so it won&#39;t re-render when group contents change (e.g., when a record is added to an empty group or all records are removed from a group). Consider using a selector for this derived state, or subscribing to the necessary state values directly.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

- Introduced a new selector to filter visible record group IDs based on the presence of record IDs, enhancing the handling of empty record groups.
- Updated `RecordTableRecordGroupsBody` to utilize the new selector, streamlining the filtering logic and improving code organization.
- Removed redundant state management related to empty record groups, simplifying the component's structure.
import { ViewComponentInstanceContext } from '@/views/states/contexts/ViewComponentInstanceContext';
import { type ViewType } from '@/views/types/ViewType';

export const filteredVisibleRecordGroupIdsComponentFamilySelector =
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat: creating a selector is a bit overkill

export const filteredVisibleRecordGroupIdsComponentFamilySelector =
createComponentFamilySelector<RecordGroupDefinition['id'][], ViewType>({
key: 'filteredVisibleRecordGroupIdsComponentFamilySelector',
componentInstanceContext: ViewComponentInstanceContext,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does not feel write to use ViewComponentInstanceContext for RecordIndex but it seems to be used everywhere in the current code so LGTM

Copy link
Copy Markdown
Member

@charlesBochet charlesBochet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments actually @abdulrahmancodes :)

@ijreilly FYI

- Updated `RecordBoardColumns`, `RecordBoardHeader`, and `RecordBoardColumn` components to utilize the new `filteredVisibleRecordGroupIdsComponentFamilySelector`, enhancing the filtering logic for visible record groups.
- Removed unused state management related to empty record groups, simplifying the component structure and improving maintainability.
@FelixMalfait FelixMalfait enabled auto-merge January 8, 2026 08:09
@FelixMalfait FelixMalfait disabled auto-merge January 8, 2026 08:55
@FelixMalfait FelixMalfait added this pull request to the merge queue Jan 8, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 8, 2026
@FelixMalfait FelixMalfait added this pull request to the merge queue Jan 8, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 8, 2026
@FelixMalfait FelixMalfait added this pull request to the merge queue Jan 9, 2026
@FelixMalfait FelixMalfait removed this pull request from the merge queue due to a manual request Jan 9, 2026
@FelixMalfait FelixMalfait merged commit b1c821b into main Jan 9, 2026
21 checks passed
@FelixMalfait FelixMalfait deleted the feat/hide-empty-groups-table-view branch January 9, 2026 16:31
@twenty-eng-sync
Copy link
Copy Markdown

Hey @FelixMalfait! After you've done the QA of your Pull Request, you can mark it as done here. Thank you!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 9, 2026

Thanks @abdulrahmancodes for your contribution!
This marks your 110th PR on the repo. You're top 1% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants