feat: support deleting selected note types#4777
Draft
caleblee789 wants to merge 1 commit into
Draft
Conversation
Documentation build overview
3 files changed± genindex.html± autoapi/aqt/models/index.html± autoapi/aqt/operations/notetype/index.html |
|
Adding multi select like on AnkiDroid would be better imo. Users don't usually (and regularly) have many unused note types. |
Author
|
I import a lot of decks, so I frequently have to clear many note types, but I could see where most people wouldn't. If this is preferred, I could port the change over to multiselect instead. |
57d0294 to
ab336eb
Compare
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.
Linked issue (required)
N/A
Summary / motivation (required)
Replaces the proposed Clean Up button in the Manage Note Types dialog with multi-select deletion support.
Users can now select multiple note types in the dialog and press the existing Delete button to remove the selected note types in one confirmed operation. Single-selection delete keeps the existing behavior and confirmation text. When every note type is selected, the current row is preserved so the collection keeps at least one note type.
The bulk delete path:
Steps to reproduce (required, use N/A if not applicable)
N/A
How to test (required)
Checklist (minimum)
./ninja checkor an equivalent relevant check locally.Details
Ran:
out/pyenv/bin/ruff format --check qt/aqt/models.py qt/aqt/operations/notetype.py qt/tests/test_notetype_delete.pyout/pyenv/bin/ruff check qt/aqt/models.py qt/aqt/operations/notetype.py qt/tests/test_notetype_delete.pygit diff --check main...HEADPYTHONPYCACHEPREFIX=/private/tmp/anki-pycache python3 -m compileall qt/aqt/models.py qt/aqt/operations/notetype.py qt/tests/test_notetype_delete.pyAttempted
./ninja check:pytest, but this checkout failed before pytest while initializing local build inputs: git submodule config lock errors forftl/*-repoand missing MDI SVGs underout/node_modules.Attempted focused pytest for
qt/tests/test_notetype_delete.py, but direct invocation failed during collection because this local source/generated import path hits an existinganki.modelscircular import before collecting tests.Before / after behavior (optional)
Before: the PR added a separate Clean Up action that removed all unused note types.
After: users select one or more note types in the existing list and press Delete. Multiple selected note types are deleted together, including used note types after a stronger warning.
Risk / compatibility / migration (optional)
Moderate UI risk. The existing Delete action now considers multi-selection, but single-selection deletion remains unchanged. The bulk operation revalidates IDs in the collection operation, preserves at least one note type, and merges multiple removals into a single undo step.
UI evidence (required for visual changes; otherwise N/A)
Not captured. The UI change is interaction behavior in the existing Manage Note Types dialog: the note type list now supports extended selection, and the existing Delete button applies to the selected rows.
Scope