Skip to content

Select-all in history, and a confirmation before batch delete - #36

Merged
TN019 merged 1 commit into
mainfrom
history-select-all
Aug 7, 2026
Merged

Select-all in history, and a confirmation before batch delete#36
TN019 merged 1 commit into
mainfrom
history-select-all

Conversation

@TN019

@TN019 TN019 commented Aug 7, 2026

Copy link
Copy Markdown
Owner

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:

state shows
nothing selected ☐ Select all
some selected ▣ 1 of 3 selected
all selected ☑ 3 of 3 selected

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:

  • It listens on clicked, not toggled. clicked fires only for a real click, so the programmatic setCheckState() that keeps the box in sync with the cards can't loop back into the handler.
  • A bulk toggle suspends the toolbar rebuild and does it once at the end, instead of once per card — this page can hold several hundred rows.
  • Fixed along the way: 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_batch drives 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.

… 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.
@TN019
TN019 merged commit b427477 into main Aug 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant