Skip to content

Commit cc8dbb7

Browse files
antfubotdvcolombanantfu
authored
feat(hub,hub-ui): collapsible edge-mode toolbar with drag-to-snap positioning (#219)
Co-authored-by: dvcolomban <dinh-van.colomban@contentsquare.com> Co-authored-by: Anthony Fu <github@antfu.me>
1 parent ce369c1 commit cc8dbb7

7 files changed

Lines changed: 357 additions & 73 deletions

File tree

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)