Skip to content

Commit f6fbd4d

Browse files
committed
fix(hub-ui): keep dock rail expanded while a group menu is open
1 parent b5caba7 commit f6fbd4d

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

packages/hub-ui/src/client/components/dock/Dock.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { useEventListener, useScreenSafeArea, whenever } from '@vueuse/core'
66
import { computed, onMounted, reactive, ref, useTemplateRef } from 'vue'
77
import { BUILTIN_ENTRY_CLIENT_AUTH_NOTICE } from '../../constants'
88
import { docksSplitGroupsWithCapacity } from '../../state/dock-settings'
9-
import { setDocksOverflowPanel } from '../../state/floating-tooltip'
9+
import { setDocksOverflowPanel, useDocksGroupPanel } from '../../state/floating-tooltip'
1010
import { useIsRpcTrusted } from '../../utils/useIsRpcTrusted'
1111
import BrandMark from '../icons/BrandMark.vue'
1212
import {
@@ -175,9 +175,15 @@ function bringUp() {
175175
176176
const isHidden = computed(() => false)
177177
178+
// An open group menu popover anchors to a dock-bar button — collapsing the rail
179+
// out from under it would leave the menu floating, detached from its trigger.
180+
const docksGroupPanel = useDocksGroupPanel()
181+
178182
const isMinimized = computed(() => {
179183
if (context.panel.store.inactiveTimeout < 0)
180184
return false
185+
if (docksGroupPanel.value)
186+
return false
181187
if (context.panel.store.inactiveTimeout === 0)
182188
return true
183189
// @ts-expect-error compatibility

packages/hub-ui/src/client/components/dock/DockEdge.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useEventListener } from '@vueuse/core'
77
import { computed, h, onMounted, ref, useTemplateRef } from 'vue'
88
import { getEntryGroup } from '../../state/dock-settings'
99
import { sharedStateToRef } from '../../state/docks'
10-
import { setEdgePositionDropdown, setFloatingTooltip, useEdgePositionDropdown } from '../../state/floating-tooltip'
10+
import { setEdgePositionDropdown, setFloatingTooltip, useDocksGroupPanel, useEdgePositionDropdown } from '../../state/floating-tooltip'
1111
import { useIframePanes } from '../../utils/useIframePanes'
1212
import BrandMark from '../icons/BrandMark.vue'
1313
import ViewEntry from '../views/ViewEntry.vue'
@@ -60,13 +60,19 @@ function bringUp() {
6060
}, +store.inactiveTimeout || 0)
6161
}
6262
63+
// An open group menu popover anchors to a toolbar button — collapsing the
64+
// toolbar out from under it would leave the menu floating, detached from it.
65+
const docksGroupPanel = useDocksGroupPanel()
66+
6367
const isCollapsed = computed(() => {
6468
if (!settings.value.autoCollapseEdgeToolbar)
6569
return false
6670
if (store.inactiveTimeout < 0)
6771
return false
6872
if (context.panel.isDragging)
6973
return false
74+
if (docksGroupPanel.value)
75+
return false
7076
if (hasPanelContent.value)
7177
return false
7278
if (store.inactiveTimeout === 0)

0 commit comments

Comments
 (0)