From fc2b1de860f4dcb523dec5f0756714fd4193a04c Mon Sep 17 00:00:00 2001 From: BugIsGod <87571967+bugisthegod@users.noreply.github.com> Date: Thu, 5 Mar 2026 16:51:59 +0000 Subject: [PATCH] fix: composite field sub-menu not showing in advanced filter (#18395) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem While working on the IS/IS_NOT filter feature (#15317 ), I found this problem. So I want to submit a separate pr to fix it at first. In the advanced filter, clicking on a composite field (Emails, Phones, Links) was not showing the sub-field selection menu. ## Root cause Related to #18178 (Recoil → Jotai migration). `AdvancedFilterFieldSelectMenu` was writing composite field states using `advancedFilterFieldSelectDropdownId` as the instance ID. But the reader components (`AdvancedFilterFieldSelectDropdownContent`, `AdvancedFilterSubFieldSelectMenu`) resolve the instance ID from React context, which has a different value — so they were reading from a different Jotai atom instance and `isSelectingCompositeField` was always `false`. ## Fix Remove the 3 explicit instance IDs so the writer uses context, matching the readers. ## Before https://github.com/user-attachments/assets/dde54077-0eaf-453c-a638-bec6d6fe4d55 ## After https://github.com/user-attachments/assets/01916bcf-0ee8-49ad-bb54-9d8f10571069 Hope I understood it correctly. --------- Co-authored-by: Etienne <45695613+etiennejouan@users.noreply.github.com> --- .../advanced-filter/components/AdvancedFilterFieldSelectMenu.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterFieldSelectMenu.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterFieldSelectMenu.tsx index 924203d302..eaf87107e5 100644 --- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterFieldSelectMenu.tsx +++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterFieldSelectMenu.tsx @@ -43,7 +43,6 @@ export const AdvancedFilterFieldSelectMenu = ({ const [objectFilterDropdownSearchInput] = useAtomComponentState( objectFilterDropdownSearchInputComponentState, - advancedFilterFieldSelectDropdownId, ); const { objectMetadataItem } = useContext(AdvancedFilterContext);