Skip to content

Add regression tests for single-item Activity Bar overflow - #345329

Merged
SteVen Batten (sbatten) merged 2 commits into
mainfrom
agents/avoid-single-item-overflow-activity-bar
Oct 31, 2026
Merged

SteVen Batten (sbatten) merged 2 commits into
mainfrom
agents/avoid-single-item-overflow-activity-bar

Conversation

@sbatten

Copy link
Copy Markdown
Member

Fixes #187737

The current composite bar already avoids an "Additional Views" overflow with a single item: each action is the same size as the overflow control, so once views overflow one slot goes to the overflow control and at least two views are always hidden. This PR adds regression tests (src/vs/workbench/test/browser/parts/compositeBar.test.ts, suite "CompositeBar overflow") that lock that in across classic, compact, modern, modern compact, modern sidebar-right and modern compact-density layouts. They sweep heights to check that exactly one hidden view never happens, that the overflow menu shows every hidden view, and that a selected overflow view is promoted back into the bar. There are no production changes.

Runtime screenshots across all six layouts confirmed the same behavior: at fit−1, two views are hidden (Run and Debug, Extensions), no height leaves exactly one view hidden, and selecting Extensions promotes it back into the bar.

How to test

  • ./scripts/test.sh --run src/vs/workbench/test/browser/parts/compositeBar.test.ts --run src/vs/workbench/test/browser/parts/activitybarPart.test.ts --run src/vs/workbench/test/browser/parts/compositeBarActions.test.ts: passed (40 passing, 1 pending)
  • npm run eslint -- src/vs/workbench/test/browser/parts/compositeBar.test.ts: passed (no problems)

Covers #187737: the composite bar never hides exactly one view behind the
Additional Views overflow across classic, compact, modern and floating-panel
layouts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 31, 2026 02:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain, although the tests were not independently run during this review.

No open issues 🎉

What changed in this PR

Adds regression tests for Activity Bar overflow behavior related to #187737, locking in the existing equal-size layout behavior without changing production code.

Changes:

  • Checks overflow boundaries and sweeps heights to ensure exactly one view never overflows.
  • Verifies overflow menu contents, active-view visibility, and promotion of a selected hidden view.
  • Checks rendered item sizes and spacing across classic, compact, and floating layouts.

No actionable findings remain. Tests were not independently run during this review.

File Description
src/​vs/​workbench/​test/​browser/​parts/​compositeBar.test.ts Adds overflow, menu interaction, and rendered-layout regression tests.

Review effort: Balanced

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sbatten

Copy link
Copy Markdown
Member Author

🤖 Fixed the CI compile failure (TS2554 at compositeBar.test.ts:201): the test now passes an action to getCheckedActionsRepresentation, which takes a required action argument. Typecheck, ESLint, and the targeted unit tests pass locally. Commit: 3c4e13a.

@sbatten
SteVen Batten (sbatten) merged commit 0861b77 into main Oct 31, 2026
55 checks passed
@sbatten
SteVen Batten (sbatten) deleted the agents/avoid-single-item-overflow-activity-bar branch October 31, 2026 16:18
@vs-code-engineering vs-code-engineering Bot added this to the 1.145.0 milestone Oct 31, 2026
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.

"Additional Views" in Activity Bar should show up only when there's more than one item

3 participants