Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ export const HigherCapacity: Story = {
args: { maxVisibleItems: 9 },
}

/** `maxVisibleItems: 8` — exactly one entry overflows, so it renders inline instead of behind the overflow button. */
export const SingleOverflowItem: Story = {
...floatStory({ entries: overflowEntries, panel: { position: 'bottom', left: 50, top: 100, inactiveTimeout: -1 } }),
args: { maxVisibleItems: 8 },
}

/** `glowSize: 280`, `glowBlur: 90` — a larger, softer ambient glow. */
export const LargeGlow: Story = {
...floatStory({ entries: categorizedEntries, panel: { position: 'bottom', left: 50, top: 100, inactiveTimeout: -1 } }),
Expand Down
14 changes: 13 additions & 1 deletion packages/core/src/client/webcomponents/components/dock/Dock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ const splitEntries = computed(() => {
return docksSplitGroupsWithCapacity(groupedEntries.value, layout.value.maxVisibleItems)
})

const overflowCount = computed(() => splitEntries.value.overflow.reduce((acc, [, items]) => acc + items.length, 0))

const selectedEntry = computed(() => {
return context.docks.selected
})
Expand Down Expand Up @@ -311,7 +313,17 @@ onMounted(() => {
@select="(e) => context.docks.switchEntry(e?.id)"
/>

<template v-if="splitEntries.overflow.length > 0">
<template v-if="overflowCount === 1">
<div class="border-base m1 h-20px w-px border-r-1.5" />
<DockEntriesWithCategories
:context="context"
:groups="splitEntries.overflow"
:is-vertical="context.panel.isVertical"
:selected="selectedEntry"
@select="(e) => context.docks.switchEntry(e?.id)"
/>
</template>
<template v-else-if="overflowCount > 1">
<div class="border-base m1 h-20px w-px border-r-1.5" />
<DockOverflowButton
:context="context"
Expand Down
Loading