Skip to content

Use menu title actions instead of PositronActionBar for the Packages pane#12950

Merged
bricestacey merged 14 commits intomainfrom
12922/use-vscode-menu-actions
Apr 14, 2026
Merged

Use menu title actions instead of PositronActionBar for the Packages pane#12950
bricestacey merged 14 commits intomainfrom
12922/use-vscode-menu-actions

Conversation

@bricestacey
Copy link
Copy Markdown
Contributor

See #12922

This PR uses the built-in vscode title menu actions instead of the PositronActionBar. The result is that the action buttons appear on the same row as the view's title. This behavior will provide a more native and consistent experience with vscode.

This also removes the active session label. Users should use the session picker in the top right to understand the current foreground session.

Screenshot 2026-04-09 at 11 17 48 PM

QA Notes

Behavior should basically be the same as before.

@:packages-pane

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 10, 2026

E2E Tests 🚀
This PR will run tests tagged with: @:critical @:packages-pane

readme  valid tags

await MultiStepInput.run(accessor, (input) => pickVersion(input, state), cts);
} else {
await MultiStepInput.run(accessor, (input) => showLoading(input, state), cts);
await MultiStepInput.run(accessor, (input) => pickPackage(input, state), cts);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the changes to this file fix an unrelated bug where Update and Uininstall commands don't work correctly form the command palette.

updateBusy();
}));
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this seems convoluted, but it kinda just maintains the status quo, delegating the state to the context key.

I am open to improving this, but just not sure the right way forward.

Replace the React-based PositronActionBar with VSCode's native
MenuId.ViewTitle menu system. Actions now appear in the view title bar:
- Refresh as an icon button in the navigation group
- Install, Update All, Update, Uninstall in the overflow menu

Add context keys to control action enablement:
- positronPackages.hasActiveSession
- positronPackages.isBusy
- positronPackages.hasSelectedPackage

See #12922
Move busy/session checks from menu 'when' (visibility) to action
'precondition' (enablement) so actions are disabled when busy
instead of hidden.

See #12922
When Update/Uninstall commands are invoked from the ViewTitle menu,
they now use the selected package from the service instead of
requiring a command argument. This restores the previous behavior
where selecting a package in the list would allow Update/Uninstall
to operate on that package.

- Add selectedPackage property and setSelectedPackage() to service
- Update listPackages.tsx to set selected package via service
- Update commands to use service.selectedPackage as fallback

See #12922
Separate global command availability from menu visibility:
- Commands use simple precondition (POSITRON_PACKAGES_ENABLED) for global access
- Menu items use `when` clause to hide when no package selected

See #12922
- Remove showLoading functions that created unawaited quick picks,
  causing the CancellationTokenSource to be canceled when replaced
- Use package name instead of displayName for API calls
- Remove selectedPackage fallback from command handlers

See #12922
- Add UpdateSelectedPackageAction and UninstallSelectedPackageAction
  wrapper commands that pass the selected package to the main commands
  when invoked from the ViewTitle menu
- Keep main Update/Uninstall commands for command palette (always show
  quick pick)
- Simplify selectedPackage from boolean context key + property to a
  single string context key
- Add PACKAGES_CAN_RUN_ACTION precondition to Update/Uninstall commands

See #12922
Move PACKAGES_HAS_SELECTION from menu `when` clause to `precondition`
so Update/Uninstall menu items are visible but disabled (grayed out)
when no package is selected, rather than hidden.

See #12922
- Delete unused PackagesInstanceMenuButton component
- Update e2e test to not check for version button (no longer exists)
- Minor style: use Boolean() instead of !! for context key

See #12922
@bricestacey bricestacey force-pushed the 12922/use-vscode-menu-actions branch from a63862c to 896706e Compare April 13, 2026 13:08
The Package Actions dropdown was removed in favor of ViewTitle menu
actions. Update the page object to click the overflow menu (More
Actions button) and select Install Package from there.

See #12922
- Use contextMenu.triggerAndClick() for robust menu handling across
  native and web contexts
- Wait for API search results before selecting package
- Use selectQuickInputElementContaining for partial match on results

See #12922
softwarenerd
softwarenerd previously approved these changes Apr 13, 2026
Copy link
Copy Markdown
Contributor

@softwarenerd softwarenerd left a comment

Choose a reason for hiding this comment

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

Looks OK, to me.

@@ -38,14 +48,21 @@ export class PositronPackagesService extends Disposable implements IPositronPack
* @param _runtimeSessionService The language runtime service.
* @param _editorService The editor service.
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.

Stale parameter - no longer used.

@bricestacey bricestacey merged commit a029b0a into main Apr 14, 2026
19 checks passed
@bricestacey bricestacey deleted the 12922/use-vscode-menu-actions branch April 14, 2026 02:50
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants