Files
twenty/packages
Sonarly Claude Code 0464fb7013 fix: include label identifier in record table widget view fields even if system field
https://sonarly.com/issue/18601?type=bug

When a record table widget is embedded in a dashboard for an object whose label identifier is the `id` field (a system field), the table header renders one extra duplicate column, causing all header columns to be misaligned with body columns.

Fix: Modified `filterFieldsForRecordTableViewCreation` to accept the `labelIdentifierFieldMetadataId` parameter and allow the label identifier field through even when it's a system field. This ensures that when a record table widget view is created for an object whose label identifier is `id` (a system field), the `id` field is included as a view field.

Without this fix, the `id` field was excluded from `visibleRecordFields` because `!field.isSystem` filtered it out. This caused the record table header to render a duplicate first column (since `filterOutByProperty` in `RecordTableHeaderFirstScrollableCell` was a no-op when the label identifier wasn't in the visible fields list), misaligning header columns with body columns.

The pattern matches the existing approach in `visibleRecordFieldsComponentSelector` where `isLabelIdentifier` overrides the `isActiveFieldMetadataItem` check.

Updated the single call site in `useCreateViewForRecordTableWidget` to pass `objectMetadataItem.labelIdentifierFieldMetadataId` (which was already available in scope).
2026-03-26 08:15:18 +00:00
..
2026-03-23 16:56:15 +00:00