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

Add progress indicator for homeview APIs #1959

Open
wants to merge 1 commit into
base: sagerb-changes-for-deployments-view
Choose a base branch
from

Conversation

sagerb
Copy link
Collaborator

@sagerb sagerb commented Jul 12, 2024

Intent

Resolves #1958

Adds a HomeView progress indicator while API calls are outstanding

Type of Change

    • Bug Fix
    • New Feature
    • Breaking Change
    • Documentation
    • Refactor
    • Tooling

Approach

Wrapped API calls with VSCode's withProgress call, showing on the HomeView.

Automated Tests

Directions for Reviewers

Verify you see a progress indicator within HomeView when it is initializing, after switching to publisher view. This will be very visible if you open a very large folder in VSCode as the base dir.

Checklist

@sagerb sagerb self-assigned this Jul 12, 2024
@sagerb sagerb changed the base branch from main to sagerb-changes-for-deployments-view July 15, 2024 17:32
Copy link
Collaborator

@dotNomad dotNomad left a comment

Choose a reason for hiding this comment

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

Looks great, just had a helper function suggestion.

Comment on lines +322 to +324
async () => {
return apiRequest;
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay its 2 PR's late, but I did try unwrapping these and since it isn't a function it fails to typing 😞

Comment on lines +1249 to +1257
window.withProgress(
{
title: "ReFreshing Files",
location: { viewId: Views.HomeView },
},
async () => {
return apiRequest;
},
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if each of our views should have a helper to show progress like the below:

  private showProgress(promise: Promise<unknown>, title: string) {
    return window.withProgress(
      {
        title: title,
        location: { viewId: Views.HomeView },
      },
      async () => promise,
    );
  }

Could make it a bit less verbose each time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add HomeView progress indicator while operations known to cause refresh and further processing are outstanding
2 participants