From ad545b52af56f8e0293ff26e5afe805b3efb1d3d Mon Sep 17 00:00:00 2001 From: Archicratia Date: Sun, 26 Apr 2026 21:32:07 +0200 Subject: [PATCH] refactor(glossaire): stabiliser le moteur de navigation intelligente --- src/lib/glossary.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/lib/glossary.ts b/src/lib/glossary.ts index 88d8405..0d64e49 100644 --- a/src/lib/glossary.ts +++ b/src/lib/glossary.ts @@ -510,13 +510,19 @@ export function getGlossarySmartNavigation( ): GlossarySmartNavigation { const currentSlug = slugOfGlossaryEntry(currentEntry); const rawNavigation = currentEntry.data.navigation; - const defaultNavigation = GLOSSARY_NAV_DEFAULTS[familyOf(currentEntry)]; + const defaultNavigation = GLOSSARY_NAV_DEFAULTS[familyOf(currentEntry)] ?? {}; - const navigationSource = rawNavigation ?? { - primaryNext: undefined, - primaryReason: undefined, - paths: defaultNavigation ?? {}, - flows: {}, + const navigationSource = { + primaryNext: rawNavigation?.primaryNext, + primaryReason: rawNavigation?.primaryReason, + paths: { + understand: rawNavigation?.paths?.understand ?? defaultNavigation.understand ?? [], + deepen: rawNavigation?.paths?.deepen ?? defaultNavigation.deepen ?? [], + compare: rawNavigation?.paths?.compare ?? defaultNavigation.compare ?? [], + apply: rawNavigation?.paths?.apply ?? defaultNavigation.apply ?? [], + }, + flows: rawNavigation?.flows ?? {}, + relationWeights: rawNavigation?.relationWeights ?? {}, }; const primaryNext = resolveGlossaryEntriesInSourceOrder( -- 2.49.1