Skip to content
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

Merging of buckets into top/bottom buckets happens at unexpected position #5525

Closed
robertknight opened this issue Jun 8, 2023 · 0 comments · Fixed by #5526
Closed

Merging of buckets into top/bottom buckets happens at unexpected position #5525

robertknight opened this issue Jun 8, 2023 · 0 comments · Fixed by #5526

Comments

@robertknight
Copy link
Member

robertknight commented Jun 8, 2023

When highlights get near enough to the top/bottom of the screen, their buckets alongside the sidebar get merged into a single bucket for all highlights above/below the screen respectively. For short highlights, this happens as the dedicated bucket touches the "offscreen" bucket, which feels natural. For tall highlights however, this can happen when the dedicated bucket has still a significant gap to the "above screen" bucket, or has already gone some way past the "below screen" bucket.

The reason this happens is because the merging happens based on where the top of the highlight is. However the dedicated bucket is rendered where the center of the highlight is.

In the screenshot below, the < 1 bucket will merge into the ^ 2 bucket long before they touch, when scrolling up. When scrolling down, it will merge into the V 2 bucket long after they touch.

Tall highlight
robertknight added a commit that referenced this issue Jun 8, 2023
Use the position of the center of an anchor instead of the top to determine
whether it should be counted as off-screen or not. Since buckets in the bucket
bar are drawn where the center is, this ensures that on-screen buckets merge
into off-screen ones at a natural point, instead of when there is still a gap
between the two (for the "above screen" bucket) or after the on-screen bucket
has gone below the "below screen" bucket.

Fixes #5525
robertknight added a commit that referenced this issue Jun 8, 2023
Use the position of the center of an anchor instead of the top to determine
whether it should be counted as off-screen or not. Since buckets in the bucket
bar are drawn where the center is, this ensures that on-screen buckets merge
into off-screen ones at a natural point, instead of when there is still a gap
between the two (for the "above screen" bucket) or after the on-screen bucket
has gone below the "below screen" bucket.

Fixes #5525
robertknight added a commit that referenced this issue Jun 12, 2023
Use the position of the center of an anchor instead of the top to determine
whether it should be counted as off-screen or not. Since buckets in the bucket
bar are drawn where the center is, this ensures that on-screen buckets merge
into off-screen ones at a natural point, instead of when there is still a gap
between the two (for the "above screen" bucket) or after the on-screen bucket
has gone below the "below screen" bucket.

Fixes #5525
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant