Skip to content

fix(core): render single overflow dock entry inline instead of behind overflow button - #486

Merged
antfu merged 1 commit into
mainfrom
fix/dock-overflow-single-item
Jul 28, 2026
Merged

fix(core): render single overflow dock entry inline instead of behind overflow button#486
antfu merged 1 commit into
mainfrom
fix/dock-overflow-single-item

Conversation

@antfubot

@antfubot antfubot commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Description

The dock bar shows a DockOverflowButton (a badge + popover) once entries exceed maxVisibleItems. Hiding a single overflowing entry behind a whole button+popover is unnecessary overhead, so it now renders inline instead.

This is implemented at the split-algorithm level rather than in the component template: docksSplitGroupsWithCapacity gains an opt-in foldSingleOverflow option — when exactly one entry would overflow, it's folded back into visible (in the slot the overflow affordance would have occupied) instead of being handed to the caller as overflow. Dock.vue opts into it for the bar; DockGroupSidebar.vue's own "show more" rail button is untouched (default behavior unchanged) since it has different overflow-affordance semantics. DockOverflowButton still renders as before once two or more entries overflow.

Added unit tests for the new option in dock-sidebar-capacity.test.ts and a SingleOverflowItem Storybook story (Dock.stories.ts) demonstrating the inline behavior.

Linked Issues

Additional context

None.


This PR was created with the help of an agent.

@pkg-pr-new

pkg-pr-new Bot commented Jul 28, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vitejs/devtools

npm i https://pkg.pr.new/@vitejs/devtools@486

@vitejs/devtools-kit

npm i https://pkg.pr.new/@vitejs/devtools-kit@486

@vitejs/devtools-oxc

npm i https://pkg.pr.new/@vitejs/devtools-oxc@486

@vitejs/devtools-rolldown

npm i https://pkg.pr.new/@vitejs/devtools-rolldown@486

@vitejs/devtools-vite

npm i https://pkg.pr.new/@vitejs/devtools-vite@486

@vitejs/devtools-vitest

npm i https://pkg.pr.new/@vitejs/devtools-vitest@486

commit: 830bb05

@antfu
antfu merged commit b5b1db6 into main Jul 28, 2026
10 checks passed
@antfu
antfu deleted the fix/dock-overflow-single-item branch July 28, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants