Repository navigation
Fix blank or slow thumbnails when dragging the image list scrollbar - #48
Merged
Merged
Conversation
Replace ListView with ScrollAwareListView to detect thumb dragging, pause and cancel image loading during drag, resume on scroll end, and reset the virtual list to the top before refresh to avoid blank or out-of-range viewports.
There was a problem hiding this comment.
🟡 Changes recommended
Canceled and replacement loads can race and corrupt the active loading-range state.
2 open findings
What changed in this PR
Adds scroll-aware thumbnail loading to keep ImageListPanel responsive and prevent blank virtual-list viewports.
Changes:
- Detects scrollbar thumb-drag lifecycle through
WM_VSCROLL. - Cancels and resumes thumbnail loading around drag operations.
- Resets the viewport before clearing virtual-list items.
| File | Description |
|---|---|
ScrollAwareListView.cs |
Adds vertical scrollbar message handling. |
ImageListPanel.Designer.cs |
Wires the specialized list view and events. |
ImageListPanel.cs |
Coordinates viewport reset and deferred loading. |
Files not reviewed (1)
- CDS.ImageDisplay.WinForms/ImageBrowsing/ImageListPanel.Designer.cs: Generated file
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+643
to
+646
| _debounceTimer.Stop(); | ||
| _cts?.Cancel(); | ||
| _loadingStart = -1; | ||
| _loadingEnd = -1; |
| public event EventHandler? ScrollEnded; | ||
|
|
||
| /// <inheritdoc/> | ||
| protected override void WndProc(ref Message m) |
…hine A cancelled LoadRangeAsync could clear the loading markers of a replacement load over the same range, because ownership was matched on the range. Match on a per-load generation instead. Add ScrollAwareListView tests covering the WM_VSCROLL thumb-drag state machine. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.


Problem
ImageListPanelkicked off thumbnail loads for every intermediate position, making loading slow.TopItemnull) that a laterEnsureVisible(0)did not repair.Fix
ScrollAwareListViewreports thumb drag start and scroll end viaWM_VSCROLL.ImageListPanelcancels in-flight loads when a drag starts and resumes loading on release.Testing
dotnet buildclean, 0 warnings.UnitTestspass on net10.0-windows (192/192). No new tests: the change is native scroll-message handling.🤖 Generated with Claude Code