-
Notifications
You must be signed in to change notification settings - Fork 37.9k
Add compact layout support for Activity Bar #294881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @bpaseroMatched files:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces an opt-in compact layout mode for the Activity Bar by adding a new configuration setting and refactoring Activity Bar sizing to be driven by CSS custom properties, with accompanying unit tests to validate sizing and style updates.
Changes:
- Added
workbench.activityBar.compactsetting and registered it in the configuration schema. - Updated
ActivitybarPartand related CSS to support compact vs default sizing via CSS variables (width, action height, icon size). - Added browser unit tests to validate size constraints, CSS variables, and change events when toggling the setting.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/test/browser/parts/activitybar/activitybarPart.test.ts | Adds unit tests for compact/default sizing behavior and CSS variable updates. |
| src/vs/workbench/services/layout/browser/layoutService.ts | Introduces LayoutSettings.ACTIVITY_BAR_COMPACT constant. |
| src/vs/workbench/browser/workbench.contribution.ts | Registers the new workbench.activityBar.compact setting in the configuration schema. |
| src/vs/workbench/browser/parts/paneCompositeBar.ts | Updates URI icon mask sizing to allow overriding via --activity-bar-icon-size. |
| src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css | Switches Activity Bar width to --activity-bar-width with fallback. |
| src/vs/workbench/browser/parts/activitybar/media/activityaction.css | Refactors Activity Bar action dimensions and icon size to CSS variables; adjusts badge/profile overlay for compact mode. |
| src/vs/workbench/browser/parts/activitybar/activitybarPart.ts | Implements compact mode toggling, updates min/max width constraints, sets CSS variables, and recreates the composite bar on change. |
| build/lib/stylelint/vscode-known-variables.json | Adds the new custom properties to the stylelint known-variables allowlist. |
| test('filter by command id', async () => { | ||
| const id = 'workbench.action.increaseViewSize'; | ||
| const id = 'workbench.action.view.size.' + uuid.generateUuid(); | ||
| registerCommandWithTitle(id, 'some title'); | ||
| prepareKeybindingService(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is going on here?
Introduce a compact layout option for the Activity Bar, allowing users to adjust dimensions and icon sizes. Refactor existing styles to utilize CSS variables for better customization and add unit tests to ensure proper functionality of the new layout features.