From 106b36aec81e3386ed9b33a6bfbbe9dcae9cd623 Mon Sep 17 00:00:00 2001 From: andrewwallacespeckle Date: Mon, 15 Sep 2025 11:26:33 +0100 Subject: [PATCH] fix(fe): right click hide selection --- .../components/viewer/AnchoredPoints.vue | 7 +++--- .../viewer/GlobalIsolationReset.vue | 22 +++++++++++++++++++ .../viewer/composables/filtering/filtering.ts | 18 ++++++++++++++- 3 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 packages/frontend-2/components/viewer/GlobalIsolationReset.vue diff --git a/packages/frontend-2/components/viewer/AnchoredPoints.vue b/packages/frontend-2/components/viewer/AnchoredPoints.vue index e15f476f6..f968e33f9 100644 --- a/packages/frontend-2/components/viewer/AnchoredPoints.vue +++ b/packages/frontend-2/components/viewer/AnchoredPoints.vue @@ -120,11 +120,11 @@
- + +
@@ -162,7 +162,8 @@ const { sessionId } = viewerState const { users } = useViewerUserActivityTracking({ parentEl }) const { isOpenThread, open, closeAllThreads } = useThreadUtilities() const { - filters: { hasAnyFiltersApplied } + filters: { hasAnyFiltersApplied }, + hasAnyIsolationsApplied } = useFilterUtilities({ state: viewerState }) const canPostComment = useCheckViewerCommentingAccess() const breakpoints = useBreakpoints(TailwindBreakpoints) diff --git a/packages/frontend-2/components/viewer/GlobalIsolationReset.vue b/packages/frontend-2/components/viewer/GlobalIsolationReset.vue new file mode 100644 index 000000000..78ec93e95 --- /dev/null +++ b/packages/frontend-2/components/viewer/GlobalIsolationReset.vue @@ -0,0 +1,22 @@ + + diff --git a/packages/frontend-2/lib/viewer/composables/filtering/filtering.ts b/packages/frontend-2/lib/viewer/composables/filtering/filtering.ts index ed3160b07..90ddbacc6 100644 --- a/packages/frontend-2/lib/viewer/composables/filtering/filtering.ts +++ b/packages/frontend-2/lib/viewer/composables/filtering/filtering.ts @@ -37,7 +37,10 @@ import { findFilterByKvp } from '~/lib/viewer/helpers/filters/utils' import { useFilterColoringHelpers } from '~/lib/viewer/composables/filtering/coloringHelpers' -import { useHighlightedObjectsUtilities } from '~/lib/viewer/composables/ui' +import { + useHighlightedObjectsUtilities, + useSelectionUtilities +} from '~/lib/viewer/composables/ui' export function useFilterUtilities( options?: Partial<{ state: InjectableViewerState }> @@ -50,6 +53,7 @@ export function useFilterUtilities( const dataStore = useFilteringDataStore() const { removeColorFilter } = useFilterColoringHelpers({ state }) const { clearHighlightedObjects } = useHighlightedObjectsUtilities() + const { clearSelection } = useSelectionUtilities() const isolateObjects = ( objectIds: string[], @@ -74,6 +78,15 @@ export function useFilterUtilities( ) } + const resetIsolations = () => { + clearHighlightedObjects() + filters.isolatedObjectIds.value = [] + } + + const hasAnyIsolationsApplied = computed(() => { + return filters.isolatedObjectIds.value.length > 0 + }) + const hideObjects = ( objectIds: string[], options?: Partial<{ @@ -81,6 +94,7 @@ export function useFilterUtilities( }> ) => { clearHighlightedObjects() + clearSelection() filters.hiddenObjectIds.value = uniq([ ...(options?.replace ? [] : filters.hiddenObjectIds.value), @@ -878,8 +892,10 @@ export function useFilterUtilities( return { isolateObjects, unIsolateObjects, + resetIsolations, hideObjects, showObjects, + hasAnyIsolationsApplied, filters, addActiveFilter, updateFilterProperty,