Added checkbox-based selection system and bulk actions in CardWindow #229
No reviewers
Labels
No labels
bug
dependencies
duplicate
enhancement
good first issue
help wanted
invalid
mod updater
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
IllusionMods/KKManager!229
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "Timo713/add-checkbox-selection-feature"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
This change introduces an optional checkbox-based selection system to make managing multiple cards more intuitive and flexible.
Changes
Why
Previously, selecting multiple cards using CTRL or SHIFT prevented the preview from updating, while clicking normally cleared all selections.
This made it cumbersome to review and manage multiple cards at once.
The new checkbox mode allows users to:
This makes managing large libraries smoother and more consistent with user expectations.
Thanks for the PR. It will need some changes to be merged unfortunately.
First, it would be easier to handle if the features were separated into different PRs. A bit late for that now but something to keep in mind in the future.
The checkboxes are a good option to add but I think they should be treated identically to a normal selection when the checkbox mode is enabled. Having checkboxes act differently from normal selection is going to be confusing to users.
The new open in explorer button seems superfluous, I think the existing open in explorer button should be updated to open with cards selected if there are any selected in the list.
The removed comments I mentioned should be restored since they contained useful information. Please avoid changing things unrelated to the main goal of the PR in the future.
If you want to discuss this PR outside of github you can find me on Koikatsu Discord server.
@ -295,1 +311,3 @@//RefreshThumbnails(true);var toAdd = ShowInvalid ? list : list.Where(x => x is not UnknownCard).ToList();listView.AddObjects(toAdd);Please do not remove documentation comments.
@ -337,4 +382,3 @@if (token.IsCancellationRequested) return;var large = listView.View == View.LargeIcon;Please do not remove informational comments.
A better name would be something like GetSelectedCards.
Why require the list to be in checkbox selection mode? It shouldn't matter what mode the list is in for features that work on selections.
These could be combined into a single event handler, simply set all of the toggles to use the same method.
If the filtering logic was moved into the ModelFilter then rebuilding would become unnecessary, checking the toggles would just need to do a quick list refresh. Performance-wise it should be faster for when cards are still being actively loaded.
Pull Request Overview
Adds optional checkbox-based selection, bulk actions, folder utilities, and duplicate detection/filtering to CardWindow to improve multi-card management.
Files not reviewed (1)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
The null-coalescing and addition operators rely on precedence that makes this expression incorrect. Wrap each term to ensure each length null-coalesces before summation: (x.MissingPlugins?.Length ?? 0) + (x.MissingPluginsMaybe?.Length ?? 0) + (x.MissingZipmods?.Length ?? 0).
Corrected spelling of 'ExtenedDataCount' to 'ExtendedDataCount' in the CSV header.
Avoid empty catch blocks; they swallow errors and make troubleshooting difficult. At minimum, log the exception (e.g., Debug.WriteLine or Console.WriteLine) or show a non-blocking notification; similar empty catches appear at 915, 931, 945, and 969.
To prevent the system "beep" and ensure the key press is fully suppressed in WinForms, also set e.SuppressKeyPress = true when handling the Space key.
File.Move will throw on cross-volume moves (different drives). Fallback to a copy+delete on IOException (or detect different root paths) to reliably support moving to any folder; consider using File.Replace when overwriting on the same volume if desired.
Thanks, Marco! I originally made this as a small QoL tweak for myself, but I don’t mind sharing it if it helps others too, and honestly, if it gets implemented, I won’t have to rebuild it for myself every time there’s an update, lol.
Since I’m not exactly a “real” programmer, I’ve been relying on AI to do the coding. So it’s mostly “vibe-coded,” and despite prompting it not to delete existing code or documentation, it sometimes changes or tries “optimizing” things anyway.
Sorry if that makes it a bit messy, I'm trying to get better at this. If you’ve got any tips on how to better handle this, especially when it comes to using AI to code and not messing with previous code, I’d really appreciate it. Thanks!
I did it because of the drag & drop feature, which only works with selected cards, but like you said, maybe checkboxes should be treated like normal selections when that mode is enabled.
Being a "real" programmer isn't all that difficult really, it just means you're able to problem solve and look up useful information. You can even ask the LLM for explanations and pointers to further learning (of course don't trust it blindly but this is a decent use case).
If you use Visual Studio then you should be able to use the "git changes" tab to selectively pick the changes you want and undo unnecessary changes. Most modern IDEs should have git integration like this, I suggest playing around with it a bit.
My suggestion would be to try to split this PR into two - just the checkbox feature and just the additional filter. It should be a pretty good opportunity to learn some git basics.
As I've mentioned before if you use discord you can reach out on there to ask for pointers.
Thanks a lot for the help! I'll definitely look into it. I think I managed to make the changes you requested, I still need to look into how to split this into two separate PRs. Just bear with me, I might be a little busy for the moment.
Should I make a new PR with only the checkboxes feature? I'll also include the fix you merged for the filename column in CardWindow. And until the checkbox one gets merged, I'll make another for the duplicate filter as well.
I rolled back the changes to include only the checkbox feature and some of the requested adjustments, as well as other optimizations I updated in the 1st PR comment.
If this gets merged, I’ll make a separate PR for the duplicate filter feature.
Hope it’s now working as intended, sorry for the messy changes history!
If you prefer I open a new PR for this instead, I can do that too.
Please mark the PR as ready for review once it is ready for final review.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.