-
Notifications
You must be signed in to change notification settings - Fork 34.5k
Add movable property to views and add toggle view commands #88823
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
see update to description |
if (viewDescriptor.canMoveView) { | ||
result.push(<IAction>{ | ||
id: `${viewDescriptor.id}.removeView`, | ||
label: this.isViewMergedWithContainer() ? nls.localize('toggleSpecificViewLocation', "Toggle {0} View Location", viewDescriptor.name) : nls.localize('toggleViewLocation', "Toggle View Location"), |
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.
Why not show the view name always?
src/vs/workbench/services/views/browser/viewDescriptorService.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/services/views/browser/viewDescriptorService.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/services/views/browser/viewDescriptorService.ts
Outdated
Show resolved
Hide resolved
@sandy081 updated with what we discussed. one issue that arose with the panel context menu entry is that we can only get this entry information once the panel (meaning the specific composite) has been instantiated. with that limitation, the move to sidebar command will only show when you right click the active panel header. this is still much better than how it was working this morning. If you have any desired changes, feel free to make them and merge the PR. |
- Use this menu id to get context menu action for a view
@sbatten Did following changes
|
Merging!!! |
refs #85164
this is not compiling right now because i paused in the middle of a change.@sandy081 this is just a PR so you can see where my head is at. There are lot of things hacked together to see this working and play with different ideas while I sort it out. The most hacky stuff comes around where we actually surface the menu entries. I notice that panel headers do not have the same context menu luxuries that the viewlet has due to the composite bar and view headers being a combined concept for panel.
Notes from implementation:
Update: Moved logic into the service and moved service to its own filed due to cyclic dependency issue.
when a view is moved to the panel and then the window is reloaded, the view descriptor service needs to be able to create the cached view container at the point of the views registration because the container was created on the fly previously.
the cache may need to be enhanced to store that a cached view container was auto-generated and not registered the traditional way as well as the location info about that view container so it can be recreated.
Update: the cache now stores the id of the container along with its source view id and location if it is auto generated.
Update: by using the source view id to regenerate the id, we assume that the source view will be registered at some point. if it is not, we move the pending view back to its default location. this is the same logic as containers contributed by extensions.
/Cc @isidorn