From 220e05d2ae7c949d335d648211fae054b16c80b1 Mon Sep 17 00:00:00 2001 From: SeongHyun Kim Date: Fri, 27 Feb 2026 15:16:37 +0900 Subject: [PATCH] =?UTF-8?q?fix(pop-card-list):=20=EC=9B=90=EB=B3=B8=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=84=A0=ED=83=9D=20?= =?UTF-8?q?=EC=95=88=20=EB=90=98=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CartListModeConfig에 sourceComponentId 추가 - cartType이 빈 문자열인 경우 componentId로 매칭 - Select value: sourceComponentId 기반 안정적 매칭 - 런타임: sourceComponentId > cartType > 첫 번째 순으로 폴백 원인: 4160 화면의 cartAction에 cartType 미설정 -> 빈 문자열 -> Select 저장 시 undefined 순환 -> 선택 불가 --- .../pop-card-list/PopCardListComponent.tsx | 17 ++++++++++------- .../pop-card-list/PopCardListConfig.tsx | 15 +++++++++++---- frontend/lib/registry/pop-components/types.ts | 1 + 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/frontend/lib/registry/pop-components/pop-card-list/PopCardListComponent.tsx b/frontend/lib/registry/pop-components/pop-card-list/PopCardListComponent.tsx index f89e44e6..585bea94 100644 --- a/frontend/lib/registry/pop-components/pop-card-list/PopCardListComponent.tsx +++ b/frontend/lib/registry/pop-components/pop-card-list/PopCardListComponent.tsx @@ -515,13 +515,16 @@ export function PopCardListComponent({ const layoutJson = await screenApi.getLayoutPop(cartListMode.sourceScreenId); const componentsMap = layoutJson?.components || {}; const componentList = Object.values(componentsMap) as any[]; - const matched = cartListMode.cartType - ? componentList.find( - (c: any) => - c.type === "pop-card-list" && - c.config?.cartAction?.cartType === cartListMode.cartType - ) - : componentList.find((c: any) => c.type === "pop-card-list"); + // sourceComponentId > cartType > 첫 번째 pop-card-list 순으로 매칭 + const matched = cartListMode.sourceComponentId + ? componentList.find((c: any) => c.id === cartListMode.sourceComponentId) + : cartListMode.cartType + ? componentList.find( + (c: any) => + c.type === "pop-card-list" && + c.config?.cartAction?.cartType === cartListMode.cartType + ) + : componentList.find((c: any) => c.type === "pop-card-list"); if (matched?.config?.cardTemplate) { setInheritedTemplate(matched.config.cardTemplate); } diff --git a/frontend/lib/registry/pop-components/pop-card-list/PopCardListConfig.tsx b/frontend/lib/registry/pop-components/pop-card-list/PopCardListConfig.tsx index eb1f565e..696f4821 100644 --- a/frontend/lib/registry/pop-components/pop-card-list/PopCardListConfig.tsx +++ b/frontend/lib/registry/pop-components/pop-card-list/PopCardListConfig.tsx @@ -933,15 +933,18 @@ function CartListModeSection({ const handleComponentSelect = (val: string) => { if (val === "__none__") { - onUpdate({ ...mode, cartType: undefined }); + onUpdate({ ...mode, cartType: undefined, sourceComponentId: undefined }); return; } - // cartType 직접 매칭 또는 componentId 매칭 (__comp_ 접두사) const found = val.startsWith("__comp_") ? sourceCardLists.find((c) => c.componentId === val.replace("__comp_", "")) : sourceCardLists.find((c) => c.cartType === val); if (found) { - onUpdate({ ...mode, cartType: found.cartType || undefined }); + onUpdate({ + ...mode, + sourceComponentId: found.componentId, + cartType: found.cartType || undefined, + }); } }; @@ -997,7 +1000,11 @@ function CartListModeSection({ ) : (