w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.38k stars 643 forks source link

[css-view-transitions-2] View transitions on an infinite scroller with continuous scrolling. #9455

Open khushalsagar opened 9 months ago

khushalsagar commented 9 months ago

One of the use-cases where authors could use View Transitions is adding items to an infinite scroller. You could have a simple fade or a staggering animation as new elements get added to the list. There's a few issues which will need to be solved for this to work though:

Not an immediate concern but filing an issue so we remember to evaluate this in the design for scoped transitions.

nickcoury commented 9 months ago

+1 to this use case. It's especially relevant when skeleton loaders are initially shown, the user is scrolling, and additional content is added asynchronously while the user is actively scrolling.

Scoped transitions seem like the right solution here, as long as they can be anchored to the scrollable surfaces and not the viewport.

I'm not familiar with the implementation logistics of scoped transitions, but I would imagine this should work similar to traditional FLIP web animations where the previous state is snapshotted, the updated state is rendered, then the animations computed. Ideally they're just composited layers but that can't be guaranteed with the customizations allowed by the VT API.