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

Resolving some issues around rendering pagination loading on resource list pages #12884

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

codyrancher
Copy link
Contributor

@codyrancher codyrancher commented Dec 13, 2024

Summary

It wasn't readily apparent what the expected behavior was around things like alt-loading and the manual refresh so I did was made sense to me. See the video to see if it's what we want or if adjustments need to be made.

fixes #12748

Occurred changes and/or fixed issues

We no longer flicker the no-rows messaging when first loading one of the server-side pagination pages.

Areas or cases that should be tested

SSP and non-SSP resource list pages.

Screenshot/Video

list-loading.mp4

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

@codyrancher codyrancher added this to the v2.11.0 milestone Dec 13, 2024
@codyrancher codyrancher changed the title Resolving some issues around rendering pagination loading on resource… Resolving some issues around rendering pagination loading on resource list pages Dec 13, 2024
&:not(.loading) {
border-bottom: 1px solid var(--sortable-table-top-divider);
}
border-bottom: 1px solid var(--sortable-table-top-divider);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We get a flicker without a border momentarily if we keep the .loading negation.

@@ -374,8 +374,10 @@ export default {
eventualSearchQuery = this.$route.query?.q;
}

const isLoading = this.loading || false;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sometimes loading has a value and that's what we should initiate our state with.

@@ -512,7 +514,7 @@ export default {
},

created() {
this.debouncedRefreshTableData = debounce(this.refreshTableData, 500);
this.debouncedRefreshTableData = debounce(this.refreshTableData, 500, { leading: true });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This forces us to trigger at the beginning of the timer instead of the end which makes the visual for loading appear sooner.

Comment on lines -534 to -535
this.refreshButtonPhase = !res || this.loading ? ASYNC_BUTTON_STATES.WAITING : ASYNC_BUTTON_STATES.ACTION;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would cause the refresh button to get stuck on page load and refreshButtonPhase expects a phase value not a boolean true or false value.

You'll also notice that we have a manualRefreshLoadingFinished watcher which updates the phase as well so it seems safe to remove.

@@ -270,7 +270,7 @@ export default {
v-else
:schema="schema"
:rows="rows"
:alt-loading="canPaginate"
:alt-loading="canPaginate && !isFirstLoad"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We really only want alt-loading to happen on manual refresh and when changing pages. It seemed easiest to base this on whether or not it was the first load or not.

@codyrancher codyrancher marked this pull request as ready for review December 13, 2024 05:09
Copy link
Member

@richard-cox richard-cox left a comment

Choose a reason for hiding this comment

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

Little bit nervous getting this one in before the two big PRs, can we wait for them or base this on on top of the later?

@codyrancher
Copy link
Contributor Author

Little bit nervous getting this one in before the two big PRs, can we wait for them or base this on on top of the later?

Yeah, I'm in favor of waiting until after they're merged.

@codyrancher codyrancher marked this pull request as draft December 17, 2024 19:02
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.

Switching between server-side paginated lists incorrectly briefly shows 'no row's message before rows shown
2 participants