diff --git a/.gitignore b/.gitignore index 954717375..50025f26c 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,5 @@ public/canvaskit.wasm *.sln *.sw? test-results/ +# Git worktrees for parallel agent work +.worktrees/ diff --git a/components.d.ts b/components.d.ts index 91f602130..be8db16f6 100644 --- a/components.d.ts +++ b/components.d.ts @@ -32,6 +32,7 @@ declare module 'vue' { IconLucideChevronRight: typeof import('~icons/lucide/chevron-right')['default'] IconLucideEye: typeof import('~icons/lucide/eye')['default'] IconLucideEyeOff: typeof import('~icons/lucide/eye-off')['default'] + IconLucideFile: typeof import('~icons/lucide/file')['default'] IconLucideFlipHorizontal: typeof import('~icons/lucide/flip-horizontal')['default'] IconLucideFlipVertical: typeof import('~icons/lucide/flip-vertical')['default'] IconLucideRadius: typeof import('~icons/lucide/radius')['default'] diff --git a/src/components/LayersPanel.vue b/src/components/LayersPanel.vue index 928a369b0..dfd923d3d 100644 --- a/src/components/LayersPanel.vue +++ b/src/components/LayersPanel.vue @@ -48,17 +48,22 @@ function buildTree(parentId: string): LayerNode[] { })) } -const items = ref(buildTree(store.graph.rootId)) +const items = ref(buildTree(store.state.currentPageId)) const treeKey = ref(0) watch( - () => store.state.renderVersion, + [() => store.state.renderVersion, () => store.state.currentPageId], () => { - items.value = buildTree(store.graph.rootId) + items.value = buildTree(store.state.currentPageId) treeKey.value++ } ) +const pages = computed(() => { + void store.state.renderVersion + return store.graph.getPages() +}) + const expanded = ref([]) function onSelect(ev: CustomEvent) { @@ -71,6 +76,13 @@ function onSelect(ev: CustomEvent) { } } +function renamePage(pageId: string, currentName: string) { + const name = prompt('Rename page', currentName) + if (name && name !== currentName) { + store.renamePage(pageId, name) + } +} + function toggleExpand(id: string) { const idx = expanded.value.indexOf(id) if (idx >= 0) { @@ -201,6 +213,30 @@ function updateDropTarget(ev: PointerEvent) {