From 36bb47f9c633afea574691c2a64e0c11dc315a32 Mon Sep 17 00:00:00 2001 From: Archicratia Date: Sun, 26 Apr 2026 21:47:30 +0200 Subject: [PATCH] =?UTF-8?q?fix(glossaire):=20pr=C3=A9server=20les=20parcou?= =?UTF-8?q?rs=20intelligents=20explicites?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/glossary.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/lib/glossary.ts b/src/lib/glossary.ts index 0d64e49..eaf5af4 100644 --- a/src/lib/glossary.ts +++ b/src/lib/glossary.ts @@ -512,14 +512,19 @@ export function getGlossarySmartNavigation( const rawNavigation = currentEntry.data.navigation; const defaultNavigation = GLOSSARY_NAV_DEFAULTS[familyOf(currentEntry)] ?? {}; + const withDefaultPath = ( + explicit: string[] | undefined, + fallback: string[] | undefined, + ): string[] => (explicit && explicit.length > 0 ? explicit : fallback ?? []); + 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 ?? [], + understand: withDefaultPath(rawNavigation?.paths?.understand, defaultNavigation.understand), + deepen: withDefaultPath(rawNavigation?.paths?.deepen, defaultNavigation.deepen), + compare: withDefaultPath(rawNavigation?.paths?.compare, defaultNavigation.compare), + apply: withDefaultPath(rawNavigation?.paths?.apply, defaultNavigation.apply), }, flows: rawNavigation?.flows ?? {}, relationWeights: rawNavigation?.relationWeights ?? {}, -- 2.49.1