[Bug]: Grid Columns Not Sizing Correctly on Open #149

Closed
opened 2026-07-09 22:26:30 +00:00 by ValleyGeek · 2 comments
Owner

App version

0.3.6

Platform

Windows

Steps to reproduce

Open Directory with enough images to generate multiple grid rows

Expected behavior

Columns are equally spaced to use available room

Actual behavior

The last column is being wrapped onto a new line creating a large amount of unused space on the right, likely due to not calculating the size of the scroll bar. Changing the grid thumbnail zoom level up or down then back causes a proper refresh populating the last column as expected.

Additional context

No response

### App version 0.3.6 ### Platform Windows ### Steps to reproduce Open Directory with enough images to generate multiple grid rows ### Expected behavior Columns are equally spaced to use available room ### Actual behavior The last column is being wrapped onto a new line creating a large amount of unused space on the right, likely due to not calculating the size of the scroll bar. Changing the grid thumbnail zoom level up or down then back causes a proper refresh populating the last column as expected. ### Additional context _No response_
Member

Fix on branch 0.4.1/issue-149-grid-columns-selection

Grid columns (#149)

Root cause: column math often ran against a stale viewport width. MainWindow.resizeEvent does not fire when the content splitter applies the right-panel width (setSizes), and open/load could size the grid before the scrollbar appeared. Changing zoom forced a correct re-layout — matching the report.

Changes:

  • GridViewportResizeFilter re-applies justified column layout on list/viewport resize (covers splitter and stack changes).
  • Scrollbar extent is reserved only when the bar is not already consuming viewport space (avoids double-subtract).
  • Coalesced _schedule_apply_display_size + re-apply after right-panel apply, splitter move, and DB preload.
  • showEvent applies right-panel width before display sizing.

Sequential multi-row selection (extra report)

Shift+click in IconMode was using a visual rectangle (square block of columns) instead of list order through intervening rows.

Changes: GridSelectionFilter now selects contiguous model rows from the selection anchor through the clicked item. Also avoids setCurrentIndex wiping a multi-select after the range is applied.

Verification

  • ruff check / ruff format --check clean on touched files
  • pytest for grid selection, PR7 shell (incl. new column-fit test), thumbnail sizing, grid input filters — all passed

Branch is pushed; leaving the issue open until you verify in the UI / request a PR to main.

## Fix on branch `0.4.1/issue-149-grid-columns-selection` ### Grid columns (#149) Root cause: column math often ran against a stale viewport width. `MainWindow.resizeEvent` does not fire when the content splitter applies the right-panel width (`setSizes`), and open/load could size the grid before the scrollbar appeared. Changing zoom forced a correct re-layout — matching the report. **Changes:** - `GridViewportResizeFilter` re-applies justified column layout on list/viewport resize (covers splitter and stack changes). - Scrollbar extent is reserved only when the bar is **not** already consuming viewport space (avoids double-subtract). - Coalesced `_schedule_apply_display_size` + re-apply after right-panel apply, splitter move, and DB preload. - `showEvent` applies right-panel width before display sizing. ### Sequential multi-row selection (extra report) Shift+click in IconMode was using a **visual rectangle** (square block of columns) instead of list order through intervening rows. **Changes:** `GridSelectionFilter` now selects contiguous **model rows** from the selection anchor through the clicked item. Also avoids `setCurrentIndex` wiping a multi-select after the range is applied. ### Verification - `ruff check` / `ruff format --check` clean on touched files - `pytest` for grid selection, PR7 shell (incl. new column-fit test), thumbnail sizing, grid input filters — all passed Branch is pushed; leaving the issue open until you verify in the UI / request a PR to `main`.
Member

PR opened for review: branch 0.4.1/issue-149-grid-columns-selectionmain (release 0.4.2).

PR opened for review: branch `0.4.1/issue-149-grid-columns-selection` → `main` (release 0.4.2).
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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
ai-collab/bulk-image-organizer#149
No description provided.