@geode/opengeodeweb-front 12.2.0-rc.3 → 12.2.0-rc.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/.build/tests/browser/helpers/object_trees/common.js +3 -1
  2. package/.build/tests/browser/helpers/object_trees/model_tree_bar.js +41 -0
  3. package/.build/tests/browser/helpers/wait_for_action_settled.js +2 -2
  4. package/.build/tests/browser/suites/index.js +2 -0
  5. package/.build/tests/browser/suites/model/collections.js +1 -1
  6. package/.build/tests/browser/suites/object_tree/controls.js +2 -1
  7. package/.build/tests/browser/suites/object_tree/model_tree_bar.js +81 -0
  8. package/app/components/ClippingPlanes.vue +1 -1
  9. package/app/components/FactorFilterPanel.vue +1 -1
  10. package/app/components/Launcher.vue +3 -2
  11. package/app/components/ThresholdFilter.vue +1 -2
  12. package/app/components/Viewer/Basemap/CropOptions.vue +7 -8
  13. package/app/components/Viewer/Basemap/OpacityOptions.vue +7 -8
  14. package/app/components/Viewer/ContextMenu/CircularItems.vue +6 -43
  15. package/app/components/Viewer/ContextMenu/ContextMenu.vue +1 -6
  16. package/app/components/Viewer/ContextMenu/ContextMenuItem.vue +14 -16
  17. package/app/components/Viewer/EdgedCurve/PointsOptions.vue +5 -4
  18. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +10 -13
  19. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +8 -11
  20. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +16 -13
  21. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +28 -31
  22. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +9 -11
  23. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +8 -11
  24. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +1 -1
  25. package/app/components/Viewer/Generic/Model/CornersOptions.vue +1 -1
  26. package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +1 -1
  27. package/app/components/Viewer/Generic/Model/EdgesOptions.vue +7 -8
  28. package/app/components/Viewer/Generic/Model/LinesOptions.vue +1 -1
  29. package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +1 -1
  30. package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +5 -7
  31. package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +5 -7
  32. package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +5 -7
  33. package/app/components/Viewer/Generic/Model/ModelStyleOptions.vue +7 -8
  34. package/app/components/Viewer/Generic/Model/PointsOptions.vue +7 -8
  35. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +1 -1
  36. package/app/components/Viewer/Grid/2D/CellsOptions.vue +6 -4
  37. package/app/components/Viewer/Grid/2D/EdgesOptions.vue +6 -4
  38. package/app/components/Viewer/Grid/2D/PointsOptions.vue +5 -4
  39. package/app/components/Viewer/Grid/3D/CellsOptions.vue +6 -4
  40. package/app/components/Viewer/Grid/3D/EdgesOptions.vue +6 -4
  41. package/app/components/Viewer/Grid/3D/FacetsOptions.vue +6 -4
  42. package/app/components/Viewer/Grid/3D/PointsOptions.vue +5 -4
  43. package/app/components/Viewer/Image/ImageOptions.vue +10 -13
  44. package/app/components/Viewer/ObjectTree/Base/CommonTreeView.vue +17 -1
  45. package/app/components/Viewer/ObjectTree/Base/ComponentRelations.vue +2 -2
  46. package/app/components/Viewer/ObjectTree/Base/Controls.vue +26 -2
  47. package/app/components/Viewer/ObjectTree/Base/StickyHeader.vue +4 -1
  48. package/app/components/Viewer/ObjectTree/Base/TreeRow.vue +6 -8
  49. package/app/components/Viewer/ObjectTree/Box.vue +30 -5
  50. package/app/components/Viewer/ObjectTree/Layout.vue +183 -54
  51. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +10 -15
  52. package/app/components/Viewer/ObjectTree/Views/ModelTree.vue +3 -0
  53. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +28 -31
  54. package/app/components/Viewer/Scene/BackgroundOptions.vue +4 -7
  55. package/app/components/Viewer/Scene/OrientationWidgetOptions.vue +4 -7
  56. package/app/components/Viewer/Scene/TextOptions.vue +4 -7
  57. package/app/components/Viewer/Solid/EdgesOptions.vue +6 -4
  58. package/app/components/Viewer/Solid/PointsOptions.vue +5 -4
  59. package/app/components/Viewer/Solid/PolygonsOptions.vue +6 -4
  60. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +8 -11
  61. package/app/components/Viewer/Surface/EdgesOptions.vue +6 -4
  62. package/app/components/Viewer/Surface/PointsOptions.vue +6 -4
  63. package/app/components/Viewer/Surface/PolygonsOptions.vue +8 -11
  64. package/app/components/Viewer/Surface/Triangulated/TrianglesOptions.vue +5 -4
  65. package/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue +6 -4
  66. package/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue +6 -4
  67. package/app/composables/circular_menu.ts +45 -0
  68. package/app/composables/hover_highlight.ts +1 -1
  69. package/app/composables/model_menu_context.ts +7 -11
  70. package/app/composables/model_tree.ts +3 -3
  71. package/app/composables/model_tree_drag.ts +56 -0
  72. package/app/composables/project_manager_helpers/types.ts +2 -3
  73. package/app/composables/use_adaptive_styles.ts +15 -8
  74. package/app/composables/use_overlapping_picker.ts +7 -19
  75. package/app/composables/viewer_context_menu.ts +2 -1
  76. package/app/composables/virtual_tree.ts +7 -1
  77. package/app/stores/api.ts +6 -59
  78. package/app/stores/app.ts +21 -55
  79. package/app/stores/back.ts +86 -145
  80. package/app/stores/camera_manager.ts +12 -25
  81. package/app/stores/cloud.ts +21 -101
  82. package/app/stores/crs.ts +3 -2
  83. package/app/stores/data.ts +66 -409
  84. package/app/stores/data_style.ts +99 -93
  85. package/app/stores/feedback.ts +57 -53
  86. package/app/stores/infra.ts +61 -101
  87. package/app/stores/treeview.ts +39 -30
  88. package/app/stores/viewer.ts +9 -29
  89. package/app/stores/viewer_helpers/actions.ts +1 -23
  90. package/app/utils/backend_lifecycle.ts +155 -0
  91. package/app/utils/import_item.ts +5 -4
  92. package/app/utils/threshold_sources.ts +3 -2
  93. package/app/utils/treeview.ts +25 -1
  94. package/app/utils/viewer_object_type.ts +21 -0
  95. package/internal/database/base_database.ts +2 -1
  96. package/internal/database/database.ts +90 -7
  97. package/internal/database/queries.ts +45 -0
  98. package/internal/database/tables/camera_positions.ts +11 -1
  99. package/internal/database/tables/data.ts +20 -1
  100. package/internal/database/tables/data_style.ts +3 -1
  101. package/internal/database/tables/model_component_datastyle.ts +3 -1
  102. package/internal/database/tables/model_component_type_datastyle.ts +3 -1
  103. package/internal/database/tables/model_components.ts +12 -1
  104. package/internal/database/tables/model_components_relation.ts +11 -1
  105. package/internal/database/tables/scene_style.ts +3 -1
  106. package/internal/database/tables/treeview_config.ts +31 -0
  107. package/internal/stores/data/items.ts +110 -0
  108. package/internal/stores/data/model/collections.ts +107 -0
  109. package/internal/stores/data/model/components.ts +129 -0
  110. package/internal/stores/data/model/mesh_components.ts +134 -0
  111. package/internal/stores/data/model/relations.ts +76 -0
  112. package/internal/stores/data/model/types.ts +14 -0
  113. package/internal/stores/data/registration.ts +54 -0
  114. package/internal/stores/data/snapshot.ts +83 -0
  115. package/internal/stores/data/types.ts +26 -0
  116. package/internal/stores/data_style/model/common_mutations.ts +47 -77
  117. package/internal/stores/data_style/model/selection.ts +3 -10
  118. package/internal/stores/data_style/scene.ts +2 -2
  119. package/internal/stores/data_style/state.ts +10 -8
  120. package/internal/stores/data_style/state_shared.ts +10 -7
  121. package/internal/stores/hybrid_viewer/brightness.ts +36 -19
  122. package/internal/stores/hybrid_viewer/highlight.ts +9 -14
  123. package/internal/stores/hybrid_viewer/scene.ts +1 -1
  124. package/internal/stores/microservice.ts +192 -0
  125. package/package.json +1 -1
  126. package/tests/browser/helpers/data/helpers/attribute.ts +2 -1
  127. package/tests/browser/helpers/object_trees/common.ts +4 -0
  128. package/tests/browser/helpers/object_trees/model_tree_bar.ts +78 -0
  129. package/tests/browser/helpers/wait_for_action_settled.ts +2 -3
  130. package/tests/browser/suites/model/collections.ts +2 -1
  131. package/tests/browser/suites/object_tree/controls.ts +3 -0
  132. package/tests/browser/suites/object_tree/model_tree_bar.ts +125 -0
  133. package/app/stores/data_helpers/collections.ts +0 -122
  134. package/app/stores/data_helpers/mesh.ts +0 -167
  135. package/app/stores/data_helpers/relations.ts +0 -94
@@ -1,18 +1,20 @@
1
1
  <script setup lang="ts">
2
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
2
3
  import Grid2D_Edges from "@ogw_front/assets/viewer_svgs/grid_2d_edges.svg";
3
- import type { ItemProps } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
4
4
  import ViewerGenericMeshEdgesOptions from "@ogw_front/components/Viewer/Generic/Mesh/EdgesOptions.vue";
5
5
 
6
6
  interface Props {
7
- itemProps: ItemProps & { index?: number };
7
+ dataId: DataId;
8
+ index: number;
8
9
  }
9
10
 
10
- const { itemProps } = defineProps<Props>();
11
+ const { dataId, index } = defineProps<Props>();
11
12
  </script>
12
13
 
13
14
  <template>
14
15
  <ViewerGenericMeshEdgesOptions
15
- :itemProps="itemProps"
16
+ :data-id="dataId"
17
+ :index="index"
16
18
  :btnImage="Grid2D_Edges"
17
19
  :capabilities="{ edge: { available: false } }"
18
20
  />
@@ -1,15 +1,16 @@
1
1
  <script setup lang="ts">
2
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
2
3
  import Grid2D_Points from "@ogw_front/assets/viewer_svgs/grid_2d_points.svg";
3
- import type { ItemProps } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
4
4
  import ViewerGenericMeshPointsOptions from "@ogw_front/components/Viewer/Generic/Mesh/PointsOptions.vue";
5
5
 
6
6
  interface Props {
7
- itemProps: ItemProps & { index?: number };
7
+ dataId: DataId;
8
+ index: number;
8
9
  }
9
10
 
10
- const { itemProps } = defineProps<Props>();
11
+ const { dataId, index } = defineProps<Props>();
11
12
  </script>
12
13
 
13
14
  <template>
14
- <ViewerGenericMeshPointsOptions :itemProps="itemProps" :btnImage="Grid2D_Points" />
15
+ <ViewerGenericMeshPointsOptions :data-id="dataId" :index="index" :btnImage="Grid2D_Points" />
15
16
  </template>
@@ -1,18 +1,20 @@
1
1
  <script setup lang="ts">
2
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
2
3
  import Grid3DCells from "@ogw_front/assets/viewer_svgs/grid_3d_cells.svg";
3
- import type { ItemProps } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
4
4
  import ViewerGenericMeshCellsOptions from "@ogw_front/components/Viewer/Generic/Mesh/CellsOptions.vue";
5
5
 
6
6
  interface Props {
7
- itemProps: ItemProps & { index?: number };
7
+ dataId: DataId;
8
+ index: number;
8
9
  }
9
10
 
10
- const { itemProps } = defineProps<Props>();
11
+ const { dataId, index } = defineProps<Props>();
11
12
  </script>
12
13
 
13
14
  <template>
14
15
  <ViewerGenericMeshCellsOptions
15
- :itemProps="itemProps"
16
+ :data-id="dataId"
17
+ :index="index"
16
18
  :btnImage="Grid3DCells"
17
19
  tooltip="Cells options"
18
20
  />
@@ -1,18 +1,20 @@
1
1
  <script setup lang="ts">
2
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
2
3
  import Grid3D_Edges from "@ogw_front/assets/viewer_svgs/grid_3d_edges.svg";
3
- import type { ItemProps } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
4
4
  import ViewerGenericMeshEdgesOptions from "@ogw_front/components/Viewer/Generic/Mesh/EdgesOptions.vue";
5
5
 
6
6
  interface Props {
7
- itemProps: ItemProps & { index?: number };
7
+ dataId: DataId;
8
+ index: number;
8
9
  }
9
10
 
10
- const { itemProps } = defineProps<Props>();
11
+ const { dataId, index } = defineProps<Props>();
11
12
  </script>
12
13
 
13
14
  <template>
14
15
  <ViewerGenericMeshEdgesOptions
15
- :itemProps="itemProps"
16
+ :data-id="dataId"
17
+ :index="index"
16
18
  :btnImage="Grid3D_Edges"
17
19
  :capabilities="{ edge: { available: false } }"
18
20
  />
@@ -1,18 +1,20 @@
1
1
  <script setup lang="ts">
2
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
2
3
  import Grid3D_Facets from "@ogw_front/assets/viewer_svgs/grid_3d_facets.svg";
3
- import type { ItemProps } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
4
4
  import ViewerGenericMeshPolygonsOptions from "@ogw_front/components/Viewer/Generic/Mesh/PolygonsOptions.vue";
5
5
 
6
6
  interface Props {
7
- itemProps: ItemProps & { index?: number };
7
+ dataId: DataId;
8
+ index: number;
8
9
  }
9
10
 
10
- const { itemProps } = defineProps<Props>();
11
+ const { dataId, index } = defineProps<Props>();
11
12
  </script>
12
13
 
13
14
  <template>
14
15
  <ViewerGenericMeshPolygonsOptions
15
- :itemProps="itemProps"
16
+ :data-id="dataId"
17
+ :index="index"
16
18
  :btnImage="Grid3D_Facets"
17
19
  tooltip="Facets options"
18
20
  />
@@ -1,15 +1,16 @@
1
1
  <script setup lang="ts">
2
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
2
3
  import Grid3D_Points from "@ogw_front/assets/viewer_svgs/grid_3d_points.svg";
3
- import type { ItemProps } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
4
4
  import ViewerGenericMeshPointsOptions from "@ogw_front/components/Viewer/Generic/Mesh/PointsOptions.vue";
5
5
 
6
6
  interface Props {
7
- itemProps: ItemProps & { index?: number };
7
+ dataId: DataId;
8
+ index: number;
8
9
  }
9
10
 
10
- const { itemProps } = defineProps<Props>();
11
+ const { dataId, index } = defineProps<Props>();
11
12
  </script>
12
13
 
13
14
  <template>
14
- <ViewerGenericMeshPointsOptions :itemProps="itemProps" :btnImage="Grid3D_Points" />
15
+ <ViewerGenericMeshPointsOptions :data-id="dataId" :index="index" :btnImage="Grid3D_Points" />
15
16
  </template>
@@ -1,9 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import type { Opacity, Visibility } from "@geode/opengeodeweb-viewer/schema_types";
3
- import ViewerContextMenuItem, {
4
- type ItemProps,
5
- } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
3
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
6
4
  import type { ImageId } from "@ogw_front/types/identifiers";
5
+ import ViewerContextMenuItem from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
7
6
  import ViewerOptionsOpacitySlider from "@ogw_front/components/Viewer/Options/Sliders/Opacity.vue";
8
7
  import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
9
8
  import { useBatchStyle } from "@ogw_front/composables/batch_style";
@@ -15,32 +14,31 @@ const hybridViewerStore = useHybridViewerStore();
15
14
  const { applyBatchStyle } = useBatchStyle();
16
15
 
17
16
  interface Props {
18
- itemProps: ItemProps & { index: number };
17
+ dataId: DataId;
18
+ index: number;
19
19
  }
20
20
 
21
- const { itemProps } = defineProps<Props>();
22
-
23
- const dataId = toRef(() => itemProps.id);
21
+ const { dataId, index } = defineProps<Props>();
24
22
 
25
23
  const visibility = computed<Visibility | undefined>({
26
- get: () => dataStyleStore.imageVisibility(dataId.value),
24
+ get: () => dataStyleStore.imageVisibility(dataId),
27
25
  set: async (newValue) => {
28
26
  if (newValue === undefined) {
29
27
  return;
30
28
  }
31
- await applyBatchStyle(dataId.value, (imageId: ImageId) =>
29
+ await applyBatchStyle(dataId, (imageId: ImageId) =>
32
30
  dataStyleStore.setImageVisibility(imageId, newValue),
33
31
  );
34
32
  hybridViewerStore.remoteRender();
35
33
  },
36
34
  });
37
35
  const opacity = computed<Opacity | undefined>({
38
- get: () => dataStyleStore.imageOpacity(dataId.value),
36
+ get: () => dataStyleStore.imageOpacity(dataId),
39
37
  set: async (newValue) => {
40
38
  if (newValue === undefined) {
41
39
  return;
42
40
  }
43
- await applyBatchStyle(dataId.value, (imageId: ImageId) =>
41
+ await applyBatchStyle(dataId, (imageId: ImageId) =>
44
42
  dataStyleStore.setImageOpacity(imageId, newValue),
45
43
  );
46
44
  hybridViewerStore.remoteRender();
@@ -51,8 +49,7 @@ const opacity = computed<Opacity | undefined>({
51
49
  <template>
52
50
  <ViewerContextMenuItem
53
51
  data-testid="imageMenu"
54
- :index="itemProps.index"
55
- :itemProps="itemProps"
52
+ :index="index"
56
53
  tooltip="Image options"
57
54
  btnIcon="ph-image"
58
55
  >
@@ -22,6 +22,8 @@ interface Props {
22
22
  options?: Record<string, unknown>;
23
23
  // Row tinted from outside the tree, e.g. while its model tree header is hovered
24
24
  linked?: { id: unknown; color: string };
25
+ // Whether a row shows its visibility toggle: the view knows which data a row stands for
26
+ isRowViewable: (item: DisplayItem) => boolean;
25
27
  }
26
28
 
27
29
  const {
@@ -32,6 +34,7 @@ const {
32
34
  scrollTop = 0,
33
35
  options = {},
34
36
  linked = undefined,
37
+ isRowViewable,
35
38
  } = defineProps<Props>();
36
39
 
37
40
  const treeWrapper = ref<HTMLDivElement | undefined>(undefined);
@@ -170,6 +173,15 @@ function clearActive(): boolean {
170
173
  return true;
171
174
  }
172
175
 
176
+ // Hovering the tree gives it the keyboard, unless a field (its search) is being typed in
177
+ function focusOnHover(): void {
178
+ const { activeElement } = document;
179
+ if (activeElement instanceof HTMLInputElement || activeElement instanceof HTMLTextAreaElement) {
180
+ return;
181
+ }
182
+ treeWrapper.value?.focus();
183
+ }
184
+
173
185
  const { handleKeyDown } = useTreeKeyboardNav(
174
186
  displayItems,
175
187
  emit as EmitFn,
@@ -190,7 +202,7 @@ const { handleKeyDown } = useTreeKeyboardNav(
190
202
  tabindex="0"
191
203
  @keydown="handleKeyDown"
192
204
  @mousedown="treeWrapper?.focus()"
193
- @mouseenter="treeWrapper?.focus()"
205
+ @mouseenter="focusOnHover"
194
206
  >
195
207
  <StickyHeader
196
208
  v-if="stickyHeader"
@@ -199,6 +211,7 @@ const { handleKeyDown } = useTreeKeyboardNav(
199
211
  :selection="actualSelection"
200
212
  :is-selected="isSelected"
201
213
  :get-indeterminate="getIndeterminate"
214
+ :is-row-viewable="isRowViewable"
202
215
  @toggle-open="toggleOpen"
203
216
  @toggle-select="toggleSelect"
204
217
  >
@@ -252,6 +265,7 @@ const { handleKeyDown } = useTreeKeyboardNav(
252
265
  :selection="actualSelection"
253
266
  :is-selected="isSelected"
254
267
  :get-indeterminate="getIndeterminate"
268
+ :is-row-viewable="isRowViewable"
255
269
  @toggle-open="toggleOpen"
256
270
  @toggle-select="toggleSelect"
257
271
  @hover-eye-enter="emit('hover:leave', { item })"
@@ -299,6 +313,8 @@ const { handleKeyDown } = useTreeKeyboardNav(
299
313
  cursor: pointer;
300
314
  border-radius: var(--ogw-viewer-row-radius, 4px);
301
315
  margin: 0 2px;
316
+ /* After the panel gutter, clear of the accent of a model tree */
317
+ margin-left: calc(2px + var(--tree-box-content-inset, 0px));
302
318
  }
303
319
 
304
320
  .tree-row-wrapper.is-focused {
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
- import type { ComponentRelations } from "@ogw_front/stores/data_helpers/relations";
3
- import type { FormattedComponent } from "@ogw_front/stores/data_helpers/mesh";
2
+ import type { ComponentRelations } from "@ogw_internal/stores/data/model/relations";
3
+ import type { FormattedComponent } from "@ogw_internal/stores/data/model/mesh_components";
4
4
  import { MESH_COMPONENT_TYPES } from "@ogw_front/utils/default_styles";
5
5
  import { pluralize } from "@ogw_front/utils/string";
6
6
  import { useDataStore } from "@ogw_front/stores/data";
@@ -28,23 +28,43 @@ interface Emits {
28
28
  const emit = defineEmits<Emits>();
29
29
 
30
30
  const showSearch = ref<boolean>(false);
31
+ const capsule = useTemplateRef("capsule");
31
32
 
33
+ // The search field takes the focus as soon as it shows, so typing goes straight into it
32
34
  watch(
33
35
  () => showSearch.value,
34
- (val) => {
36
+ async (val) => {
35
37
  if (!val) {
36
38
  emit("update:search", "");
39
+ return;
37
40
  }
41
+ await nextTick();
42
+ capsule.value
43
+ ?.querySelector<HTMLInputElement>('[data-testid="searchObjectsInput"] input')
44
+ ?.focus();
38
45
  },
39
46
  );
47
+
48
+ // Leaving the toolbar folds an empty search back; a search in progress stays shown with its query
49
+ function onFocusOut(event: FocusEvent): void {
50
+ const next = event.relatedTarget;
51
+ if (next instanceof Node && capsule.value?.contains(next)) {
52
+ return;
53
+ }
54
+ if (search === "") {
55
+ showSearch.value = false;
56
+ }
57
+ }
40
58
  </script>
41
59
 
42
60
  <template>
43
61
  <v-row dense align="center" class="controls-row pa-1 py-0">
44
62
  <v-col cols="12">
45
63
  <div
64
+ ref="capsule"
46
65
  class="controls-capsule d-flex align-center rounded-pill overflow-hidden"
47
66
  :class="{ 'is-expanded': showSearch }"
67
+ @focusout="onFocusOut"
48
68
  >
49
69
  <ActionButton
50
70
  data-testid="searchObjectsButton"
@@ -128,7 +148,11 @@ watch(
128
148
  <style scoped>
129
149
  /* Apps can line the first icon up with the panel header icon (fallbacks: the former look) */
130
150
  .controls-row {
131
- padding-left: var(--ogw-viewer-controls-inset, 4px) !important;
151
+ /* Apps can space the toolbar from the panel header above and the first row below */
152
+ padding-block: var(--ogw-viewer-controls-padding-block, 0px) !important;
153
+ padding-left: calc(
154
+ var(--ogw-viewer-controls-inset, 4px) + var(--tree-box-content-inset, 0px)
155
+ ) !important;
132
156
  }
133
157
 
134
158
  .controls-capsule {
@@ -13,9 +13,11 @@ interface Props {
13
13
  selection: SelectionConfig;
14
14
  isSelected: (item: TreeItem) => boolean;
15
15
  getIndeterminate: (item: TreeItem) => boolean;
16
+ isRowViewable: (item: DisplayItem) => boolean;
16
17
  }
17
18
 
18
- const { item, itemProps, selection, isSelected, getIndeterminate } = defineProps<Props>();
19
+ const { item, itemProps, selection, isSelected, getIndeterminate, isRowViewable } =
20
+ defineProps<Props>();
19
21
 
20
22
  interface Emits {
21
23
  "toggle-open": [item: TreeItem];
@@ -33,6 +35,7 @@ const emit = defineEmits<Emits>();
33
35
  :selection="selection"
34
36
  :is-selected="isSelected"
35
37
  :get-indeterminate="getIndeterminate"
38
+ :is-row-viewable="isRowViewable"
36
39
  @toggle-open="$emit('toggle-open', $event)"
37
40
  @toggle-select="$emit('toggle-select', $event)"
38
41
  >
@@ -5,9 +5,6 @@ import type {
5
5
  SelectionConfig,
6
6
  TreeItem,
7
7
  } from "@ogw_front/composables/virtual_tree";
8
- import { useDataStore } from "@ogw_front/stores/data";
9
-
10
- const dataStore = useDataStore();
11
8
 
12
9
  interface Props {
13
10
  item: DisplayItem;
@@ -15,9 +12,12 @@ interface Props {
15
12
  selection: SelectionConfig;
16
13
  isSelected: (item: TreeItem) => boolean;
17
14
  getIndeterminate: (item: TreeItem) => boolean;
15
+ // Given by the view: it knows which data a row stands for
16
+ isRowViewable: (item: DisplayItem) => boolean;
18
17
  }
19
18
 
20
- const { item, itemProps, selection, isSelected, getIndeterminate } = defineProps<Props>();
19
+ const { item, itemProps, selection, isSelected, getIndeterminate, isRowViewable } =
20
+ defineProps<Props>();
21
21
 
22
22
  interface Emits {
23
23
  "toggle-open": [item: TreeItem];
@@ -34,10 +34,8 @@ function triggerHorizonStackModal(rawItem: unknown): void {
34
34
  globalThis.dispatchEvent(new CustomEvent("open-horizon-stack-modal", { detail: rawItem }));
35
35
  }
36
36
  const isHorizonStack = computed<boolean>(() => item.raw.geode_object_type === "HorizonStack3D");
37
- const isViewable = computed<boolean>(() => dataStore.isItemViewable(item.raw));
38
- const showEyeButton = computed<boolean>(
39
- () => !isHorizonStack.value && item.raw.title !== "HorizonStack3D" && isViewable.value,
40
- );
37
+ // A horizon stack row opens its modal instead of toggling a visibility
38
+ const showEyeButton = computed<boolean>(() => !isHorizonStack.value && isRowViewable(item));
41
39
 
42
40
  function isLoading(child: unknown): boolean {
43
41
  return (
@@ -104,7 +104,7 @@ watch(
104
104
  ref="treeview-box"
105
105
  variant="outlined"
106
106
  class="tree-box d-flex flex-column"
107
- :class="{ 'is-highlighted': accent?.highlighted }"
107
+ :class="{ 'is-highlighted': accent?.highlighted, 'has-accent': accent !== undefined }"
108
108
  :style="[
109
109
  adaptiveStyles,
110
110
  { borderRadius, borderLeft: borderLeft ? undefined : 'none' },
@@ -191,10 +191,21 @@ watch(
191
191
  content: "";
192
192
  position: absolute;
193
193
  inset: 0;
194
- /* Adaptive glass: apps can tint it (an "r, g, b" triplet) and change its blending, per theme */
195
- background: rgba(var(--ogw-viewer-glass-tint, 255, 255, 255), var(--adaptive-opacity));
196
- backdrop-filter: blur(var(--adaptive-blur)) brightness(var(--adaptive-brightness));
197
- -webkit-backdrop-filter: blur(var(--adaptive-blur)) brightness(var(--adaptive-brightness));
194
+ /* Adaptive glass: apps can tint it (an "r, g, b" triplet), change its blending and set a minimum opacity, per
195
+ theme (the radial menu's one) */
196
+ background: rgba(
197
+ var(--ogw-viewer-glass-tint, 255, 255, 255),
198
+ max(var(--adaptive-opacity), var(--ogw-viewer-glass-min-opacity, 0))
199
+ );
200
+ /* Apps can replace the adaptive blur and dimming of the backdrop, "none" keeps it sharp */
201
+ backdrop-filter: var(
202
+ --ogw-viewer-glass-backdrop,
203
+ blur(var(--adaptive-blur)) brightness(var(--adaptive-brightness))
204
+ );
205
+ -webkit-backdrop-filter: var(
206
+ --ogw-viewer-glass-backdrop,
207
+ blur(var(--adaptive-blur)) brightness(var(--adaptive-brightness))
208
+ );
198
209
  mix-blend-mode: var(--ogw-viewer-glass-blend, lighten);
199
210
  z-index: 0;
200
211
  pointer-events: none;
@@ -209,6 +220,17 @@ watch(
209
220
  z-index: 1;
210
221
  }
211
222
 
223
+ /* Left gutter of the panel content, read by the header, the toolbar and the rows so they keep one column. A model
224
+ tree leaves its accent that room, so the rounded toolbar and row highlights do not slide under it; apps can give
225
+ every panel a gutter, so all the trees line up */
226
+ .tree-box {
227
+ --tree-box-content-inset: var(--ogw-viewer-panel-gutter, 0px);
228
+ }
229
+
230
+ .tree-box.has-accent {
231
+ --tree-box-content-inset: max(6px, var(--ogw-viewer-panel-gutter, 0px));
232
+ }
233
+
212
234
  .tree-box-accent {
213
235
  position: absolute;
214
236
  z-index: 2;
@@ -234,6 +256,9 @@ watch(
234
256
  .tree-box-header {
235
257
  height: 32px !important;
236
258
  padding: 0 var(--ogw-viewer-panel-padding, 10px) !important;
259
+ padding-left: calc(
260
+ var(--ogw-viewer-panel-padding, 10px) + var(--tree-box-content-inset, 0px)
261
+ ) !important;
237
262
  background-color: rgba(var(--v-theme-surface), 0.05);
238
263
  border-bottom: 1px solid rgba(var(--v-theme-on-surface), 0.05);
239
264
  flex-shrink: 0;