Files
twenty/packages
Félix Malfait 3f9137bd4e Fix widget view save paths dropping relationTargetFieldMetadataId (#23814)
## Context

`viewFilter.relationTargetFieldMetadataId` (relation traversal, added in
2.6.0) is accepted and persisted by the `upsertViewWidget` mutation, and
`mapViewFiltersToFilters` restores it when loading a widget view. But
two frontend mappers silently dropped it, so any relation-traversal
filter on a record table widget view was lost the moment the layout was
saved (or the moment the user edited the widget's filters in the side
panel):

- `useSaveRecordTableWidgetViews` omitted the field when building the
`upsertViewWidget` input
- `useRecordTableWidgetFilterCallbacks` omitted it when syncing current
record filters back into the widget view draft

## Changes

- Carry `relationTargetFieldMetadataId` through both mappers
- Add regression tests for both hooks (they fail without the fix)

This is a prerequisite for nested relation field widgets (see follow-up
PR), which rely on a traversal filter surviving the widget view save
path.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01Xp3AgGtc4kSP8PpgpKMWLQ)_

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/twentyhq/twenty/pull/23814?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
2026-08-05 16:08:25 +02:00
..