Skip to content
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

A run & debug dropdown with default button #128022

Merged
merged 3 commits into from
Jul 6, 2021
Merged

Conversation

weinand
Copy link
Contributor

@weinand weinand commented Jul 5, 2021

This PR fixes #117722

This is my first attempt for a dropdown menu that remembers a default action.

The PR introduces an alternative UI for submenus:
If a "storageKey" attribute is specified for a submenu, the submenu is shown in the UI as a dropdown menu with a button that executes the last action run from the dropdown. The default action is persisted in workspace storage under the "storageKey".

This alternate UI is generic (independent from debug's run & debug functionality).
However, this PR configures the alternate UI for the "editor/title/run" contribution point.

The UI looks like this:

123995386-9159bd80-d9ce-11eb-8665-38e866a4536a

@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label Jul 5, 2021
@weinand weinand added this to the July 2021 milestone Jul 5, 2021
@weinand weinand changed the title run dropdown with default A run & debug dropdown with default button Jul 5, 2021
@weinand weinand assigned weinand and unassigned jrieken Jul 5, 2021
@weinand weinand requested a review from jrieken July 5, 2021 22:25
@@ -304,14 +308,142 @@ export class SubmenuEntryActionViewItem extends DropdownMenuActionViewItem {
}
}

class DropdownWithDefauktActionViewItem extends BaseActionViewItem {
Copy link
Contributor

Choose a reason for hiding this comment

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

Defaukt is probably intended to be Default

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed - thanks for spotting this.

Copy link
Member

@jrieken jrieken left a comment

Choose a reason for hiding this comment

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

Very neat!

Maybe find a more explicit name for ISubmenuItem#storageKey or make it a boolean, like rememberDefaultAction, and derive the storage key from the menu identifier

@weinand
Copy link
Contributor Author

weinand commented Jul 6, 2021

Yeah, I was using the menu identifier as a storage key before but decided differently when polishing the PR... ;-)
But you are right: there is no real need to configure the storage key.

@weinand
Copy link
Contributor Author

weinand commented Jul 6, 2021

Incorporated @jrieken's feedback.

@weinand weinand merged commit 3918b3e into main Jul 6, 2021
@weinand weinand deleted the aweinand/splitRunDropdown branch July 6, 2021 09:56
@github-actions github-actions bot locked and limited conversation to collaborators Aug 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Feedback for contribution point "editor/title/run"
3 participants