2026-07-09 11:16:42 +02:00
|
|
|
/**
|
|
|
|
|
* Top-level Plan-Outline-Knoten (AP1.12a).
|
|
|
|
|
* Unterknoten (Projekt-Baum, Gate-Graph) folgen in AP1.12b+.
|
|
|
|
|
*
|
|
|
|
|
* @typedef {{ key: string, to: string, label: string, requiresInitiative?: boolean, disabled?: boolean, hint?: string }} PlanOutlineNode
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/** @type {PlanOutlineNode[]} */
|
|
|
|
|
export const PLAN_OUTLINE_NODES = [
|
|
|
|
|
{ key: 'profile', to: '/plan/profile', label: 'Profil', requiresInitiative: true },
|
|
|
|
|
{ key: 'structure', to: '/plan/structure', label: 'Struktur', requiresInitiative: true },
|
|
|
|
|
{ key: 'gates', to: '/plan/gates', label: 'Zielzustände', requiresInitiative: true },
|
|
|
|
|
{ key: 'inbox', to: '/plan/inbox', label: 'Eingang', requiresInitiative: true },
|
2026-07-09 11:38:17 +02:00
|
|
|
{ key: 'work', to: '/plan/work', label: 'Arbeit', requiresInitiative: true },
|
2026-07-09 11:16:42 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param {string} pathname
|
|
|
|
|
* @returns {string | null}
|
|
|
|
|
*/
|
|
|
|
|
export function resolvePlanOutlineActiveKey(pathname) {
|
|
|
|
|
const path = pathname.replace(/\/$/, '') || pathname
|
|
|
|
|
const match = PLAN_OUTLINE_NODES.find(
|
|
|
|
|
(node) => path === node.to || path.startsWith(`${node.to}/`),
|
|
|
|
|
)
|
|
|
|
|
return match?.key ?? null
|
|
|
|
|
}
|