fix(glossaire): préserver les parcours intelligents explicites #331

Merged
Archicratia merged 1 commits from feat/glossary-navigation-step24b into main 2026-04-26 19:54:00 +00:00

View File

@@ -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 ?? {},