Kairo-Jinkendo/frontend/src/plan/planOutlineNodes.js
Lars bbadf22d39
All checks were successful
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Successful in 2m4s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 13s
AP1.12a: Plan-Outline-Shell ersetzt Untertabs im Planen-Modus.
Linke Outline mit Profil, Struktur, Zielzuständen und Eingang; Portfolio-Einstieg ohne Scope; Vorhabens-Profil als Read-only-Vorschau.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-09 11:16:42 +02:00

35 lines
1.1 KiB
JavaScript

/**
* 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 },
{
key: 'work',
to: '/plan/work',
label: 'Arbeit',
requiresInitiative: true,
disabled: true,
hint: 'AP1.12 — Actions im Plan-Kontext',
},
]
/**
* @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
}