Let the image list select more than one row - #71
Merged
Merged
Conversation
Convert Selected against a single-select list was a contradiction, and the code had noticed before anyone did: ConvertSelectedMenuItem_Click already collected every selected index and handed the whole list to ConvertItemsAsync. It had been converting exactly one image for as long as it existed, because the control could not offer it a second. So the list is multi-select now, and the handlers that were written for one row are told which row they mean. Remove takes every selected image rather than the first, walking the indices in descending order so removing one cannot shift another still to go, and afterwards lands the selection where the first removed row used to be. A list with nothing selected announces nothing when focus returns to it, so ending up somewhere is not cosmetic. Create Multi-size ICO and Fit to File Size both make one output from one image, so they act on the focused row rather than silently taking the topmost of a multiple selection - which would work on an image the user is not looking at. The preview follows the focused row too, for the same reason: extending a selection downward should show where you are rather than where you started. Verified at the window level rather than through the property: the list window carries no LVS_SINGLESEL, and selecting two rows yields two. Screen readers announce multiple selection well - extending, moving the focus without extending, and selecting everything at once all come across on JAWS, NVDA and Narrator. The one gap is that none of them names the mode for a list view the way they say "multi select list box", which appears to be decided by control class rather than by anything the control reports. Claude-Session: https://claude.ai/code/session_01TJ8i7jHmkUjVCjVccLp6Hf
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
"Convert Selected" against a single-select list was a contradiction — and the code had noticed before anyone did.
ConvertSelectedMenuItem_Clickalready collected every selected index and handed the whole list toConvertItemsAsync. It has been converting exactly one image for as long as it existed, because the control could never offer it a second.The list is now multi-select, and the handlers written for a single row are told which row they mean.
What changed
Remove takes every selected image rather than the first, walking indices in descending order so removing one cannot shift another still to go. Afterwards it lands the selection where the first removed row used to be — a list with nothing selected announces nothing when focus returns to it, so ending up somewhere is not cosmetic.
Create Multi-size ICO and Fit to File Size each make one output from one image, so they act on the focused row rather than silently taking the topmost of a multiple selection, which would work on an image the user is not looking at.
The preview follows the focused row for the same reason: extending a selection downward should show where you are, not where you started.
Convert Selected needed no change at all — it was already written for this.
Verification
At the window level rather than through the property:
On the accessibility of it
Multiple selection was tested by ear on JAWS, NVDA and Narrator before this was written. Extending a selection, moving the focus without extending it, and selecting everything at once are all announced correctly.
The one shortfall is that no reader names the mode for a list view the way it says "multi select list box". That appears to be decided by control class rather than by anything the control reports — a multi-select list view, a single-select one and a multi-select list box all measured identical MSAA state. Behaviour is announced; the label is not.
https://claude.ai/code/session_01TJ8i7jHmkUjVCjVccLp6Hf