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

only renderBody when view is visible/expanded #165187

Merged
merged 1 commit into from
Nov 1, 2022
Merged

Conversation

sbatten
Copy link
Member

@sbatten sbatten commented Nov 1, 2022

fixes PaneView calls renderBody even when the pane is collapsed #164662

cc @joaomoreno

fixes PaneView calls renderBody even when the pane is collapsed #164662
@sbatten sbatten enabled auto-merge (squash) November 1, 2022 19:05
@sbatten sbatten self-assigned this Nov 1, 2022
@VSCodeTriageBot VSCodeTriageBot added this to the November 2022 milestone Nov 1, 2022
@sbatten sbatten merged commit 8f06fd3 into main Nov 1, 2022
@sbatten sbatten deleted the sbatten/querulous-puma branch November 1, 2022 19:22
@@ -158,6 +159,11 @@ export abstract class Pane extends Disposable implements IView {
this.updateHeader();

if (expanded) {
if (!this._bodyRendered) {
this.renderBody(this.body);
this._bodyRendered = true;
Copy link
Member

Choose a reason for hiding this comment

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

@sbatten We should set this to true inside renderBody, not outside. Especially because renderBody is protected.

Copy link
Member Author

Choose a reason for hiding this comment

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

are you suggesting to move it out into ViewPane instead? renderBody is abstract in the Pane. Even if a subclass calls this, setting it to true inside renderBody won't prevent the subclass from calling it.

Copy link
Member

Choose a reason for hiding this comment

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

I'm suggesting making it concrete and have every subclass call super.renderBody() in their renderBody implementation first thing.

sandy081 added a commit that referenced this pull request Dec 12, 2022
sandy081 added a commit that referenced this pull request Dec 12, 2022
sandy081 added a commit that referenced this pull request Dec 12, 2022
Revert "only renderBody when view is visible/expanded (#165187)"
@github-actions github-actions bot locked and limited conversation to collaborators Dec 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants