workbench_shell library
VS Code-style workbench layout shell.
Provides the activity-bar + sidebar + editor-area + bottom-panel + status-bar chrome. Consumer fills content via builder callbacks. Depends only on Flutter — no GetIt, no application packages.
Classes
- ActivityBarItem
- Descriptor for a single activity bar icon.
- NotificationAction
- A button rendered inside a notification card.
- NotificationHost
- Overlay anchored to the bottom-right of the workbench that renders the stacked toast cards owned by NotificationService.
- NotificationProgressController
- Controller returned by NotificationService.showProgress.
- NotificationService
- Workbench-level notification service.
- PanelLifecycle
-
Read-only handle a panel content widget consumes to react to focus
transitions. Surfaced as a ValueListenable<bool> so consumers
subscribe through the standard Flutter listenable patterns
(
ListenableBuilder,addListener). - PanelLifecycleController
-
Concrete PanelLifecycle backed by a ValueNotifier. The host
(typically
WorkbenchPanelHost) owns the controller and flips isFocused as visibility and the active tab change; panel content only sees the listenable view. - PanelTabBadge
- Typed badge payload rendered inline next to a tab label.
- ToggleBottomPanelIntent
-
Workbench command intents published by
workbench_shell. - TokenStyle
- Visual style for a single syntax token scope.
- TokenTheme
- Resolves TextMate scope strings to TokenStyle values.
- VscodeColorMap
- Parsed representation of a VS Code color theme JSON file.
- VscodeColorThemeLoader
- Parses VS Code color theme JSON into a VscodeColorMap.
- WorkbenchLayout
- VS Code-style workbench layout with activity bar, sidebar, editor area, bottom panel, and status bar.
- WorkbenchLayoutConstants
- Geometry constants for the VS Code-style workbench layout.
- WorkbenchLayoutState
- A serializable snapshot of a workbench's view-container arrangement (§spec:layout-state-persistence). Bundles the four controlled-seam concerns as container-keyed maps — pane sizes, pane order, pane expanded, and view hidden visibility — that a host reads once, hands to its own storage, and hands back at startup. A host that persists and rehydrates this one value restores a user's sidebar arrangement across restarts without deriving any map shape or writing reconcile/reorder logic of its own.
- WorkbenchMenuActionEntry
-
Base for entries that dispatch an Intent when selected. The host
registers an
Action<Intent>for the intent's runtime type at the widget that owns the target state; the shell does not constrain the intent shape — each entry carries its own. - WorkbenchMenuBar
- Platform-aware workbench menu bar.
- WorkbenchMenuCheckbox
-
A checkable command. checked is the host's value, owned through
the same controlled/uncontrolled seam as every other property
(§spec:layout-customization): the entry reports the current state and
the host updates it via the intent's
Action. Renders a realCheckboxMenuButtonmark in-window; degrades to a leading "✓ " glyph on the macOS native menu, which carries no checked field. - WorkbenchMenuEntry
- A node in the View menu's descriptor tree (§spec:menu-model). The shell renders the tree platform-agnostically: a PlatformMenu tree on macOS, a Material SubmenuButton tree in-window. Hosts build the tree; the shell owns only the rendering.
- WorkbenchMenuRadio
-
A radio command. Radio entries listed together in one submenu read
as a mutually-exclusive set: exactly one carries selected
true. Renders a realRadioMenuButtonmark in-window; degrades to a leading "✓ " glyph on the macOS native menu, as WorkbenchMenuCheckbox does. - WorkbenchMenuSeparator
- A divider between adjacent menu groups. Leading and trailing separators, and runs of consecutive separators, collapse to nothing.
-
A nested submenu — a label plus its own children tree. Nests
natively on every platform (
PlatformMenuon macOS,SubmenuButtonin-window), so it needs no degradation. - WorkbenchNotification
- A live notification managed by NotificationService.
- WorkbenchPanel
- Single declaration of one bottom-panel tab.
- WorkbenchPanelHost
- Composes a list of WorkbenchPanel descriptors into the View menu, tab strip, keyboard-shortcut map, and per-panel PanelLifecycle signaling — the four surfaces consumers used to maintain in parallel.
- WorkbenchPanelScope
- Scope handed to WorkbenchPanelHost.builder: pre-composed pieces the consumer wires into the surrounding chrome.
- WorkbenchPanelTab
- Descriptor for one tab in a WorkbenchTabbedPanel.
- WorkbenchShortcuts
- Keyboard shortcut wrapper for the one command the shell defaults: Cmd/Ctrl+J to toggle the bottom panel.
- WorkbenchStatusBar
- Container for status-bar items at the bottom of the workbench.
- WorkbenchStatusBarAction
- Tappable status-bar affordance: optional icon + label + onTap. Use for items that trigger an action (e.g. open a dialog, focus a tab) — never for panel-visibility toggles.
- WorkbenchStatusBarItem
- Read-only status indicator: optional icon + label.
- WorkbenchStatusBarProblemsItem
- VS Code-style "Problems" status-bar indicator: three role-coloured counts (errors, warnings, info) sharing a single tap target.
- WorkbenchTabbedPanel
- Tabbed bottom-panel chrome primitive.
- WorkbenchTheme
- Color and typography tokens for workbench layout chrome and content primitives.
- WorkbenchThemeController
- Owns active workbench theme state and exposes a theme-list / pick API.
- WorkbenchThemeEntry
- An entry in a WorkbenchThemeController's theme list.
- WorkbenchViewContainer
- Renders an ordered list of WorkbenchViewDescriptors as a flush stack of WorkbenchViewPanes (§spec:view-stack), the VS Code view-container model.
- WorkbenchViewContainerSpec
-
Typed spec for one activity-bar view container (§spec:view-stack). The
host returns one per container id from
WorkbenchLayout.containerBuilder, replacing the retired free-formsidebarBuilderwidget slot (§spec:capability-boundary): the host supplies typed view descriptors, not a sidebar-body widget. - WorkbenchViewDescriptor
- Typed descriptor for one view in a WorkbenchViewContainer (§spec:view-stack). The host supplies an ordered list of these — never a free-form sidebar-body widget — and the container renders the stack.
- WorkbenchViewMenuTab
- A command leaf the View menu can select. The shell does not own tab content (see package SPEC §spec:tabbed-panel); it only owns the menu chrome.
- WorkbenchViewPane
- Structural primitives for sidebars and bottom panels.
- WorkbenchViewWelcome
-
Canonical empty-view content — the port of VS Code's view-welcome
surface (the
viewsWelcomecontribution): stacked paragraphs and full-width buttons in a column, buttons capped at WorkbenchLayoutConstants.viewWelcomeButtonMaxWidth and centered. Replaces the former icon-hero empty state, which had no canon counterpart (§spec:structural-primitives).
Enums
- ActivityBarZone
- Zone within the activity bar where an item icon renders.
- NotificationSeverity
- Severity for a Notification.
- WorkbenchPanelAlignment
-
How the bottom panel aligns across the workbench width (§spec:panel-alignment):
centerspans the editor only (both side bars run full height past it — the §spec:workbench-layout default),justifyspans the full width (neither side bar runs past it),leftabuts the left edge's bar (which runs full height) and spans the rest, andrightmirrorsleft. Each value is two booleans — does the left-edge bar group and the right-edge bar group run full height (outside the panel's band) or stop at the panel's top (inside it) — realized by where the panel sits in the widget tree, not a layout solver. - WorkbenchSidebarPosition
-
Which editor edge the primary side bar (with its activity bar) occupies
(§spec:sidebar-position). Named rather than a boolean because the secondary
side bar (§spec:secondary-sidebar) derives its edge as "opposite the
primary", which reads where "opposite
false" does not.
Extensions
- NotificationSeverityPersistence on NotificationSeverity
- Convenience predicate for the persistence rule (SPEC §spec:notification-center "Dismissal policy by severity"). Warning, error, and progress cards stay until manually or programmatically dismissed; info and success auto-dismiss.
- WorkbenchThemeContentBorder on WorkbenchTheme
- Helper for content-primitive widgets that need a concrete Color regardless of whether the theme suppresses the chrome panel border. When WorkbenchTheme.panelBorder is null the helper falls through to Colors.transparent — content primitives outside the workbench chrome still lay out identically, they just render edgelessly.
- WorkbenchThemeExtension on BuildContext
- Convenience accessor for WorkbenchTheme from BuildContext.
- WorkbenchThemeNotificationSeverity on WorkbenchTheme
- Severity-keyed accents for notification cards. Reuses the existing semantic-status tokens (WorkbenchTheme.infoForeground, etc.) so notification chrome stays consistent with other severity-aware surfaces (gutter icons, problems panel, etc.).
Constants
- viewPaneHeaderFocusRingKey → const Key
- Keys the focus-ring DecoratedBox that wraps every view-pane header (§spec:view-pane-focus). The ring reserves a constant 1px border — painted WorkbenchTheme.focusBorder while focused, transparent at rest — so gaining or losing focus never reflows the header.
Functions
-
applyWorkbenchChrome(
ThemeData base, WorkbenchTheme chrome) → ThemeData -
Compose the workbench chrome's Material theming onto a host's
baseThemeData. -
buildMaterialMenuChildren(
BuildContext context, List< WorkbenchMenuEntry> entries) → List<Widget> -
Renders a WorkbenchMenuEntry tree as in-window Material menu children
(§spec:menu-model): separators become a Divider, submenus nest a
SubmenuButton, and command-bearing entries render an enable-aware
checkbox/radio/command button bound to the host's
Action<Intent>. -
workbenchMenuThemeData(
BuildContext context) → ThemeData -
Forces in-window Material menu chrome —
MenuBar,MenuAnchor,SubmenuButton,MenuItemButton,CheckboxMenuButton— to read from WorkbenchTheme rather than the ambient ThemeData. macOS's system menu bar is untouched; it renders throughPlatformMenuBar(NSMenu), which ignores Material theming.
Typedefs
- PanelContentBuilder = Widget Function(BuildContext context, PanelLifecycle lifecycle)
- Builder signature for panel content. Receives the surrounding BuildContext and the per-panel PanelLifecycle so content widgets can subscribe to focus transitions (replay an animation when refocused, pause heavy work when blurred, etc.).
- WorkbenchPanelScopeBuilder = Widget Function(BuildContext context, WorkbenchPanelScope scope)
- Builder signature for WorkbenchPanelHost.builder.