From 5697f2273e421829485d52eeff2e0a9622341e2b Mon Sep 17 00:00:00 2001 From: SpliiT Date: Mon, 13 Apr 2026 14:48:13 +0200 Subject: [PATCH 01/31] feat(MultipleTreeview): Add a new system for objects tree, multiple trees --- app/components/Viewer/BreadCrumb.vue | 49 --- .../Viewer/ObjectTree/Base/Controls.vue | 58 ++++ .../Viewer/ObjectTree/Base/ItemLabel.vue | 44 +++ app/components/Viewer/ObjectTree/Box.vue | 49 +++ app/components/Viewer/ObjectTree/Layout.vue | 289 ++++++++++++++++++ .../ObjectTree/Views/GlobalObjectsView.vue | 95 ++++++ .../ObjectTree/Views/ModelComponentsView.vue | 91 ++++++ app/components/Viewer/Tree/ObjectTree.vue | 132 -------- app/components/Viewer/TreeComponent.vue | 170 ----------- app/components/Viewer/TreeObject.vue | 184 ----------- app/components/Viewer/Ui.vue | 12 +- app/composables/useTreeFilter.js | 70 +++++ app/stores/treeview.js | 60 ++-- 13 files changed, 732 insertions(+), 571 deletions(-) delete mode 100644 app/components/Viewer/BreadCrumb.vue create mode 100644 app/components/Viewer/ObjectTree/Base/Controls.vue create mode 100644 app/components/Viewer/ObjectTree/Base/ItemLabel.vue create mode 100644 app/components/Viewer/ObjectTree/Box.vue create mode 100644 app/components/Viewer/ObjectTree/Layout.vue create mode 100644 app/components/Viewer/ObjectTree/Views/GlobalObjectsView.vue create mode 100644 app/components/Viewer/ObjectTree/Views/ModelComponentsView.vue delete mode 100644 app/components/Viewer/Tree/ObjectTree.vue delete mode 100644 app/components/Viewer/TreeComponent.vue delete mode 100644 app/components/Viewer/TreeObject.vue create mode 100644 app/composables/useTreeFilter.js diff --git a/app/components/Viewer/BreadCrumb.vue b/app/components/Viewer/BreadCrumb.vue deleted file mode 100644 index cfd83957..00000000 --- a/app/components/Viewer/BreadCrumb.vue +++ /dev/null @@ -1,49 +0,0 @@ - - - - - diff --git a/app/components/Viewer/ObjectTree/Base/Controls.vue b/app/components/Viewer/ObjectTree/Base/Controls.vue new file mode 100644 index 00000000..b04360f8 --- /dev/null +++ b/app/components/Viewer/ObjectTree/Base/Controls.vue @@ -0,0 +1,58 @@ + + + diff --git a/app/components/Viewer/ObjectTree/Base/ItemLabel.vue b/app/components/Viewer/ObjectTree/Base/ItemLabel.vue new file mode 100644 index 00000000..a916dde2 --- /dev/null +++ b/app/components/Viewer/ObjectTree/Base/ItemLabel.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/app/components/Viewer/ObjectTree/Box.vue b/app/components/Viewer/ObjectTree/Box.vue new file mode 100644 index 00000000..ce0968ed --- /dev/null +++ b/app/components/Viewer/ObjectTree/Box.vue @@ -0,0 +1,49 @@ + + + + + diff --git a/app/components/Viewer/ObjectTree/Layout.vue b/app/components/Viewer/ObjectTree/Layout.vue new file mode 100644 index 00000000..9b3bef47 --- /dev/null +++ b/app/components/Viewer/ObjectTree/Layout.vue @@ -0,0 +1,289 @@ + + + + + diff --git a/app/components/Viewer/ObjectTree/Views/GlobalObjectsView.vue b/app/components/Viewer/ObjectTree/Views/GlobalObjectsView.vue new file mode 100644 index 00000000..b5c9bf88 --- /dev/null +++ b/app/components/Viewer/ObjectTree/Views/GlobalObjectsView.vue @@ -0,0 +1,95 @@ + + + + + diff --git a/app/components/Viewer/ObjectTree/Views/ModelComponentsView.vue b/app/components/Viewer/ObjectTree/Views/ModelComponentsView.vue new file mode 100644 index 00000000..27d0ae59 --- /dev/null +++ b/app/components/Viewer/ObjectTree/Views/ModelComponentsView.vue @@ -0,0 +1,91 @@ + + + + + diff --git a/app/components/Viewer/Tree/ObjectTree.vue b/app/components/Viewer/Tree/ObjectTree.vue deleted file mode 100644 index ce2fff80..00000000 --- a/app/components/Viewer/Tree/ObjectTree.vue +++ /dev/null @@ -1,132 +0,0 @@ - - - - - diff --git a/app/components/Viewer/TreeComponent.vue b/app/components/Viewer/TreeComponent.vue deleted file mode 100644 index f3e06847..00000000 --- a/app/components/Viewer/TreeComponent.vue +++ /dev/null @@ -1,170 +0,0 @@ - - - - - diff --git a/app/components/Viewer/TreeObject.vue b/app/components/Viewer/TreeObject.vue deleted file mode 100644 index 870f07cf..00000000 --- a/app/components/Viewer/TreeObject.vue +++ /dev/null @@ -1,184 +0,0 @@ - - - - - diff --git a/app/components/Viewer/Ui.vue b/app/components/Viewer/Ui.vue index bb4869e2..7ae7c779 100644 --- a/app/components/Viewer/Ui.vue +++ b/app/components/Viewer/Ui.vue @@ -1,10 +1,6 @@ From b00bda58c1b8438836ff981156521d29dc1341c6 Mon Sep 17 00:00:00 2001 From: SpliiT <106495600+SpliiT@users.noreply.github.com> Date: Mon, 13 Apr 2026 13:25:41 +0000 Subject: [PATCH 05/31] Apply prepare changes --- app/components/Viewer/ObjectTree/Layout.vue | 5 +---- .../Viewer/ObjectTree/Views/GlobalObjectsView.vue | 10 ++-------- app/components/Viewer/Ui.vue | 4 +--- app/stores/treeview.js | 5 +++-- 4 files changed, 7 insertions(+), 17 deletions(-) diff --git a/app/components/Viewer/ObjectTree/Layout.vue b/app/components/Viewer/ObjectTree/Layout.vue index d2310608..26180c2f 100644 --- a/app/components/Viewer/ObjectTree/Layout.vue +++ b/app/components/Viewer/ObjectTree/Layout.vue @@ -160,10 +160,7 @@ function onVerticalResizeStart(event, index) { @close="treeviewStore.closeView(index + 1)" @dragstart="onDragStart(index + 1)" > - +
- group.children.map((child) => child.id), - ), + treeviewStore.items.flatMap((group) => group.children.map((child) => child.id)), ); const updates = [ @@ -93,11 +91,7 @@ function isModel(item) { variant="text" v-tooltip="'Model\'s mesh components'" @click.stop=" - treeviewStore.displayAdditionalTree( - item.id, - item.title, - item.geode_object_type, - ) + treeviewStore.displayAdditionalTree(item.id, item.title, item.geode_object_type) " /> diff --git a/app/components/Viewer/Ui.vue b/app/components/Viewer/Ui.vue index 2c6043ed..94706c5b 100644 --- a/app/components/Viewer/Ui.vue +++ b/app/components/Viewer/Ui.vue @@ -23,9 +23,7 @@ const dataItems = dataStore.refAllItems(); async function get_viewer_id(x, y) { const activeIds = new Set(dataItems.value.map((item) => item.id)); - const ids = Object.keys(dataStyleStore.styles).filter((styleId) => - activeIds.has(styleId), - ); + const ids = Object.keys(dataStyleStore.styles).filter((styleId) => activeIds.has(styleId)); let result = { id: undefined, viewer_id: undefined }; await viewerStore.request( diff --git a/app/stores/treeview.js b/app/stores/treeview.js index 3ad00235..20f660ac 100644 --- a/app/stores/treeview.js +++ b/app/stores/treeview.js @@ -69,7 +69,6 @@ export const useTreeviewStore = defineStore("treeview", () => { opened_views.value = [{ type: "object", id: "main", title: "Objects" }]; } - function setPanelWidth(width) { panelWidth.value = width; } @@ -83,7 +82,9 @@ export const useTreeviewStore = defineStore("treeview", () => { } function importStores(snapshot) { - opened_views.value = snapshot?.opened_views || [{ type: "object", id: "main", title: "Objects" }]; + opened_views.value = snapshot?.opened_views || [ + { type: "object", id: "main", title: "Objects" }, + ]; panelWidth.value = snapshot?.panelWidth || PANEL_WIDTH; pendingSelectionIds.value = From 706862a2c08bc080aa534439c1811566b07aba6d Mon Sep 17 00:00:00 2001 From: SpliiT Date: Mon, 13 Apr 2026 15:26:02 +0200 Subject: [PATCH 06/31] rm comments --- app/components/Viewer/ObjectTree/Layout.vue | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/app/components/Viewer/ObjectTree/Layout.vue b/app/components/Viewer/ObjectTree/Layout.vue index d2310608..7d35729b 100644 --- a/app/components/Viewer/ObjectTree/Layout.vue +++ b/app/components/Viewer/ObjectTree/Layout.vue @@ -14,8 +14,8 @@ const emit = defineEmits(["show-menu"]); const mainView = computed(() => treeviewStore.opened_views[0]); const additionalViews = computed(() => treeviewStore.opened_views.slice(1)); -const mainColWidth = ref(50); // percentage -const rowHeights = ref([]); // percentages of the second column height +const mainColWidth = ref(50); +const rowHeights = ref([]); const draggedIndex = ref(null); watch( @@ -49,7 +49,10 @@ function onResizeStart(event) { function resize(move_event) { const deltaX = move_event.clientX - startX; const maxWidth = window.innerWidth * 0.8; - const newWidth = Math.max(WIDTH_MIN, Math.min(startWidth + deltaX, maxWidth)); + const newWidth = Math.max( + WIDTH_MIN, + Math.min(startWidth + deltaX, maxWidth), + ); treeviewStore.setPanelWidth(newWidth); document.body.style.userSelect = "none"; } @@ -93,7 +96,7 @@ function onVerticalResizeStart(event, index) { let newH1 = startHeight1 + deltaPercent; let newH2 = startHeight2 - deltaPercent; - const MIN_HEIGHT = 10; // percent + const MIN_HEIGHT = 10; if (newH1 < MIN_HEIGHT) { newH1 = MIN_HEIGHT; newH2 = startHeight1 + startHeight2 - MIN_HEIGHT; @@ -131,7 +134,9 @@ function onVerticalResizeStart(event, index) {
@@ -148,7 +153,9 @@ function onVerticalResizeStart(event, index) {