AP1.12a: Plan-Outline mit Projektbaum unter Struktur.
Deploy Development / deploy (push) Successful in 51s
Test Suite / pytest-backend (push) Successful in 2m7s
Test Suite / lint-backend (push) Successful in 3s
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 12s
Deploy Development / deploy (push) Successful in 51s
Test Suite / pytest-backend (push) Successful in 2m7s
Test Suite / lint-backend (push) Successful in 3s
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 12s
Linke Outline zeigt rekursive Projects im Scope; Deep-Links zu /projects/:id markieren Struktur aktiv. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
5e2ae9de31
commit
bcf6f83813
4 files changed
+159
-11
No files matched your search
@@ -20,8 +20,20 @@ export const PLAN_OUTLINE_NODES = [
|
||||
*/
|
||||
export function resolvePlanOutlineActiveKey(pathname) {
|
||||
const path = pathname.replace(/\/$/, '') || pathname
|
||||
if (path.startsWith('/projects/')) {
|
||||
return 'structure'
|
||||
}
|
||||
const match = PLAN_OUTLINE_NODES.find(
|
||||
(node) => path === node.to || path.startsWith(`${node.to}/`),
|
||||
)
|
||||
return match?.key ?? null
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} pathname
|
||||
* @returns {string | null}
|
||||
*/
|
||||
export function resolvePlanOutlineProjectId(pathname) {
|
||||
const match = (pathname || '').match(/^\/projects\/([^/?]+)/)
|
||||
return match?.[1] ?? null
|
||||
}
|
||||
@@ -19,5 +19,6 @@ describe('planOutlineNodes', () => {
|
||||
expect(resolvePlanOutlineActiveKey('/plan/inbox')).toBe('inbox')
|
||||
expect(resolvePlanOutlineActiveKey('/plan/work')).toBe('work')
|
||||
expect(resolvePlanOutlineActiveKey('/plan/portfolio')).toBe(null)
|
||||
expect(resolvePlanOutlineActiveKey('/projects/abc-123')).toBe('structure')
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user