Skip to content

Commit 6d77a77

Browse files
antfubotdvcolomban
andcommitted
feat(hub,hub-ui): collapsible edge-mode toolbar with drag-to-snap positioning
Ports vitejs/devtools#523 to the hub-ui edge-docked shell: - Adds an opt-in "Auto-collapse edge toolbar" setting (Settings → Appearance): when idle and closed, the edge-docked toolbar shrinks to a small corner pill instead of permanently spanning the full edge, mirroring Dock.vue's own minimize animation. Hovering the pill brings it back. The pill anchors at the corner nearest the toolbar's entries, away from the "Edge position"/"Float mode" buttons. - The "Edge position" button now also acts as a drag handle, letting the whole edge-docked panel be dragged and snapped among the four viewport edges without transitioning through float mode mid-drag. - Adds `autoCollapseEdgeToolbar` to the hub's `DevframeDocksUserSettings` (@devframes/hub/types), since the toggle isn't specific to any single viewer. Closes #209. Co-authored-by: dvcolomban <dinh-van.colomban@contentsquare.com>
1 parent e3c6fe7 commit 6d77a77

8 files changed

Lines changed: 358 additions & 74 deletions

File tree

packages/hub-ui/src/client/.generated/css.ts

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

packages/hub-ui/src/client/components/dock/DockEdge.stories.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,28 @@ export const Right: Story = edgeStory('right')
6464
/** Toolbar only — nothing selected, so the panel body is collapsed away. */
6565
export const ToolbarOnly: Story = edgeStory('bottom', false)
6666

67+
/**
68+
* Idle-collapsed: `autoCollapseEdgeToolbar` enabled with `inactiveTimeout: 0`
69+
* (the same trick `Dock.stories.ts`'s own `Minimized` story uses) shrinks the
70+
* toolbar down to a small corner pill immediately, with nothing selected.
71+
*/
72+
export const CollapsedIdle: Story = {
73+
render: () => ({
74+
setup: () => mountWithContext(
75+
{
76+
entries: categorizedEntries,
77+
selectedId: null,
78+
panel: { mode: 'edge', position: 'bottom', open: false, inactiveTimeout: 0 },
79+
settings: { autoCollapseEdgeToolbar: true },
80+
},
81+
ctx => [
82+
h(DockEdge, { context: ctx }, { view: ({ entry }: any) => body(entry) }),
83+
h(FloatingElements),
84+
],
85+
),
86+
}),
87+
}
88+
6789
/** Edge dock hosting a group — the group rail shows inside the panel. */
6890
export const WithGroup: Story = {
6991
render: () => ({

0 commit comments

Comments
 (0)