diff --git a/packages/hub-ui/src/client/components/dock/DockEdge.stories.ts b/packages/hub-ui/src/client/components/dock/DockEdge.stories.ts index 439ee4e6..1dd68a1e 100644 --- a/packages/hub-ui/src/client/components/dock/DockEdge.stories.ts +++ b/packages/hub-ui/src/client/components/dock/DockEdge.stories.ts @@ -64,6 +64,28 @@ export const Right: Story = edgeStory('right') /** Toolbar only — nothing selected, so the panel body is collapsed away. */ export const ToolbarOnly: Story = edgeStory('bottom', false) +/** + * Idle-collapsed: `autoCollapseEdgeToolbar` enabled with `inactiveTimeout: 0` + * (the same trick `Dock.stories.ts`'s own `Minimized` story uses) shrinks the + * toolbar down to a small corner pill immediately, with nothing selected. + */ +export const CollapsedIdle: Story = { + render: () => ({ + setup: () => mountWithContext( + { + entries: categorizedEntries, + selectedId: null, + panel: { mode: 'edge', position: 'bottom', open: false, inactiveTimeout: 0 }, + settings: { autoCollapseEdgeToolbar: true }, + }, + ctx => [ + h(DockEdge, { context: ctx }, { view: ({ entry }: any) => body(entry) }), + h(FloatingElements), + ], + ), + }), +} + /** Edge dock hosting a group — the group rail shows inside the panel. */ export const WithGroup: Story = { render: () => ({ diff --git a/packages/hub-ui/src/client/components/dock/DockEdge.vue b/packages/hub-ui/src/client/components/dock/DockEdge.vue index 5d589db2..0f4398e4 100644 --- a/packages/hub-ui/src/client/components/dock/DockEdge.vue +++ b/packages/hub-ui/src/client/components/dock/DockEdge.vue @@ -1,21 +1,31 @@ - + - context.docks.switchEntry(e?.id)" - /> - - - - - - - - context.docks.switchEntry(e?.id)" + /> + + + + - - + + + + + + + @@ -288,5 +490,24 @@ const contentClass = computed(() => { + + + + + + + + diff --git a/packages/hub-ui/src/client/components/dock/DockEmbedded.vue b/packages/hub-ui/src/client/components/dock/DockEmbedded.vue index ca3fd6d2..b3d94b9e 100644 --- a/packages/hub-ui/src/client/components/dock/DockEmbedded.vue +++ b/packages/hub-ui/src/client/components/dock/DockEmbedded.vue @@ -56,7 +56,7 @@ onUnmounted(() => { - + diff --git a/packages/hub-ui/src/client/components/views-builtin/SettingsAppearance.vue b/packages/hub-ui/src/client/components/views-builtin/SettingsAppearance.vue index ff804a9e..daebda34 100644 --- a/packages/hub-ui/src/client/components/views-builtin/SettingsAppearance.vue +++ b/packages/hub-ui/src/client/components/views-builtin/SettingsAppearance.vue @@ -129,5 +129,23 @@ function setDockMode(mode: string) { Close the {{ branding.productName }} panel when clicking outside of it (embedded mode only) + + + + { s.autoCollapseEdgeToolbar = !s.autoCollapseEdgeToolbar })" + > + + + + Auto-collapse edge toolbar + Shrink the edge-docked toolbar to a small handle when idle and closed (edge mode only) + + diff --git a/packages/hub-ui/src/client/style.css b/packages/hub-ui/src/client/style.css index 45964fc2..bfb7ea6b 100644 --- a/packages/hub-ui/src/client/style.css +++ b/packages/hub-ui/src/client/style.css @@ -101,6 +101,17 @@ ); } +/* + * Edge-mode collapse (opt-in via `settings.autoCollapseEdgeToolbar`): the + * panel itself shrinks to a small pill (see `DockEdge.vue`'s `panelStyle` + * collapsed branches) rather than fading in place — this transition just + * animates that resize + the border-radius change. + */ +#devframes-edge-panel { + --uno: transition-all duration-500; + transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1); +} + @media print { #devframes-anchor { --uno: hidden; @@ -135,4 +146,7 @@ .devframes-shake { animation: none; } + #devframes-edge-panel { + transition: none !important; + } } diff --git a/packages/hub/src/types/settings.ts b/packages/hub/src/types/settings.ts index 02eb6339..6ff453b6 100644 --- a/packages/hub/src/types/settings.ts +++ b/packages/hub/src/types/settings.ts @@ -8,4 +8,12 @@ export interface DevframeDocksUserSettings { showIframeAddressBar: boolean closeOnOutsideClick: boolean commandShortcuts: DevframeCommandShortcutOverrides + /** + * Auto-collapse the edge-mode toolbar to a small handle when idle (no + * hover or drag) and the panel content is closed, instead of permanently + * spanning the full edge. Off by default — an absent value preserves + * today's edge-mode behavior for existing users; opt in from + * Settings → Appearance. + */ + autoCollapseEdgeToolbar?: boolean } diff --git a/tests/__snapshots__/tsnapi/@devframes/hub/index.snapshot.d.ts b/tests/__snapshots__/tsnapi/@devframes/hub/index.snapshot.d.ts index 4ba6edb5..93346b37 100644 --- a/tests/__snapshots__/tsnapi/@devframes/hub/index.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/@devframes/hub/index.snapshot.d.ts @@ -125,6 +125,7 @@ export interface DevframeDocksUserSettings { showIframeAddressBar: boolean; closeOnOutsideClick: boolean; commandShortcuts: DevframeCommandShortcutOverrides; + autoCollapseEdgeToolbar?: boolean; } export interface DevframeHubContext extends DevframeNodeContext { readonly host: DevframeHost;