Problem/Motivation

Expanding a branch or inserting a live comment above the reading position can make the page scroll back and forth, then leave the reader displaced. The compensation loop reverses its own correction on subsequent frames.

A browser reproduction recorded 46 alternating scroll calls and approximately 94 px of final displacement. The existing arrival test can pass while the anchor is briefly in the right place, before it moves again.

Steps to reproduce

  1. Open a discussion and scroll to a comment below the top of the thread.
  2. Insert a live root comment above it, or reveal an earlier branch.
  3. Observe the reading position throughout and after the compensation loop, not just the first corrected frame.

Proposed resolution

Keep the anchor stable by correcting residual displacement without undoing earlier corrections. Superseded compensation must not fight a newer operation or deliberate reader scrolling.

Remaining tasks

  • Add a regression test that observes stability throughout and after settling.
  • Cover branch expansion, Expand All, and polled arrivals with production content-visibility enabled.
  • Verify in Chromium, Firefox, and WebKit; record unavailable engines explicitly.

User interface changes

The reading position stays stable instead of oscillating or drifting.

API changes

None anticipated.

Data model changes

None anticipated.

Comments

freelock created an issue. See original summary.

  • freelock committed 9b9a294e on 1.0.x
    fix: #3623881 Scroll compensation oscillates after expanding or updating...

  • freelock committed ae24d324 on 1.0.x
    fix: #3623881 Scroll compensation oscillates after expanding or updating...
freelock’s picture

Status: Active » Fixed

Fixed in Alpha4.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.