+
@@ -58,8 +49,6 @@ import {
useInjectedViewerRequestedResources
} from '~~/lib/viewer/composables/setup'
import { useMixpanel } from '~~/lib/core/composables/mp'
-import { useCheckViewerCommentingAccess } from '~~/lib/viewer/composables/commentManagement'
-import { useSelectionUtilities } from '~~/lib/viewer/composables/ui'
import type { LayoutMenuItem } from '~~/lib/layout/helpers/components'
import { HorizontalDirection } from '~~/lib/common/composables/window'
@@ -102,12 +91,8 @@ graphql(`
const { commentThreads, commentThreadsMetadata } = useInjectedViewerLoadedResources()
const { threadFilters } = useInjectedViewerRequestedResources()
const {
- threads: {
- hideBubbles,
- openThread: { newThreadEditor }
- }
+ threads: { hideBubbles }
} = useInjectedViewerInterfaceState()
-const canPostComment = useCheckViewerCommentingAccess()
const menuId = useId()
const showVisibilityOptions = ref(false)
@@ -148,9 +133,6 @@ watch(includeArchived, (newVal) =>
})
)
-const { objectIds: selectedObjectIds } = useSelectionUtilities()
-
-const hasSelectedObjects = computed(() => selectedObjectIds.value.size > 0)
const actionsItems = computed
(() => [
[
{
@@ -188,8 +170,4 @@ const onActionChosen = (params: { item: LayoutMenuItem; event: MouseEvent }) =>
break
}
}
-const onNewDiscussion = () => {
- if (!hasSelectedObjects.value) return
- newThreadEditor.value = true
-}
diff --git a/packages/frontend-2/components/viewer/controls/Bottom.vue b/packages/frontend-2/components/viewer/controls/Bottom.vue
index 186d0f1d4..7a1ee082d 100644
--- a/packages/frontend-2/components/viewer/controls/Bottom.vue
+++ b/packages/frontend-2/components/viewer/controls/Bottom.vue
@@ -64,7 +64,7 @@ enum ActivePanel {
}
const { getShortcutDisplayText, shortcuts, registerShortcuts } = useViewerShortcuts()
-const { toggleSectionBox } = useSectionBoxUtilities()
+const { toggleSectionBox, resetSectionBox, closeSectionBox } = useSectionBoxUtilities()
const { getActiveMeasurement, removeMeasurement, enableMeasurements } =
useMeasurementUtilities()
const { resetExplode } = useFilterUtilities()
@@ -113,7 +113,10 @@ const panels = shallowRef({
})
const showResetButton = computed(() => {
- return activePanel.value === ActivePanel.explode
+ return (
+ activePanel.value === ActivePanel.explode ||
+ activePanel.value === ActivePanel.sectionBox
+ )
})
const toggleActivePanel = (panel: ActivePanel) => {
@@ -136,7 +139,7 @@ const toggleMeasurements = () => {
const onActivePanelClose = () => {
if (activePanel.value === ActivePanel.sectionBox) {
- toggleSectionBox()
+ closeSectionBox()
}
if (activePanel.value === ActivePanel.measurements) {
enableMeasurements(false)
@@ -148,6 +151,9 @@ const onReset = () => {
if (activePanel.value === ActivePanel.explode) {
resetExplode()
}
+ if (activePanel.value === ActivePanel.sectionBox) {
+ resetSectionBox()
+ }
}
registerShortcuts({
@@ -164,7 +170,7 @@ onKeyStroke('Escape', () => {
if (activePanel.value === ActivePanel.measurements) {
toggleMeasurements()
} else if (activePanel.value === ActivePanel.sectionBox) {
- toggleSectionBox()
+ closeSectionBox()
}
activePanel.value = ActivePanel.none
}
diff --git a/packages/frontend-2/lib/viewer/composables/ui.ts b/packages/frontend-2/lib/viewer/composables/ui.ts
index 75a328b4b..d6eeef224 100644
--- a/packages/frontend-2/lib/viewer/composables/ui.ts
+++ b/packages/frontend-2/lib/viewer/composables/ui.ts
@@ -53,6 +53,10 @@ export function useSectionBoxUtilities() {
}
}
+ const closeSectionBox = () => {
+ visible.value = false
+ }
+
const toggleSectionBox = () => {
if (!isSectionBoxEnabled.value) {
resolveSectionBoxFromSelection()
@@ -86,7 +90,8 @@ export function useSectionBoxUtilities() {
isSectionBoxEdited,
toggleSectionBox,
resetSectionBox,
- sectionBox
+ sectionBox,
+ closeSectionBox
}
}