Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Make suspension settings into per-deck options #779

Merged
merged 117 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from 105 commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
af07d39
Add card-suspension options to deck config
RisingOrange Oct 11, 2023
86a9af8
Set `suspend_new_cards_of_new_notes=True` when installing AnKing deck
RisingOrange Oct 11, 2023
49d90ea
Add migration to set `suspend_new_cards_of_new_notes=True` for instal…
RisingOrange Oct 11, 2023
f1938c6
Change layout
RisingOrange Oct 15, 2023
6161599
Reorganize bottom right box
RisingOrange Oct 15, 2023
8927d68
ref: Extract create_collaborative_deck operation
RisingOrange Oct 15, 2023
7575894
Add button for creating new deck
RisingOrange Oct 15, 2023
28ff9de
Refresh bottom right layout when deck is selected
RisingOrange Oct 15, 2023
46627f0
Set minimum width to 640
RisingOrange Oct 15, 2023
3b52b08
Share space equally between bottom layouts
RisingOrange Oct 15, 2023
d7666a0
Set mimimum height
RisingOrange Oct 15, 2023
2ade68c
Add spacing
RisingOrange Oct 15, 2023
41a0891
Replace subdecks button with checkbox
RisingOrange Oct 16, 2023
2887297
Disable subdeck checkbox if no subdeck tags
RisingOrange Oct 16, 2023
67807c7
Replace home_deck_btn with updates destination section
RisingOrange Oct 16, 2023
5039e82
Adjust spacing of box_bottom_right
RisingOrange Oct 16, 2023
c2da7f0
Style buttons
RisingOrange Oct 16, 2023
4c1be05
Add links to docs
RisingOrange Oct 16, 2023
76e0b74
Adjust spacing
RisingOrange Oct 16, 2023
511b7d5
Fix test
RisingOrange Oct 16, 2023
f32471a
Remove unused SubscribeDialog
RisingOrange Oct 16, 2023
2fa529d
Add test
RisingOrange Oct 16, 2023
05624a9
Only display installed decks in list
RisingOrange Oct 16, 2023
e815edd
Remove unused code
RisingOrange Oct 16, 2023
5022ca0
ref: Move call to `_refresh_subdecks_checkbox`
RisingOrange Oct 16, 2023
f91d0d0
Refactor tests
RisingOrange Oct 16, 2023
fafd356
Add test for updates destination setting
RisingOrange Oct 16, 2023
16dc24c
ref: Extract create_collaborative_deck operation
RisingOrange Oct 15, 2023
85aa1c8
Remove unused SubscribeDialog
RisingOrange Oct 16, 2023
ea559a3
Change layout
RisingOrange Oct 15, 2023
25dbade
Reorganize bottom right box
RisingOrange Oct 15, 2023
3140806
Add button for creating new deck
RisingOrange Oct 15, 2023
258083c
Refresh bottom right layout when deck is selected
RisingOrange Oct 15, 2023
c3058f5
Set minimum width to 640
RisingOrange Oct 15, 2023
ac3467c
Share space equally between bottom layouts
RisingOrange Oct 15, 2023
33ed791
Set mimimum height
RisingOrange Oct 15, 2023
3eae64c
Add spacing
RisingOrange Oct 15, 2023
ca03f61
Replace subdecks button with checkbox
RisingOrange Oct 16, 2023
efdb74b
Disable subdeck checkbox if no subdeck tags
RisingOrange Oct 16, 2023
b224bb9
Replace home_deck_btn with updates destination section
RisingOrange Oct 16, 2023
199310c
Adjust spacing of box_bottom_right
RisingOrange Oct 16, 2023
2eef221
Style buttons
RisingOrange Oct 16, 2023
03d3043
Add links to docs
RisingOrange Oct 16, 2023
1d4edb6
Adjust spacing
RisingOrange Oct 16, 2023
54b9a4f
Fix test
RisingOrange Oct 16, 2023
039a586
Add test
RisingOrange Oct 16, 2023
2672094
Only display installed decks in list
RisingOrange Oct 16, 2023
bccce3d
Remove unused code
RisingOrange Oct 16, 2023
09bd595
ref: Move call to `_refresh_subdecks_checkbox`
RisingOrange Oct 16, 2023
a6fdb3b
Refactor tests
RisingOrange Oct 16, 2023
53ad08b
Add test for updates destination setting
RisingOrange Oct 16, 2023
58c276f
Merge branch 'feat/redesign-decks-dialog' of github.com:ankipalace/an…
RisingOrange Oct 16, 2023
3cf473f
Fix typo in comment
RisingOrange Oct 16, 2023
1acbd45
Add test
RisingOrange Oct 17, 2023
5931f9d
Increase coverage
RisingOrange Oct 17, 2023
508aec5
Merge branch 'ref/move-create-collaborative-deck' into feat/redesign-…
RisingOrange Oct 17, 2023
49b7fdb
Fix `install_ah_deck` fixture
RisingOrange Oct 17, 2023
5e93120
Refactor test
RisingOrange Oct 17, 2023
3a003e1
Remove Deck Operations label
RisingOrange Oct 17, 2023
79d189e
Replace "Deck Settings" with "Deck Options"
RisingOrange Oct 17, 2023
5beed10
Rename "Update destination" to "Destination for New Cards"
RisingOrange Oct 17, 2023
86e7c45
Adjust case
RisingOrange Oct 17, 2023
55cdca3
Display selected deck name above options
RisingOrange Oct 17, 2023
4fe0e45
Remove the Add button from the deck chooser dialog
RisingOrange Oct 17, 2023
cccfdb8
Adjust spacing
RisingOrange Oct 17, 2023
82ff9ec
Rename dialog to `DeckManagementDialog`
RisingOrange Oct 17, 2023
0bb4e98
Refactor tests
RisingOrange Oct 17, 2023
0376b09
Rename to `Deck Management` in the menu
RisingOrange Oct 17, 2023
c6bd395
Move tooltip icon to the right of the text
RisingOrange Oct 17, 2023
1b8cf34
Adjust comment
RisingOrange Oct 17, 2023
66e9c3e
fixup updates destination
RisingOrange Oct 18, 2023
3922fe7
Remove unused code
RisingOrange Oct 18, 2023
8652eec
Refactor fixture
RisingOrange Oct 18, 2023
a4f91e4
Refactor code related to selected decks
RisingOrange Oct 18, 2023
a68de02
Make subdecks checkbox text gray when disabled
RisingOrange Oct 18, 2023
f4c55d7
Enabble word wrap for deck_name_label
RisingOrange Oct 18, 2023
73bc97a
Adjust spacing
RisingOrange Oct 18, 2023
12c8aa9
Merge branch 'feat/redesign-decks-dialog' into feat/set-suspend-new-c…
RisingOrange Oct 18, 2023
36205e5
Use enum for `suspend_new_cards_of_existing_notes`
RisingOrange Oct 18, 2023
76c018a
Remove suspension settings from global config
RisingOrange Oct 18, 2023
f4687ff
Add suspension options to decks dialog
RisingOrange Oct 18, 2023
ee6d03e
Change suspension logic in importer
RisingOrange Oct 18, 2023
850b598
Pass in suspension options as parameters to importer
RisingOrange Oct 18, 2023
28d0eef
Make factory generate unique anki ids
RisingOrange Oct 18, 2023
8afe8fb
Fix tests
RisingOrange Oct 18, 2023
5830a52
Truncate long deck names
RisingOrange Oct 18, 2023
78a14a3
Fix json serialization of `DeckConfig`
RisingOrange Oct 18, 2023
a0f5d2c
Adjust subdecks tooltip message
RisingOrange Oct 18, 2023
cac892f
Merge branch 'feat/redesign-decks-dialog' into feat/set-suspend-new-c…
RisingOrange Oct 18, 2023
8f16a2a
Merge branch 'feat/set-suspend-new-cards-of-new-notes-to-true-for-ank…
RisingOrange Oct 18, 2023
5ffbd01
Add tooltip for `suspend_new_cards_of_new_notes` checkbox
RisingOrange Oct 18, 2023
0b6c052
Add tooltip for `suspend_new_cards_of_existing_notes`
RisingOrange Oct 18, 2023
a4a3789
Extract ui setup for suspension options into methods
RisingOrange Oct 18, 2023
a73e45a
feat: Define defaults for the Suspend new cards of new notes option (…
RisingOrange Oct 19, 2023
14f8339
Merge branch 'main' into feat/redesign-decks-dialog
RisingOrange Oct 19, 2023
ff3ea6a
Merge branch 'feat/redesign-decks-dialog' into feat/make-suspension-s…
RisingOrange Oct 19, 2023
e84964c
Adjust spacing
RisingOrange Oct 19, 2023
abd02fc
Adjust spacing
RisingOrange Oct 19, 2023
9aab76c
Change copy to "Create AnkiHub Deck"
RisingOrange Oct 19, 2023
3d843e7
Merge branch 'feat/redesign-decks-dialog' into feat/make-suspension-s…
RisingOrange Oct 19, 2023
ace182b
ref: Reorganize ui setup statements
RisingOrange Oct 19, 2023
1b6d202
Merge branch 'feat/redesign-decks-dialog' into feat/make-suspension-s…
RisingOrange Oct 19, 2023
97b4bc8
ref: Remove unused `_refresh_anki` method
RisingOrange Oct 19, 2023
81a9266
Merge branch 'feat/redesign-decks-dialog' into feat/make-suspension-s…
RisingOrange Oct 19, 2023
289178e
Fix suspend new cards of new notes option
RisingOrange Oct 19, 2023
97f817b
Extract `_setup_box_deck_actions`
RisingOrange Oct 19, 2023
6916e2a
Rename `box_deck_settings` to `box_deck_options`
RisingOrange Oct 19, 2023
5524111
Extract `_setup_deck_options`
RisingOrange Oct 19, 2023
8063519
Extract `_setup_destination_for_new_cards`
RisingOrange Oct 19, 2023
d3a7ec9
Edit comment
RisingOrange Oct 19, 2023
09486cd
Reorder methods
RisingOrange Oct 19, 2023
290b815
Reorder statements
RisingOrange Oct 19, 2023
511751b
Merge branch 'feat/redesign-decks-dialog' into feat/make-suspension-s…
RisingOrange Oct 19, 2023
b3f0e7b
ref: Reorganize statements in `_setup_box_suspend_new_cards_of_existi…
RisingOrange Oct 19, 2023
a2de991
ref: Reorganize statements in `_setup_box_suspend_new_cards_of_new_no…
RisingOrange Oct 19, 2023
afec259
Merge branch 'feat/redesign-decks-dialog' into feat/make-suspension-s…
RisingOrange Oct 19, 2023
efd9a02
Merge branch 'main' into feat/make-suspension-settings-per-deck
RisingOrange Oct 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions ankihub/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"report_errors": true,
"sync_hotkey": "Ctrl+Shift+h",
"auto_sync": "on_ankiweb_sync",
"suspend_new_cards_of_existing_notes": "if_siblings_are_suspended",
"suspend_new_cards_of_new_notes": "always",
"debug_level_logs": false,
"use_staging": false
}
12 changes: 0 additions & 12 deletions ankihub/gui/config_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,6 @@ def _general_tab(conf_window) -> None:
values=["on_ankiweb_sync", "on_startup", "never"],
description="Auto Sync with AnkiHub",
)
tab.dropdown(
"suspend_new_cards_of_existing_notes",
labels=["If sibling cards are suspended", "Always", "Never"],
values=["if_siblings_are_suspended", "always", "never"],
description="Suspend new cards of existing notes",
)
tab.dropdown(
"suspend_new_cards_of_new_notes",
labels=["Always", "Never"],
values=["always", "never"],
description="Suspend new cards of new notes",
)
tab.hseparator()
tab.space(8)

Expand Down
2 changes: 2 additions & 0 deletions ankihub/gui/deck_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ def _download_updates_for_deck(self, ankihub_did) -> bool:
protected_fields=chunk.protected_fields,
protected_tags=chunk.protected_tags,
subdecks=deck_config.subdecks_enabled,
suspend_new_cards_of_new_notes=deck_config.suspend_new_cards_of_new_notes,
suspend_new_cards_of_existing_notes=deck_config.suspend_new_cards_of_existing_notes,
)
self._import_results.append(import_result)

Expand Down
Loading
Loading