feat: document contextual and temporal help

This commit is contained in:
2026-08-05 00:03:32 +02:00
parent 1f50505305
commit 2d18ecc9b6
3 changed files with 77 additions and 4 deletions
+6 -3
View File
@@ -857,9 +857,12 @@ function selectedPageFromSearch(search: string, pages: DocsPageNode[]): DocsPage
if (requested) return pages.find((page) => page.id === requested) ?? pages[0];
const helpContext = params.get("context") || "";
if (helpContext) {
const exact = pages.find((page) => page.kind === "topic" && metadataList(page.topic.metadata, "help_contexts").includes(helpContext));
if (exact) return exact;
const moduleId = helpContextModuleId(helpContext);
const fallbackContext = params.get("fallback_context") || "";
for (const contextId of [helpContext, fallbackContext].filter(Boolean)) {
const exact = pages.find((page) => page.kind === "topic" && metadataList(page.topic.metadata, "help_contexts").includes(contextId));
if (exact) return exact;
}
const moduleId = params.get("module") || helpContextModuleId(fallbackContext || helpContext);
const moduleTopic = pages.find((page) => page.kind === "topic" && page.topic.source_module_id === moduleId);
if (moduleTopic) return moduleTopic;
}