Fix/reports drag resize#69
Merged
Merged
Conversation
Feed each section's content-fit row count to RGL as minH so the resize handle stops at the content floor instead of snapping back.
Mirror the height floor for width: record each section's content-fit column count and feed it to RGL as minW.
Section was h-full, so the measured node always reported the cell height and the tile could never shrink below DEFAULT_H, leaving dead space below short content. Measure the section's intrinsic height and let height auto-fit (grow and shrink).
The ResizeObserver watched the cell-sized node whose height fitHeights drives, so auto-shrink fed back into an infinite update loop. Observe the intrinsic section element instead.
Auto-fit toggled the report-root scrollbar, jittering the grid width and feeding back into a resize loop. Reserve a stable scrollbar gutter and round/dedupe the measured width.
Auto-fit height fed ResizeObserver loops (cell height and scrollbar jitter). Back to grow-only height with hard min floors.
The height floor was read from the cell-filling node, so scrollHeight equalled the cell height and a manual grow raised the floor, locking the tile at its new size. Measure a natural-height probe inside the section instead, so the floor tracks the content and the tile can shrink back to it. Drop the width floor (reflow content has no reliable intrinsic min); width stays freely resizable down to MIN_W.
Each report section is now a CSS query container, so its content adapts to the widget width (not the viewport). When a tile is made narrow, non-essential bits drop out and only the essentials remain: - StatCard grids (Exposure, Compliance) stack instead of staying 4-wide - Tables hide secondary columns (Share, Employees, Department, Last detected, breach Source) and the email subline / progress bars - Essentials kept: identifiers, primary counts, risk, exposure rate Adds the @tailwindcss/container-queries plugin (min-width @ variants).
On load every tile now shrinks to its content height (no dead space), while still allowing manual resize down to the content floor and up. Safe from the earlier resize loops: height is measured from the intrinsic probe (not the cell), and report-root reserves a stable scrollbar gutter so the shrink cannot jitter the grid width.
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
Type of change
Checklist