Select-all in history, and a confirmation before batch delete - #36
Merged
Conversation
… card at once (and selects the remainder rather than clearing when only some are ticked), the toolbar rebuilds once per bulk toggle instead of once per card, refresh syncs it after the cards exist rather than before, and batch delete now asks first — select-all turned wiping the whole index into two clicks with no undo.
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.
Requested: a select-all for the history page. With hundreds of cards, ticking them one at a time to batch-translate or batch-delete isn't practical.
Select all
A tristate checkbox in the toolbar:
Clicking it from the partial state selects the remainder rather than clearing — continuing upward is the likelier intent when you have already ticked a few. Only the fully-checked state clears.
Details worth knowing:
clicked, nottoggled.clickedfires only for a real click, so the programmaticsetCheckState()that keeps the box in sync with the cards can't loop back into the handler.refresh()called_sync_delete_button()at the top, before the cards were built, so it always measured an empty page. It now syncs again after the loop.Batch delete asks first
Not requested, and easy to drop if it isn't wanted — but select-all turns "erase the entire history index" into two clicks, and delete has no undo. The batch path now confirms; the per-card ✕ is unchanged and still deletes on one click.
It removes records only, never the subtitle files on disk, and the dialog says so. The buttons carry our own i18n labels because Qt's standard buttons follow the system locale rather than the app's language setting.
This change is load-bearing enough to have hung an existing test —
test_history_delete_single_and_batchdrives the batch path and blocked on the real modal — which is updated to confirm explicitly.Tests
204 passed / 5 skipped. Three new: the tristate round trip including the partial-state behaviour, the box hiding when there is nothing to select, and both branches of the confirmation plus a single-row delete not triggering it.