fix(gui): clamp scroll_top in grid masonry to prevent over-scroll hiding records#93
Merged
Merged
Conversation
…ing records In Grid layout mode, when scrolling past the bottom (over-scroll/bounce), offset_y can become positive. The old code computed scroll_top as (-offset_y).max(0.0), which clamped to 0.0 during over-scroll, resetting the visible window to the top and hiding bottom records. Now scroll_top is clamped to [0, max(0, total_height - viewport_height)] using the layout's total_height, keeping bottom records visible during over-scroll. Refs #92
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In Grid layout mode, when scrolling past the bottom (over-scroll / bounce), some bottom records stopped rendering and showed only empty placeholders. This was caused by
scroll_topbeing incorrectly clamped to0.0during over-scroll, which reset the visible window to the top.Linked Issue
Closes #92
Changes
total_heightintomasonry_visible_window()so the visible window is computed against the actual content size.(-offset_y).max(0.0)with(-offset_y).clamp(0.0, max_scroll_top)wheremax_scroll_top = (total_height - viewport_height).max(0.0).compute_masonry_visible_window(offset_y, viewport_height, total_height)for unit-testability.Testing
scripts/precheck.shpasses locally