From 73b2dea363ef23e71529ae35aa3da708da2d9df4 Mon Sep 17 00:00:00 2001 From: "bert.hausmans" Date: Sat, 16 May 2026 11:44:42 +0200 Subject: [PATCH] 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 --- apps/app/src/layouts/OrganizerLayoutV2.vue | 26 +++++++++++ .../app/src/layouts/components/AppShellV2.vue | 44 +++++++++++++++++++ .../component/layouts/AppShellV2.spec.ts | 34 ++++++++++++++ 3 files changed, 104 insertions(+) create mode 100644 apps/app/src/layouts/OrganizerLayoutV2.vue create mode 100644 apps/app/src/layouts/components/AppShellV2.vue create mode 100644 apps/app/tests/component/layouts/AppShellV2.spec.ts diff --git a/apps/app/src/layouts/OrganizerLayoutV2.vue b/apps/app/src/layouts/OrganizerLayoutV2.vue new file mode 100644 index 00000000..9f9970d3 --- /dev/null +++ b/apps/app/src/layouts/OrganizerLayoutV2.vue @@ -0,0 +1,26 @@ + + + diff --git a/apps/app/src/layouts/components/AppShellV2.vue b/apps/app/src/layouts/components/AppShellV2.vue new file mode 100644 index 00000000..628f8fb1 --- /dev/null +++ b/apps/app/src/layouts/components/AppShellV2.vue @@ -0,0 +1,44 @@ + + + diff --git a/apps/app/tests/component/layouts/AppShellV2.spec.ts b/apps/app/tests/component/layouts/AppShellV2.spec.ts new file mode 100644 index 00000000..012db098 --- /dev/null +++ b/apps/app/tests/component/layouts/AppShellV2.spec.ts @@ -0,0 +1,34 @@ +import { describe, expect, it } from 'vitest' +import { mount } from '@vue/test-utils' +import { createPinia } from 'pinia' +import AppShellV2 from '@/layouts/components/AppShellV2.vue' + +describe('AppShellV2 (skeleton)', () => { + it('renders the grid regions and default slot content', () => { + const wrapper = mount(AppShellV2, { + global: { plugins: [createPinia()] }, + slots: { + sidebar: '', + topbar: '
TB
', + default: '
CONTENT
', + drawer: '', + }, + }) + + expect(wrapper.find('[data-testid="appshell-v2"]').exists()).toBe(true) + expect(wrapper.find('[data-testid="sb"]').exists()).toBe(true) + expect(wrapper.find('[data-testid="tb"]').exists()).toBe(true) + expect(wrapper.find('[data-testid="content"]').text()).toBe('CONTENT') + expect(wrapper.find('[data-testid="dr"]').exists()).toBe(true) + }) + + it('applies the collapsed modifier from useShellUiStore', async () => { + const pinia = createPinia() + const wrapper = mount(AppShellV2, { global: { plugins: [pinia] } }) + const { useShellUiStore } = await import('@/stores/useShellUiStore') + + useShellUiStore().toggleSidebar() + await wrapper.vm.$nextTick() + expect(wrapper.find('[data-testid="appshell-v2"]').classes()).toContain('is-collapsed') + }) +})