From 67dee4f0d9661a08110a33c0736df08fd029db4d Mon Sep 17 00:00:00 2001 From: mortezaei Date: Tue, 25 Aug 2026 12:26:34 +0330 Subject: [PATCH 01/21] fix question --- src/components/Componentes/question-renderer.tsx | 1 + src/components/Componentes/question-slider.tsx | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/Componentes/question-renderer.tsx b/src/components/Componentes/question-renderer.tsx index dcf20c7..de9185c 100644 --- a/src/components/Componentes/question-renderer.tsx +++ b/src/components/Componentes/question-renderer.tsx @@ -117,6 +117,7 @@ export function QuestionRenderer({ ); case "slider": case "scale": + case "range": return ( Date: Tue, 25 Aug 2026 13:20:05 +0330 Subject: [PATCH 02/21] fix client --- .../[slug]/question-detail-client.tsx | 6 ++- src/hooks/marriage/use-section-data.ts | 38 +++++++++++-------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/app/questions-list/[slug]/question-detail-client.tsx b/src/app/questions-list/[slug]/question-detail-client.tsx index 1ec396f..937738b 100644 --- a/src/app/questions-list/[slug]/question-detail-client.tsx +++ b/src/app/questions-list/[slug]/question-detail-client.tsx @@ -270,12 +270,16 @@ export default function QuestionDetailClient({ const profileId = useCurrentProfileId(); const handleExit = useCallback(() => { + void queryClient.invalidateQueries({ + queryKey: [...marriageQueryKeys.all, "form-overview"], + exact: false, + }); if (onClose) { onClose(); return; } router.replace(questionsListHref); - }, [onClose, questionsListHref, router]); + }, [onClose, questionsListHref, router, queryClient]); // Hardware back in the detail page = navigate back to questions list. // QuestionAnswersProvider's pagehide/unmount safety net will flush diff --git a/src/hooks/marriage/use-section-data.ts b/src/hooks/marriage/use-section-data.ts index 93202f5..38cab6a 100644 --- a/src/hooks/marriage/use-section-data.ts +++ b/src/hooks/marriage/use-section-data.ts @@ -149,22 +149,28 @@ export function applyProfilePatchResultToCache( const slug = String(queryKey[3] ?? ""); queryClient.setQueryData(queryKey, patchSection(current, slug)); }); - queryClient.setQueryData( - marriageQueryKeys.formOverview("profile", locale), - (current: any) => - current - ? { - ...current, - progress: data.progress, - sections: current.sections.map((section: any) => { - const progress = - data.affected_sections[section.id] ?? - data.progress.sections_progress[section.id]; - return progress ? { ...section, progress } : section; - }), - } - : current, - ); + queryClient + .getQueriesData({ + queryKey: [...marriageQueryKeys.all, "form-overview"], + }) + .forEach(([queryKey, current]: [any, any]) => { + if (!current) return; + queryClient.setQueryData(queryKey, { + ...current, + progress: data.progress, + sections: current.sections?.map((section: any) => { + const progress = + data.affected_sections[section.id] ?? + data.progress?.sections_progress?.[section.id]; + return progress ? { ...section, progress } : section; + }), + }); + }); + + void queryClient.invalidateQueries({ + queryKey: [...marriageQueryKeys.all, "form-overview"], + exact: false, + }); } export function useMarriageSectionDataQuery( From 478d277c0ac5527c92a7d89aa17a18bab138246c Mon Sep 17 00:00:00 2001 From: mortezaei Date: Tue, 25 Aug 2026 13:59:03 +0330 Subject: [PATCH 03/21] fix sheet --- src/components/Componentes/currency-sheet.tsx | 4 +- .../Componentes/question-birthplace.tsx | 11 ++- .../Componentes/question-checkbox.tsx | 78 ++++++++++++++++++- .../Componentes/question-date-sheet.tsx | 4 +- .../Componentes/question-date.test.tsx | 22 ++++++ src/components/Componentes/question-phone.tsx | 4 +- .../Componentes/question-renderer.tsx | 16 ++++ .../Componentes/question-sheet.test.tsx | 48 ++++++++++++ src/components/Componentes/question-sheet.tsx | 4 +- 9 files changed, 178 insertions(+), 13 deletions(-) diff --git a/src/components/Componentes/currency-sheet.tsx b/src/components/Componentes/currency-sheet.tsx index 22d00ad..766d83f 100644 --- a/src/components/Componentes/currency-sheet.tsx +++ b/src/components/Componentes/currency-sheet.tsx @@ -148,8 +148,8 @@ export function CurrencySheet({ ].join(" ")} > {/* Header */} -
-

+
+

{sheetTitle}