Skip to content

fix(gui): clamp scroll_top in grid masonry to prevent over-scroll hiding records#93

Merged
StudentWeis merged 1 commit into
mainfrom
fix/92-grid-scroll-over-scroll
May 7, 2026
Merged

fix(gui): clamp scroll_top in grid masonry to prevent over-scroll hiding records#93
StudentWeis merged 1 commit into
mainfrom
fix/92-grid-scroll-over-scroll

Conversation

@StudentWeis
Copy link
Copy Markdown
Owner

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_top being incorrectly clamped to 0.0 during over-scroll, which reset the visible window to the top.

Linked Issue

Closes #92

Changes

  • Pass total_height into masonry_visible_window() so the visible window is computed against the actual content size.
  • Replace (-offset_y).max(0.0) with (-offset_y).clamp(0.0, max_scroll_top) where max_scroll_top = (total_height - viewport_height).max(0.0).
  • Extract pure compute_masonry_visible_window(offset_y, viewport_height, total_height) for unit-testability.
  • Add 5 unit tests covering top, bottom, positive over-scroll, deep negative over-scroll, and content-fits-viewport scenarios.

Testing

  • scripts/precheck.sh passes locally
  • New / updated tests cover the change (426 passed)

…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
@StudentWeis StudentWeis merged commit 34a70e8 into main May 7, 2026
8 checks passed
@StudentWeis StudentWeis deleted the fix/92-grid-scroll-over-scroll branch May 7, 2026 12:03
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 this pull request may close these issues.

fix(gui): grid scroll over-scroll hides records at bottom

1 participant