[Enhancement] Set default state for AnkiCollab suggestion checkbox#65
[Enhancement] Set default state for AnkiCollab suggestion checkbox#65LoackyBit wants to merge 4 commits into
Conversation
|
That's an interesting idea, but I'm not sure its something we want. The button already has a "memory" function so it stays checked, but the initial check needs to be done manually. What do you think? |
|
@CravingCrates I didn't know there was a memory function. How can I enable it? I'm asking because when I check the button and I try to add a new card the button isn't already checked |
|
You shouldn't have to enable it. Once you check the box, it should stay checked until you close the window. Of course it also means, you have to enable it once per study-session but that's good enough in my opinion |
|
@CravingCrates maybe there can be added an option in global settings to make the memory work even after closing.
|
|
Yeah I guess we could do that. Would you be down to suggest that on the discord server for voting and if the community gives a thumbs up we can add it? |
|
sure |
There was a problem hiding this comment.
Pull request overview
This PR updates the AnkiCollab Add Cards dialog behavior by introducing a global setting to optionally remember the “Suggest on AnkiCollab” checkbox state across sessions, and adds corresponding config defaults.
Changes:
- Add a new global setting: “Remember 'Suggest on AnkiCollab' state between sessions”.
- Persist and restore the “Suggest on AnkiCollab” checkbox state in the Add Cards dialog when the new setting is enabled.
- Extend default config with
remember_suggest_state_between_sessionsandsuggest_on_ankicollab_last_state.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
plugin_source/menu.py |
Adds the new global settings checkbox, saves it to config, and introduces default config keys for the behavior. |
plugin_source/hooks.py |
Initializes the Add Cards “Suggest on AnkiCollab” checkbox based on config and persists toggles when enabled. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return | ||
|
|
||
| cfg = mw.addonManager.getConfig(__name__) or {} | ||
| settings = cfg.get("settings", {}) if isinstance(cfg, dict) else {} |
| remember_suggest_state_cb = QCheckBox("Remember 'Suggest on AnkiCollab' state between sessions") | ||
| remember_suggest_state_cb.setChecked(bool(settings.get("remember_suggest_state_between_sessions", False))) | ||
| remember_suggest_state_cb.setToolTip( | ||
| "When enabled, the add-on will remember whether the 'Suggest on AnkiCollab' checkbox in the Add Cards dialog was last checked or not, even after restarting Anki." | ||
| ) |
This pull request makes a minor user experience improvement to the add card dialog in the AnkiCollab plugin. The "Suggest on AnkiCollab" checkbox is now checked by default, making it easier for users to suggest cards.
QCheckBoxfor "Suggest on AnkiCollab" in theinit_add_cardfunction is now set to checked by default (setChecked(True)).