fix status index approxmiation in timeline rendering for dynamically changing viewport geometries #3543

Merged
hj merged 1 commit from iamtakingiteasy/pleroma-fe:fix-timeline-rendering-status-index-approx into develop 2026-08-10 13:50:37 +00:00

Checklist

  • Adding a changelog: In the changelog.d directory, create a file named <code>.<type>.

Currently dynamically changing viewport geometry can result in estimated indices outside the statuses array boundaries due to race between const height = Math.max(document.body.offsetHeight, window.pageYOffset) and const centerOfScreen = window.pageYOffset + window.innerHeight * 0.5 in timeline.js as underlying window properties change their values between two expressions (at very least in firefox, window properties are not captured for the entirety of function execution unless bound to local variables and do reflect native updates immediately), this MR adds capping to approxIndex similar to cappedScrollIndex.

### Checklist - [x] Adding a changelog: In the `changelog.d` directory, create a file named `<code>.<type>`. Currently dynamically changing viewport geometry can result in estimated indices outside the `statuses` array boundaries due to race between `const height = Math.max(document.body.offsetHeight, window.pageYOffset)` and `const centerOfScreen = window.pageYOffset + window.innerHeight * 0.5` in timeline.js as underlying window properties change their values between two expressions (at very least in firefox, window properties are not captured for the entirety of function execution unless bound to local variables and do reflect native updates immediately), this MR adds capping to `approxIndex` similar to `cappedScrollIndex`.
fix status index approxmiation in timeline rendering for dynamically changing viewport geometries
Some checks are pending
ci/woodpecker/pr/build Pipeline is pending approval
ci/woodpecker/pr/changelog Pipeline is pending approval
ci/woodpecker/pr/lint Pipeline is pending approval
ci/woodpecker/pr/test-e2e Pipeline is pending approval
ci/woodpecker/pr/test Pipeline is pending approval
58fdd50838
hj merged commit 9e4592df59 into develop 2026-08-10 13:50:37 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pleroma/pleroma-fe!3543
No description provided.