feat: sync button now syncs all tabs — macro slide, main tab, signaux slide

When sync is active, clicking any tab/indicator on any card propagates
to all other cards (overview/mispricing/focus + ois/cot/sent + mon/infl/cro/empl).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
caty21
2026-06-27 16:40:35 +02:00
parent b82c680f83
commit bcc30ed5ba
2 changed files with 40 additions and 4 deletions
+8 -2
View File
@@ -46,8 +46,10 @@ export default function Dashboard() {
const [comparisonSection, setComparisonSection] = useState<Exclude<MacroSection,"all">>("inflation");
const [comparisonCurrencies, setComparisonCurrencies] = useState<Currency[] | "all">("all");
const [focusCurrency, setFocusCurrency] = useState<Currency | "all">("all");
const [globalMacroSlide, setGlobalMacroSlide] = useState<"mon"|"infl"|"cro"|"empl">("mon");
const [macroSyncEnabled, setMacroSyncEnabled] = useState(false);
const [globalMacroSlide, setGlobalMacroSlide] = useState<"mon"|"infl"|"cro"|"empl">("mon");
const [globalCardTab, setGlobalCardTab] = useState<"overview"|"mispricing"|"focus">("overview");
const [globalSignauxSlide, setGlobalSignauxSlide] = useState<"ois"|"cot"|"sent">("ois");
const [macroSyncEnabled, setMacroSyncEnabled] = useState(false);
// ── Sentiment multi-paires Myfxbook → {CCY: {longPct, shortPct, pair}} ──────
// Pour chaque devise, on calcule le % "long CCY" en moyenne pondérée (par volume)
@@ -585,6 +587,10 @@ export default function Dashboard() {
macroSection={macroSection}
syncMacroSlide={macroSyncEnabled ? globalMacroSlide : undefined}
onMacroSlideChange={macroSyncEnabled ? setGlobalMacroSlide : undefined}
syncCardTab={macroSyncEnabled ? globalCardTab : undefined}
onCardTabChange={macroSyncEnabled ? (setGlobalCardTab as (id: "overview"|"mispricing"|"focus") => void) : undefined}
syncSignauxSlide={macroSyncEnabled ? globalSignauxSlide : undefined}
onSignauxSlideChange={macroSyncEnabled ? setGlobalSignauxSlide : undefined}
/>
))}
</div>