Compare commits

...
Author SHA1 Message Date
sonarly-bot 3a5f3749f9 fix(front): restore duplicates detection on record show layouts
https://sonarly.com/issue/40483?type=bug

Duplicate-record detection still works in backend and legacy UI code, but it is no longer reachable from the record show page after the old show-page path was removed.

Fix: I fixed the regression in the frontend layer where record show pages now render through page-layout widgets instead of the old `RecordFieldList` path.

### What I changed
- Updated `FieldsWidget` to render `RecordDetailDuplicatesSection` for full record pages (not side panels).
- This restores duplicates visibility in the same place users now see core record fields on record show pages, without introducing a new widget type or generated-schema changes.

### Why this fixes user impact
- Person/Company default record pages already use the `FIELDS` widget on the Home tab.
- By attaching duplicates rendering to `FieldsWidget`, duplicate suggestions become reachable again in the current page-layout-based show flow.
- `RecordDetailDuplicatesSection` already encapsulates:
  - duplicate-criteria gating,
  - duplicate query call,
  - null rendering when no duplicates,
  - merge action affordance.

Authored by Sonarly by autonomous analysis (run 46155).
2026-05-25 12:07:38 +00:00
@@ -1,5 +1,6 @@
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
import { RecordFieldsScopeContextProvider } from '@/object-record/record-field-list/contexts/RecordFieldsScopeContext';
import { RecordDetailDuplicatesSection } from '@/object-record/record-field-list/record-detail-section/duplicate/components/RecordDetailDuplicatesSection';
import { RecordFieldListComponentInstanceContext } from '@/object-record/record-field-list/states/contexts/RecordFieldListComponentInstanceContext';
import { type PageLayoutWidget } from '@/page-layout/types/PageLayoutWidget';
import { FieldsWidgetCellEditModePortal } from '@/page-layout/widgets/fields/components/FieldsWidgetCellEditModePortal';
@@ -171,6 +172,13 @@ export const FieldsWidget = ({ widget }: FieldsWidgetProps) => {
</FieldsWidgetGroupContainer>
)}
{!isInSidePanel && (
<RecordDetailDuplicatesSection
objectRecordId={targetRecord.id}
objectNameSingular={targetRecord.targetObjectNameSingular}
/>
)}
<FieldsWidgetCellHoveredPortal
objectMetadataItem={objectMetadataItem}
recordId={targetRecord.id}