feat(layout): Plan 2.5 P4 — WorkspaceSwitcher no-sub + SidebarNav APP_NAVIGATION
Per RFC-WS-PRIMEVUE-PLAN-2-5 §4 AD-2.5-W1 and AD-2.5-B1, §5.4 Fix 4. Changes: - WorkspaceSwitcher: sub field removed from template, WorkspaceDisplay type, and buildDisplay derivation. Stories did not carry sub args (auto-derived from seeded org.role); no WithSub story existed. New regression spec (WorkspaceSwitcher.spec.ts) locks the no-sub render. - SidebarNav: now consumes APP_NAVIGATION from src/config/navigation.ts as the single source of truth (shared with breadcrumb derivation in useNavBreadcrumb). The groups: V2NavGroup[] prop is removed; render walks top-level NavItems (branch nodes render label-heading + children; leaf nodes render as rows; items without routeName render as non-clickable dormant placeholders). Previous nav data source: groups prop fed by useV2Nav(orgNavItems) in OrganizerLayoutV2. - APP_NAVIGATION expanded with 7 entries to preserve visual sidebar continuity (Evenementen at top-level + Beheer branch with 5 children). All new entries use routeName: undefined until the corresponding v2 page lands (TODOs noted per entry); only Dashboard maps to v2-dashboard. - AppSidebar: groups prop removed; passes only :collapsed to SidebarNav. - OrganizerLayoutV2: useV2Nav(orgNavItems) plumbing retired; the layout now renders <AppSidebar /> with no nav-data wiring. - Tests: AppSidebar.spec drops the "passes groups prop to SidebarNav" assertion; OrganizerLayoutV2.spec drops the "forwards orgNavItems" assertion. New WorkspaceSwitcher no-sub regression spec (+2 tests). - Storybook: SidebarNav.stories and AppSidebar.stories updated to no longer thread navFixture/groups; WithActiveItem pushes v2-dashboard. Position of WorkspaceSwitcher (Fix 3), workspace dropdown panel (Fix 5), and AppBreadcrumb wiring (Fix 2) remain unchanged in P4 — both lands in P5. The legacy useBreadcrumb composable also remains untouched until P5 (atomic with AppTopbar refactor). Orphans flagged for follow-up cleanup (intentionally not deleted in P4): useV2Nav composable + spec, V2NavGroup/V2NavItem types, sidebarNavActive helper + spec, navFixture in stories/v2/_helpers.ts. Suite delta: 575 → 575 (+2 WorkspaceSwitcher no-sub spec, -1 AppSidebar groups-prop assertion, -1 OrganizerLayoutV2 groups-forward assertion). vue-tsc clean. Scoped ESLint clean (0 errors). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,8 +19,11 @@
|
||||
* teleported overlay. By unmounting on desktop we guarantee no modal backdrop /
|
||||
* focus-trapped dialog can appear on wide viewports regardless of mobileOpen state.
|
||||
*
|
||||
* nav groups arrive as a prop — this file must NOT import @/navigation directly
|
||||
* (components-v2 import boundary; the layout page supplies nav data).
|
||||
* Nav data: as of Plan 2.5 P4, SidebarNav reads APP_NAVIGATION from
|
||||
* @/config/navigation directly — no prop is threaded through AppSidebar.
|
||||
* The components-v2 import boundary still applies to @/navigation (the v1
|
||||
* source), but @/config/navigation is the unclassified central registry
|
||||
* and is consumed in-place by SidebarNav.
|
||||
*
|
||||
* Deliberate simplification: crewli-starter's bespoke Teleport tooltip (shown in
|
||||
* collapsed mode for nav items) is NOT ported here. SidebarNav already provides
|
||||
@@ -41,19 +44,10 @@ import { computed } from 'vue'
|
||||
import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'
|
||||
import Drawer from 'primevue/drawer'
|
||||
import { useShellUiStore } from '@/stores/useShellUiStore'
|
||||
import type { V2NavGroup } from '@/types/v2/nav'
|
||||
import SidebarHeader from '@/components-v2/layout/SidebarHeader.vue'
|
||||
import SidebarNav from '@/components-v2/layout/SidebarNav.vue'
|
||||
import WorkspaceSwitcher from '@/components-v2/layout/WorkspaceSwitcher.vue'
|
||||
|
||||
defineProps<{
|
||||
/**
|
||||
* Nav groups passed in from the layout — components-v2 files may NOT
|
||||
* import from @/navigation; the parent layout supplies this.
|
||||
*/
|
||||
groups: V2NavGroup[]
|
||||
}>()
|
||||
|
||||
const shell = useShellUiStore()
|
||||
|
||||
// Shared breakpoint signal — must match SidebarHeader and the CSS `lg:` boundary (1024px).
|
||||
@@ -84,10 +78,7 @@ const mobileVisible = computed<boolean>({
|
||||
:class="shell.sidebarCollapsed ? 'w-16' : 'w-64'"
|
||||
>
|
||||
<SidebarHeader />
|
||||
<SidebarNav
|
||||
:groups="groups"
|
||||
:collapsed="shell.sidebarCollapsed"
|
||||
/>
|
||||
<SidebarNav :collapsed="shell.sidebarCollapsed" />
|
||||
<WorkspaceSwitcher :collapsed="shell.sidebarCollapsed" />
|
||||
</aside>
|
||||
|
||||
@@ -119,10 +110,7 @@ const mobileVisible = computed<boolean>({
|
||||
}"
|
||||
>
|
||||
<SidebarHeader />
|
||||
<SidebarNav
|
||||
:groups="groups"
|
||||
:collapsed="false"
|
||||
/>
|
||||
<SidebarNav :collapsed="false" />
|
||||
<WorkspaceSwitcher :collapsed="false" />
|
||||
</Drawer>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user