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

Closes #92135 - Adds view-level progress indicator #92136

Merged
merged 5 commits into from Mar 10, 2020

Conversation

eamodio
Copy link
Contributor

@eamodio eamodio commented Mar 6, 2020

This PR fixes #92135

This adds view pane support to ProgressService.withProgress. Here is it in use with the Timeline view:

progress

@eamodio eamodio added the workbench-views Workbench view issues label Mar 6, 2020
@eamodio eamodio added this to the March 2020 milestone Mar 6, 2020
@eamodio eamodio requested review from bpasero and sbatten March 6, 2020 06:36
@eamodio eamodio self-assigned this Mar 6, 2020
Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

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

@eamodio can you please find someone from layout team to review the progress-unrelated changes like @sandy081 or @sbatten .

As for the files processIndicator.ts and progressService.ts I see the new code is pretty much a copy of existing code. Can we avoid code duplication and extract pieces into reusable things that can be reused?

PS: I am not sure about the impact for when views can be put into the panel, but I would suggest to check on that as well.

@eamodio
Copy link
Contributor Author

eamodio commented Mar 6, 2020

@bpasero @sbatten worked with me on the changes for ViewPane/ViewsService parts.

👍 Will look more into removing duplication.

As for the views in the panel, I guess it will depend on how they will be added there -- if they have the header it should still work, but depending on the layout, we might want some custom css to move/change the indicator when its in the panel.

@eamodio
Copy link
Contributor Author

eamodio commented Mar 6, 2020

@bpasero I pushed changes to consolidate ViewProgressIndicator into CompositeProgressIndicator and remove some other code duplication.

@bpasero bpasero assigned bpasero and unassigned bpasero Mar 6, 2020
@bpasero bpasero self-requested a review March 6, 2020 13:28
Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

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

@eamodio ok I ignored changes outside of the progress area.

Overall seems ok to me with some comments. I find hideWhenInactive a bit weird, why does that need to be conditional? Should we always hide when inactive or does this concept not exist in other parts?

@eamodio
Copy link
Contributor Author

eamodio commented Mar 6, 2020

I'm honestly not sure why we don't always hide in the places where I added the conditional. I think it is related to the fact that in the existing usages the progress bar is a shared among all the viewlet's, where the new view one is attached to each view. But I didn't want to break any existing behavior by changing that. And without hiding it for the view case you end up with progress that won't end if the view get hidden (collapsed) while running.

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.

Thanks. LGTM from views side.

@eamodio
Copy link
Contributor Author

eamodio commented Mar 6, 2020

@bpasero let me know if this can be merged now -- thanks!

@bpasero
Copy link
Member

bpasero commented Mar 10, 2020

@eamodio conflicts master

@eamodio
Copy link
Contributor Author

eamodio commented Mar 10, 2020

@bpasero I've resolved the conflicts with master

@bpasero bpasero self-requested a review March 10, 2020 08:10
@@ -194,17 +198,23 @@ export class CompositeProgressIndicator extends CompositeScope implements IProgr
progressbar: ProgressBar,
scopeId: string,
isActive: boolean,
private readonly options: { hideWhenInactive?: boolean } | undefined,
Copy link
Member

Choose a reason for hiding this comment

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

@eamodio everything is fine for me, but this option is impossible to understand, because it is in fact not just used to hide the progress when the view becomes deactivated but also seems to be used in other places. since I do not understand it and do not really like it, I am against this change because it makes this component harder to use. please find an alternative maybe by aligning all progress indicators to behave the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The (poorly named) option, is basically a flag to signal that the progress bar for the indicator is shared or not. If it is shared (e.g. viewlet), then we only want to hide the progress if it is active. If it is not shared (e.g. view), then we want to stop it in any of those cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe a better name is hideEvenWhenInactive or exclusiveProgressBar

Copy link
Member

Choose a reason for hiding this comment

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

@eamodio how is the progress indicator for a view different for a viewlet or panel? I do not understand it nor the concept of a shared indicator.

My understanding is that a progress indicator has a scope (view id, viewlet id or panel id) and only reacts on events matching this ID. So if a viewlet changes, we update the progress bar in the same way I would think we should do it for a view. How is a view different?

If at all we do figure out that we need to have different behaviour, maybe we could have a base class for the indicator and then 2 specific cases: shared and non-shared indicator. But again, I see no reason yet to go there.

Copy link
Member

Choose a reason for hiding this comment

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

#92136 (comment) seems relevant, and we need to understand it better I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The root difference is that all viewlets share a single progress bar, since its always in the same location at the top of the sidebar and there can only be one progress showing at a time. Where as the view each have their own progress bar which call have multiple showing at any time.

Copy link
Member

Choose a reason for hiding this comment

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

@eamodio I get that and still: when the viewlet is inactive, I want the progress to stop. same as I would expect that for a view that is hidden or collapsed.

Copy link
Contributor Author

@eamodio eamodio Mar 10, 2020

Choose a reason for hiding this comment

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

Not really, because the viewlet that became active could have running progress which will now use that same progress bar, so if we stopped it, it could interfere with it. But again, I didn't create, nor change that behavior -- that was the existing behavior. I just needed to adapt it because that doesn't work for the view case where there are independent progress bars.

@eamodio eamodio merged commit feb42fa into master Mar 10, 2020
@eamodio eamodio deleted the eamodio/view-progress branch March 10, 2020 19:52
@github-actions github-actions bot locked and limited conversation to collaborators Apr 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
workbench-views Workbench view issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for progress to be shown on a view (pane)
4 participants