feat(layouts): add OrganizerLayoutV2 + AppShellV2 skeleton
Tailwind-grid shell skeleton with named slot regions (sidebar, topbar, default, drawer). OrganizerLayoutV2 wires the skeleton with RouterView, selectable via definePage meta. Vitest component mount test: 2 tests pass. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
26
apps/app/src/layouts/OrganizerLayoutV2.vue
Normal file
26
apps/app/src/layouts/OrganizerLayoutV2.vue
Normal file
@@ -0,0 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
// OrganizerLayoutV2 — v2 layout file selected by
|
||||
// definePage({ meta: { layout: 'OrganizerLayoutV2' } }) on pages-v2/**
|
||||
// (RFC-WS-GUI-REDESIGN AD-G2). Plan 1: wires the skeleton + RouterView.
|
||||
// A later plan fills the sidebar/topbar/drawer slots with ported
|
||||
// PrimeVue shell pieces.
|
||||
import AppShellV2 from '@/layouts/components/AppShellV2.vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppShellV2>
|
||||
<template #sidebar>
|
||||
<nav class="w-72 border-r border-surface-200 p-4 dark:border-surface-800">
|
||||
<span class="text-sm text-surface-500">Crewli v2</span>
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
<template #topbar>
|
||||
<header class="flex h-14 items-center border-b border-surface-200 px-6 dark:border-surface-800">
|
||||
<span class="text-sm text-surface-500">v2 shell (skeleton)</span>
|
||||
</header>
|
||||
</template>
|
||||
|
||||
<RouterView />
|
||||
</AppShellV2>
|
||||
</template>
|
||||
44
apps/app/src/layouts/components/AppShellV2.vue
Normal file
44
apps/app/src/layouts/components/AppShellV2.vue
Normal file
@@ -0,0 +1,44 @@
|
||||
<script setup lang="ts">
|
||||
// AppShellV2 — Tailwind-grid SKELETON (RFC-WS-GUI-REDESIGN AD-G2/G3,
|
||||
// Plan 1). Named slot regions; PrimeVue shell pieces (AppSidebar,
|
||||
// AppTopbar, WorkspaceSwitcher, RightDrawer) are injected via slots in
|
||||
// a later plan. Outer container is intentionally custom Tailwind (no
|
||||
// PrimeVue equivalent for a permanent rail), matching crewli-starter `.app`.
|
||||
|
||||
import { computed, onMounted, watch } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useShellUiStore } from '@/stores/useShellUiStore'
|
||||
|
||||
const shell = useShellUiStore()
|
||||
const { sidebarCollapsed } = storeToRefs(shell)
|
||||
|
||||
const rootClass = computed(() => ({ 'is-collapsed': sidebarCollapsed.value }))
|
||||
|
||||
onMounted(() => shell.applyDomAttributes())
|
||||
watch(
|
||||
() => [shell.theme, shell.density],
|
||||
() => shell.applyDomAttributes(),
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
data-testid="appshell-v2"
|
||||
class="grid min-h-screen grid-cols-[auto_1fr]"
|
||||
:class="rootClass"
|
||||
>
|
||||
<div class="row-span-2">
|
||||
<slot name="sidebar" />
|
||||
</div>
|
||||
|
||||
<div class="flex min-h-screen flex-col">
|
||||
<slot name="topbar" />
|
||||
|
||||
<main class="flex-1 overflow-auto p-6">
|
||||
<slot />
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<slot name="drawer" />
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user