Skip to content

Enabled movable Custom Views - #89240

Merged
Sandeep Somavarapu (sandy081) merged 5 commits into
microsoft:masterfrom
sbatten:customViewUpdate
Jan 27, 2020
Merged

Sandeep Somavarapu (sandy081) merged 5 commits into
microsoft:masterfrom
sbatten:customViewUpdate

Conversation

@sbatten

@sbatten SteVen Batten (sbatten) commented Jan 24, 2020 •

Copy link
Copy Markdown
Member

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 SteVen Batten (sbatten) changed the title custom views are tricky Enabled movable Custom Views Jan 24, 2020
@sbatten
SteVen Batten (sbatten) marked this pull request as ready for review January 24, 2020 17:49

Copy link
Copy Markdown
Member

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.

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
Copy Markdown
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
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sandeep Somavarapu (@sandy081) thanks, will take care of this.

@sbatten

Copy link
Copy Markdown
Member Author

It would still be great to get approval from:
João Moreno (@joaomoreno) on TreeView styling changes
Alex Ross (@alexr00) for general CustomView updates

@joaomoreno João Moreno (joaomoreno) left a comment

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.

Changes in listService make sense!

@alexr00 Alex Ross (alexr00) left a comment

Copy link
Copy Markdown
Member

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
Sandeep Somavarapu (sandy081) merged commit 5963a8e into microsoft:master Jan 27, 2020
@sandy081

Copy link
Copy Markdown
Member

SteVen Batten (@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