Dev.Chan64's Blog

Go Home
Show Cover Slide Show Cover Slide

gpt-4-turbo has translated this article into English.


Ideation on Infinite Scrolling and Scroll Depth Alignment

🧭 Overview

Infinite scrolling offers users a seamless navigation experience.
However, there is a subtle mismatch between the physical scroll distance and the actual position of data.
This article explores methods to maintain alignment between scroll distance and data in an infinite scroll environment,
documenting personal insights on how to make “users scroll naturally and systems operate consistently.”


1. The Alignment Challenges Posed by Infinite Scrolling

Infinite scrolling is predicated on two uncertainties: asynchronous loading and dynamic height changes.
If each item’s rendering height varies, or if images, ads, and content load late,
the scroll position does not directly correspond to the data index.

Commonly observed phenomena in this process include:

These phenomena are not resolved by simple viewport control or virtual lists alone,
ultimately touching on the fundamental issue of “consistency between data and position.”


2. A Structure Requiring Consideration of Both Server and Client

Alignment cannot be achieved by the efforts of one side alone.

On the server side:

On the client side:

When the server and client recognize each other’s roles,
the balance between scroll distance and data alignment becomes clearer.


3. The Snapshot Model for Scroll Alignment

Whenever considering alignment, the question arises: “Can the state of data loaded so far be maintained in a single coordinate system?”
Thus, the concept of a snapshot was conceived.
A snapshot is understood not just as simple caching, but as a “logical coordinate system connecting data and physical position.”

Components of a Snapshot

A snapshot includes the following information:

How the Snapshot Works

  1. Initial Load Point
    Upon receiving the first page, set estimated heights for each item and calculate cumulative heights.
    The total scroll height at this point is approximate.

  2. Rendering and Adjustment Phase
    After rendering, measuredHeights update estimatedHeights.
    Recalculate cumulative heights for subsequent items to gradually reduce errors.
    Users experience this change almost imperceptibly, enjoying a natural flow.

  3. Management During Scrolling
    While scrolling, cumulativeHeights can be used to quickly search for the item index corresponding to scrollTop.
    This can be calculated at a cost of O(log n),
    which feels useful for ensuring the performance stability of infinite scrolling.

  4. Anchor-Based Restoration
    When returning from a different screen, restore the previous position using anchorId and anchorOffset.
    As long as the data order is maintained, restoration works visually stably.

Significance of the Snapshot

A snapshot is not just a local cache but is understood as a
“structural unit for reproducing the screen state at a certain point in time.”
With this structure in mind, infinite scrolling can be viewed not just as a simple loading pattern but as a system that preserves the context of a feed that changes over time.


4. The Issue of Jumping to Unloaded Sections

In infinite scrolling, scroll jumps to areas not yet loaded are common.
When quickly scrolling down or moving to the end of a page,
the data at that position does not yet exist, so the meaning of scrollTop changes.

This issue brings us back to the question:
“What section of the actual data does the scroll distance represent?”
This question necessitates viewing distance as a relative coordinate on the data, cursor, and time axes, rather than just in pixels.


5. Jump Distance-Based Approach (Distance → Data Position Mapping)

When a single scroll movement is very long,
the system often does not have all the data corresponding to that distance.
Hence, the idea of normalizing the scroll movement and estimating the data position based on its magnitude was considered.

Normalization of Distance

Define a normalized distance value based on the screen height.
jumpVh = |targetScrollTop - currentScrollTop| / viewportHeight
This value represents how many screens’ worth the user intends to skip.

For instance,

This ratio can be used to differentiate loading strategies.

Strategies by Distance Segment

Segment Characteristics Handling Method
Short range (≤L1) Movement within safe area Move indices based on current anchor
Medium range (L1~L2) Continuous loading possible Limit movement to a maximum range
Long range (>L2) Hard jump Estimate approximate position based on ratio or domain axis

Observations on Domain Axis-Based Jumps

Using domain units like time or ID as axes
delivers more explicit context to users.
For example, the expression “Jump to posts from March 2024”
is clearer than simply moving down by 500px.
This approach helps users intuitively feel “where they currently are.”

Summary of Distance-Based Approach

This approach is an attempt to dynamically connect physical distance with logical data position.
While not every jump can be precisely replicated,
the method of interpreting data based on the size of the distance allows for consideration of both loading efficiency and continuity.

Ultimately, scroll alignment is understood not in terms of “pixel precision” but
as “naturalness in context.”


6. UX Perspective on Perceived Quality and Stabilization Techniques

Achieving perfect alignment in infinite scrolling remains challenging.
However, the ‘naturalness’ perceived by users is influenced more by
continuity, predictability, and visual stability than by technological accuracy.
From that perspective, I view the safe window and preloading as
key tools in stabilizing UX quality.

6.1 Safe Window (safe window)

The safe window refers to the range of data pre-loaded around the current viewport.
Even if users scroll quickly,
data within this area can be rendered immediately.

In real environments, adjusting the size of the safe area gradually based on network delays, user scroll speed, and device performance
seems to result in the highest perceived quality.

6.2 Preloading (preloading)

Preloading involves requesting or rendering the next content before it comes into the user’s view.
Elements with high loading costs, such as images, videos, and ads, benefit significantly from this approach.

Preloading directly influences the maintenance of visual smoothness.
Even without perfect alignment,
it provides an experiential stability that makes the screen appear “always ready.”

6.3 Visual Buffering Devices

These visual buffering devices
create a perception for users of being “within a continuous flow,”
substituting for precise alignment.

6.4 Summary

While the safe window and preloading do not completely solve alignment issues,
they function as buffering structures that allow for response before users perceive discontinuities.
Ultimately, the core of UX quality lies not in perfect numerical alignment but in
maintaining the sensation of seamless navigation.


7. Finding the Balance Between Data Alignment and Perceived UX

The design of infinite scrolling seems to be a balancing act between mathematical accuracy and user perception.
Securing a minimum standard of accuracy through server cursors, snapshot structures, and safe area control, and
adding natural movement seems like a realistic approach.

Rather than making alignment an absolute goal,
maintaining a consistent system within an expected margin of error seems to be a more effective approach in real environments.


8. Mindset for Handling Alignment

Alignment in infinite scrolling is not merely a technical issue of matching pixels.
It is understood as a structural problem involving dynamic adjustments between data, cursors, heights, and distances.

Thus, designers prioritize consistency of flow over pixel precision.
What users perceive is not absolute coordinates, but
the “continuity of an unbroken context.”


9. Yet Unresolved Areas Despite Efforts

Despite all efforts, achieving complete alignment remains challenging.
Recognizing these limitations feels naturally appropriate.

9.1 Uncertainty of Asynchronous Data

9.2 Errors in Client Estimates

9.3 Damage in Intermediate Sections

9.4 Exceptions in User Operations

9.5 UX Limits


Conclusion

The alignment in infinite scrolling feels more like a continuous adjustment process to provide users with a “seamless flow,” rather than a pursuit of numerical consistency.
This article documents personal ideation on that process,
with plans to refine these thoughts through more concrete implementation and experimentation in the future.


Go Home
Tags: Retrospective