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

Enabled movable Custom Views #89240

Merged
merged 5 commits into from
Jan 27, 2020
Merged

Conversation

sbatten
Copy link
Member

@sbatten sbatten commented Jan 24, 2020

This PR refs #85164

  • Updates the tree view to enable updating of the styling
  • Add events to ViewDescriptorService that allow listening for Container and Location change
  • Add methods to ViewDescriptorService to get the view location. This works even before the container is registered and will trigger an event if the cached data turns out to be stale.
  • Outline follows similar logic so included as well

@sbatten sbatten added this to the January 2020 milestone Jan 24, 2020
@sbatten sbatten self-assigned this Jan 24, 2020
@sbatten sbatten changed the title custom views are tricky Enabled movable Custom Views Jan 24, 2020
@sbatten sbatten marked this pull request as ready for review January 24, 2020 17:49
Copy link
Member

@sandy081 sandy081 left a comment

Choose a reason for hiding this comment

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

Reviewed changes in ViewDescriptorService. Requested one change.
Approving it expecting that requested change is taken care of.

Thanks.

@@ -230,7 +236,7 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor
this._register(this.viewsRegistry.onViewsRegistered(({ views, viewContainer }) => this.onDidRegisterViews(views, viewContainer)));
this._register(this.viewsRegistry.onViewsDeregistered(({ views, viewContainer }) => this.onDidDeregisterViews(views, viewContainer)));

this._register(this.viewsRegistry.onDidChangeContainer(({ views, from, to }) => { this.removeViews(from, views); this.addViews(to, views); }));
this._register(this.viewsRegistry.onDidChangeContainer(({ views, from, to }) => { this.removeViews(from, views); this.addViews(to, views); this._onDidChangeContainer.fire({ views, from, to }); }));
Copy link
Member

Choose a reason for hiding this comment

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

I think we shall also check location change here even though currently location change is not yet supported in registry. This should be ready for future if it is allowed.

I would recommend to have a single method that can be reused when views are moved in registry or in cache.

this.removeViews(from, views);
 this.addViews(to, views);

  const oldLocation = this.viewContainersRegistry.getViewContainerLocation(from)!;
 const newLocation = this.viewContainersRegistry.getViewContainerLocation(to)!;

  if (oldLocation !== newLocation) {
 	this._onDidChangeLocation.fire({ views, from: oldLocation, to: newLocation });
 }

 this._onDidChangeContainer.fire({ views, from, to });

Copy link
Member Author

Choose a reason for hiding this comment

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

@sandy081 thanks, will take care of this.

@sbatten
Copy link
Member Author

sbatten commented Jan 24, 2020

It would still be great to get approval from:
@joaomoreno on TreeView styling changes
@alexr00 for general CustomView updates

Copy link
Member

@joaomoreno joaomoreno left a comment

Choose a reason for hiding this comment

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

Changes in listService make sense!

Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

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

The custom view changes look good!

@sandy081 sandy081 merged commit 5963a8e into microsoft:master Jan 27, 2020
@sandy081
Copy link
Member

@sbatten Merging the PR as we have all approvals.
I will also take care of doing the change I suggested after merging.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants