Skip to content

shrink list loading indicator to avoid page repaints #10778

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

Merged
merged 5 commits into from
May 21, 2025

Conversation

RayBB
Copy link
Collaborator

@RayBB RayBB commented May 14, 2025

Noticed while working on #10776

When you load a book page the cover image taking a while to load causes the page to jump.
However, once that's fixed in #10776 you'll be quick to notice the next thing that jumps around.
That is the "Loading..." indicator for lists.

I think that we should remove that loading indicator because:

  1. For most users most of the time there will be no lists to load
  2. It causes the page to jump
  3. It generally loads so fast it isn't really useful.

Technical

Testing

The video below gives a nice demo

Screenshot

list_loading.mp4

Stakeholders

@github-project-automation github-project-automation bot moved this to Waiting Review/Merge from Staff in Ray's Project May 14, 2025
@RayBB RayBB requested a review from cdrini May 15, 2025 21:04
Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

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

Niiice! Hmmm, I think removing it entirely might be a touch confusing for some of our power users who might rely on knowing if a book is on a given list. So I think the next best thing we can do is to make it position absolute so it takes up no space. Something like this. You might need to also add an inline style to make it appear correctly before css load.

Hopefully enough to give those power users the cue they need, without being to confusing/jarring for others. In some universe, we'll hopefully just make this performant enough to not need lazy loading :')

.list-overview-loading-indicator {
  position: relative;
}

.list-overview-loading-indicator::before {
  content: "Loading...";
  font-size: 8px;
  text-transform: uppercase;
  text-align: center;
  line-height: 0;
  height: 8px;
  width: calc(100% - 8px);
  position: absolute;
  top: -8px;
  left: 0;
  opacity: 0.75;
}

image

@RayBB
Copy link
Collaborator Author

RayBB commented May 16, 2025

@cdrini I think your proposal works to fix the problem (repainting) but it does leave a bit to be desired for the casual user to see this loading thing pop up and then disappear (in the rare care they do notice it -- the loading indicator disappears very fast for me).

How about we put a loading indicator on the want to read dropper? Maybe where the little drop down arrow is.
This way, no repaint but it also makes sense because if you open that dropper before the partials come you'd get a loading indicator anyway.

image

@RayBB
Copy link
Collaborator Author

RayBB commented May 16, 2025

On second thought if the dropper is too hard to fuss with then we could have a small text that doesn't disappear like:
Loading lists...
You have this on 0 lists
You have this on 1 list
Etc

@cdrini
Copy link
Collaborator

cdrini commented May 16, 2025

My thinking is, there are 2 use cases:

  1. People who don't use lists very in depth. They do not really need to see the loading indicator. This is the majority.
  2. People who use lists a lot, and will be looking to see them, and gain meaning if they are or aren't there. This is a high-impact minority.

(1) restricts us to something low-profile, so no animations or motion, since that'll attract the attention of a bunch of folks who don't really need to be looking there.

(2) restricts us that it must be something that can be seen when looked for.

The tiny loading text I think meets this requirement. No motion, so (1) people will likely not notice it, and (2) people will, even if they can't read it, notice something there and come to associate it with loading. And if a (1) person happens to notice it, they can just look/read it if necessary.

Tiny loading text also is a good step improvement over what we have, which has this same issue, but is worse for the (1) crowd, and worse for all due to the layout shifts.

@cdrini cdrini self-assigned this May 16, 2025
@RayBB
Copy link
Collaborator Author

RayBB commented May 16, 2025

@cdrini once I put it together your suggestion looks pretty good. It solves the main issue of a jumpy screen so lets go with it!

Demo:
https://github.com/user-attachments/assets/57bfe527-e2c5-4d4f-8ef0-dabc44dd3d54

@RayBB RayBB requested a review from cdrini May 16, 2025 23:54
@RayBB RayBB changed the title remove list loading indicator for better default experience shrink list loading indicator to avoid page repaints May 17, 2025
Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

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

Lgtm! Tested on testing. The "..." is not appearing... but I think that was a pre-existing bug so not worrying about it.

@cdrini cdrini merged commit 56d525f into master May 21, 2025
8 checks passed
@github-project-automation github-project-automation bot moved this from Waiting Review/Merge from Staff to Done in Ray's Project May 21, 2025
@cdrini cdrini deleted the remove-list-loading-indicator branch May 21, 2025 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants