-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Review usage/overrides of get.*Actions on ViewPanes #92038
Comments
Looking a little more at this, there may be other uses? |
@sbatten @sandy081 I wanted to follow up on a related topic, not sure if it is the same as this issue: today, That API should be deprecated imho and removed in favour of registering commands to Menu locations, as we e.g. do with all editor related actions in the editor tool bar. There should be no reason that any piece of UI is required to return actions upfront from these methods and every location should be capable of receiving actions with proper menu contributions and commands. Example for the proper way of registering actions:
|
@sbatten Not sure if I understand this debt item. Can you please elaborate more? |
I also quickly looked into this then and figured out that there are some actions which need
|
FWIW, When adding commands to the Timeline view -- I first added them through the |
@eamodio Can you please provide an example of the complexity and indirection you mentioned. At the end you need to have a logical condition to show an action in |
Ultimately it turned out not to be a big deal -- I converted Timeline back to using the |
If I understand the desired action from @bpasero and @sandy081, this is the list of usages that should be migrated. Perhaps we can have view owners migrate during upcoming debt week. vscode/src/vs/workbench/contrib/comments/browser/commentsView.ts Lines 122 to 129 in 15c02dc
vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.ts Lines 231 to 237 in c650757
vscode/src/vs/workbench/contrib/debug/browser/callStackView.ts Lines 182 to 188 in 7653d83
vscode/src/vs/workbench/contrib/debug/browser/repl.ts Lines 446 to 456 in e3a36fa
vscode/src/vs/workbench/contrib/debug/browser/variablesView.ts Lines 153 to 155 in 9a2062f
vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.ts Lines 153 to 159 in de3e5a4
vscode/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts Lines 923 to 930 in 86161ff
vscode/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts Lines 1020 to 1029 in 86161ff
vscode/src/vs/workbench/contrib/files/browser/views/explorerView.ts Lines 287 to 298 in 187dedb
vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts Lines 308 to 314 in 7653d83
vscode/src/vs/workbench/contrib/outline/browser/outlinePane.ts Lines 411 to 417 in 7bd4ccb
vscode/src/vs/workbench/contrib/remote/browser/tunnelView.ts Lines 575 to 577 in 25e889a
vscode/src/vs/workbench/contrib/scm/browser/repositoryPane.ts Lines 1062 to 1073 in 1a95f31
vscode/src/vs/workbench/contrib/search/browser/searchView.ts Lines 1779 to 1787 in 79a1f5a
vscode/src/vs/workbench/contrib/terminal/browser/terminalView.ts Lines 131 to 145 in 8a56212
vscode/src/vs/workbench/contrib/outline/browser/outlinePane.ts Lines 419 to 436 in 7bd4ccb
vscode/src/vs/workbench/contrib/scm/browser/repositoryPane.ts Lines 1074 to 1076 in 1a95f31
|
@isidorn Sorry that my previous list was missing one view (CallStacksView). Added it and assigned to you. |
@sandy081 somehow I missed that one. I just pushed a commit that tackles that. Thanks |
@eamodio FYI I started with this for SCM. |
Edit: I was convinced in ZH's standup to push this ahead. Please ignore my rant below. @sbatten I started this for SCM: https://github.com/microsoft/vscode/compare/joao/scm-menu-actions After 1 hour of work I'm not even 10% done, so I decided to pause it. There are usually two reasons for forcing everyone to invest their time in large refactorings:
Today, actions in SCM work just fine and don't leak. Jumping to menus is a big investment since not only all actions need to be converted but all the view state they depend on needs to be accessible via context keys. This is considerable effort, even without the fixing of the eventual bugs which always come after a large refactoring. I can see that moving to menus could enable user customizable menus in the future. But until this is on the near future plan, I do not think it is reasonable to invest so much time in refactoring for no added immediate benefit. How necessary is it that all parts of Code move and could we maintain both menus and getActions until we decide to implement a feature which actually depends on views only having actions via menus? |
Might just push this out to February's debt week, since it's hard to do a staged rollout of this. |
Thanks @joaomoreno - I also updated the description with the benefits and reasons behind this. |
I started this but will also push it to Feb so it gets more testing before stable. |
I've done my piece here. It was a lot of changes so I'll also be on the lookout for issues but the terminal action code is in a much better shape as a result of this, thanks! |
With the introduction of View Menu Actions its possible for ViewPanes to accidentally override them. We should verify if this is happening and consider if we still want View Menu Actions with DnD for views already introduced.
/cc @eamodio
Updated Description
Currently
ViewPanes
andViewPaneContainers
can contribute Primary, Secondary and ContextMenu actions in following waysPrimary actions
getActions
navigation
groupnavigation
groupSecondary actions
getSecondaryActions
Context menu actions
getContextMenuActions
We would like to move away from
get*Actions
and use Menu registry becauseI will be removing the
get*Actions
method after everyone move away from it. I listed the existing consumers of this and assigned the respective owner. Please adopt using Menu registries.Here are some tips that might help you while adopting
getActionViewItem
like before and provide custom implementation.Example:
vscode/src/vs/workbench/contrib/markers/browser/markersView.ts
Lines 852 to 857 in af29768
Example:
vscode/src/vs/workbench/contrib/outline/browser/outlinePane.ts
Lines 641 to 660 in 56e35cf
To Adopt
Search - @roblourens
vscode/src/vs/workbench/contrib/search/browser/searchView.ts
Line 1849 in 2ecb47d
Terminal - @Tyriar @meganrogge
vscode/src/vs/workbench/contrib/terminal/browser/terminalView.ts
Line 157 in 0ef0d2d
The text was updated successfully, but these errors were encountered: