AI-native design editor. Open-source Figma alternative.
Use sceneVersion instead of renderVersion for UI panels
Danila Poyarkov8eff364dcd26
diff --git a/src/components/CanvasContextMenu.vue b/src/components/CanvasContextMenu.vueindex f3d13d056..dc012cedc 100644--- a/src/components/CanvasContextMenu.vue+++ b/src/components/CanvasContextMenu.vue@@ -17,19 +17,19 @@ import { useEditorStore } from '@/stores/editor'const store = useEditorStore()const hasSelection = computed(() => {- void store.state.renderVersion+ void store.state.sceneVersionreturn store.state.selectedIds.size > 0})const singleNode = computed(() => {- void store.state.renderVersion+ void store.state.sceneVersionif (store.state.selectedIds.size !== 1) return nullconst id = [...store.state.selectedIds][0]return store.graph.getNode(id) ?? null})const multiCount = computed(() => {- void store.state.renderVersion+ void store.state.sceneVersionreturn store.state.selectedIds.size})@@ -38,7 +38,7 @@ const isComponent = computed(() => singleNode.value?.type === 'COMPONENT')const isGroup = computed(() => singleNode.value?.type === 'GROUP')const canCreateComponentSet = computed(() => {- void store.state.renderVersion+ void store.state.sceneVersionif (store.state.selectedIds.size < 2) return falsereturn [...store.state.selectedIds].every((id) => {const n = store.graph.getNode(id)@@ -47,18 +47,18 @@ const canCreateComponentSet = computed(() => {})const otherPages = computed(() => {- void store.state.renderVersion+ void store.state.sceneVersionreturn store.graph.getPages().filter((p) => p.id !== store.state.currentPageId)})const isVisible = computed(() => {- void store.state.renderVersion+ void store.state.sceneVersionif (!singleNode.value) return truereturn singleNode.value.visible})const isLocked = computed(() => {- void store.state.renderVersion+ void store.state.sceneVersionif (!singleNode.value) return falsereturn singleNode.value.locked})diff --git a/src/components/LayersPanel.vue b/src/components/LayersPanel.vueindex b30997ef3..0086779a8 100644--- a/src/components/LayersPanel.vue+++ b/src/components/LayersPanel.vue@@ -62,7 +62,7 @@ function buildTree(parentId: string): LayerNode[] {const items = ref(buildTree(store.state.currentPageId))const treeKey = ref(0)-watch([() => store.state.renderVersion, () => store.state.currentPageId], () => {+watch([() => store.state.sceneVersion, () => store.state.currentPageId], () => {items.value = buildTree(store.state.currentPageId)treeKey.value++})diff --git a/src/components/PagesPanel.vue b/src/components/PagesPanel.vueindex a82ea2bbe..be7d7e985 100644--- a/src/components/PagesPanel.vue+++ b/src/components/PagesPanel.vue@@ -6,7 +6,7 @@ import { useEditorStore } from '@/stores/editor'const store = useEditorStore()const pages = computed(() => {- void store.state.renderVersion+ void store.state.sceneVersionreturn store.graph.getPages()})diff --git a/src/stores/editor.ts b/src/stores/editor.tsindex 9d1d061f8..abf9aa297 100644--- a/src/stores/editor.ts+++ b/src/stores/editor.ts@@ -156,7 +156,7 @@ export function createEditorStore() {})const selectedNodes = computed(() => {- void state.renderVersion+ void state.sceneVersionconst nodes: SceneNode[] = []for (const id of state.selectedIds) {const n = graph.getNode(id)@@ -170,7 +170,7 @@ export function createEditorStore() {)const layerTree = computed(() => {- void state.renderVersion+ void state.sceneVersionreturn graph.flattenTree(state.currentPageId)})