From 05e747f84e38359b81fc425c0fe4d134ee376b57 Mon Sep 17 00:00:00 2001 From: 732642856 <732642856@qq.com> Date: Fri, 17 Jul 2026 17:16:18 +0800 Subject: [PATCH] Draft synastry questions from chart library --- frontend/src/app/page.tsx | 16 ++++++++++++++++ tests/test_supabase_user_data_contract.py | 3 +++ 2 files changed, 19 insertions(+) diff --git a/frontend/src/app/page.tsx b/frontend/src/app/page.tsx index 44c730bd..ec32933f 100644 --- a/frontend/src/app/page.tsx +++ b/frontend/src/app/page.tsx @@ -245,6 +245,15 @@ function profilePlaceLabel(profile: Profile) { return selectedBirthPlace(profile)?.label || "地点未完整"; } +function buildSynastryQuestion(selfProfile: Profile, partnerProfile: Profile) { + return [ + `请用印度占星合盘分析我和${partnerProfile.name || "对方"}的关系。`, + `我的资料:${selfProfile.name || "本人"},${selfProfile.date} ${selfProfile.time},${profilePlaceLabel(selfProfile)}。`, + `对方资料:${partnerProfile.name || "对方"},${partnerProfile.date} ${partnerProfile.time},${profilePlaceLabel(partnerProfile)}。`, + "请先说明会使用哪些证据层,再分析关系模式、冲突点、适合发展的方式和需要谨慎的时间窗口。", + ].join("\n"); +} + function missingProfileStep(profile: Profile): OnboardingStep | null { if (!profile.name.trim()) return "name"; if (!profile.date || !profile.time) return "birth"; @@ -1238,6 +1247,12 @@ export default function Home() { window.requestAnimationFrame(() => composerInput.current?.focus()); } + function draftSynastryQuestionFromChart(record: ChartLibraryRecord) { + if (record.role !== "other") return; + chooseSuggestedQuestion(buildSynastryQuestion(profile, record.profile), "marriage"); + setProfileOpen(false); + } + async function requestCancellation(requestId: string) { const existing = cancellationRequests.current.get(requestId); if (existing) return existing; @@ -1935,6 +1950,7 @@ export default function Home() { {record.profile.date} {record.profile.time} · {profilePlaceLabel(record.profile)}
+
diff --git a/tests/test_supabase_user_data_contract.py b/tests/test_supabase_user_data_contract.py index ffc0b79c..188156d3 100644 --- a/tests/test_supabase_user_data_contract.py +++ b/tests/test_supabase_user_data_contract.py @@ -140,10 +140,13 @@ def test_chart_profile_library_has_cloud_table_api_and_local_fallback() -> None: "fetchCloudChartLibrary", "saveCloudChartProfile", "deleteCloudChartProfile", + "buildSynastryQuestion", + "draftSynastryQuestionFromChart", "chartLibraryStorageKey", "Cloud chart library is best-effort", "星盘库", "添加其他星盘", + "用于合盘", "设为默认", ): assert token in page