feat(layout): Plan 2.5 P1 foundation — APP_NAVIGATION + walkNavTree + AppBreadcrumb
Per RFC-WS-PRIMEVUE-PLAN-2-5 §8 step 1. Foundation scaffolding only — no shell fixes, no Public Sans removal, no useShellUiStore changes (P2–P6 scope). Implements: - theme darkModeSelector verified at '.dark' (already correct in plugins/primevue/index.ts — config site is here, not theme.ts). - src/config/navigation.ts: APP_NAVIGATION registry per AD-2.5-B1 (Dashboard entry only — v2-dashboard is the only v2 route today). - src/composables/useBreadcrumb.ts: walkNavTree pure helper + useNavBreadcrumb composable per AD-2.5-B1. The legacy meta-based useBreadcrumb is preserved (consumed by AppTopbar, P1 may not touch AppTopbar); P4 retires it and renames useNavBreadcrumb. - src/components-v2/layout/AppBreadcrumb.vue: layout primitive wrapping PrimeVue Breadcrumb, consuming useNavBreadcrumb. - Tests: walkNavTree (4 specs, co-located), AppBreadcrumb mount (2 specs, tests/component/layouts/). Suite 564 → 570 (+6, all new specs green). vue-tsc clean. Scoped ESLint clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
53
apps/app/src/components-v2/layout/AppBreadcrumb.vue
Normal file
53
apps/app/src/components-v2/layout/AppBreadcrumb.vue
Normal file
@@ -0,0 +1,53 @@
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* AppBreadcrumb — layout primitive per RFC-WS-PRIMEVUE-PLAN-2-5 AD-2.5-B1.
|
||||
*
|
||||
* Consumes `useNavBreadcrumb` (registry-driven; data derives from
|
||||
* APP_NAVIGATION + the current route name). Wired into AppTopbar in P5
|
||||
* (RFC §5.2 Fix 2) — standalone in P1.
|
||||
*
|
||||
* Naming note: imports `useNavBreadcrumb` (not the literal `useBreadcrumb`
|
||||
* the AD specifies) because the legacy meta-based `useBreadcrumb` is still
|
||||
* consumed by AppTopbar; P1 may not touch AppTopbar (P4–P6 scope). P4
|
||||
* retires the legacy API and renames `useNavBreadcrumb` → `useBreadcrumb`.
|
||||
*/
|
||||
|
||||
import { computed } from 'vue'
|
||||
import Breadcrumb from 'primevue/breadcrumb'
|
||||
import { useNavBreadcrumb } from '@/composables/useBreadcrumb'
|
||||
|
||||
const crumbs = useNavBreadcrumb()
|
||||
|
||||
const items = computed(() =>
|
||||
crumbs.value.map(c => ({
|
||||
label: c.label,
|
||||
route: c.routeName ? { name: c.routeName } : undefined,
|
||||
})),
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Breadcrumb
|
||||
:model="items"
|
||||
:pt="{
|
||||
root: { class: 'border-none p-0 bg-transparent' },
|
||||
list: { class: 'gap-1' },
|
||||
}"
|
||||
>
|
||||
<template #item="{ item }">
|
||||
<RouterLink
|
||||
v-if="item.route"
|
||||
:to="item.route"
|
||||
class="text-sm text-surface-600 hover:text-surface-900 dark:text-surface-400 dark:hover:text-surface-100 transition-colors"
|
||||
>
|
||||
{{ item.label }}
|
||||
</RouterLink>
|
||||
<span
|
||||
v-else
|
||||
class="text-sm font-medium text-surface-900 dark:text-surface-100"
|
||||
>
|
||||
{{ item.label }}
|
||||
</span>
|
||||
</template>
|
||||
</Breadcrumb>
|
||||
</template>
|
||||
Reference in New Issue
Block a user