Skip to content

[Enhancement] Set default state for AnkiCollab suggestion checkbox#65

Open
LoackyBit wants to merge 4 commits into
CravingCrates:mainfrom
LoackyBit:patch-1
Open

[Enhancement] Set default state for AnkiCollab suggestion checkbox#65
LoackyBit wants to merge 4 commits into
CravingCrates:mainfrom
LoackyBit:patch-1

Conversation

@LoackyBit

Copy link
Copy Markdown

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.

  • The QCheckBox for "Suggest on AnkiCollab" in the init_add_card function is now set to checked by default (setChecked(True)).

@LoackyBit LoackyBit changed the title Set default state for AnkiCollab suggestion checkbox [Enhancement] Set default state for AnkiCollab suggestion checkbox Jan 14, 2026
@CravingCrates

Copy link
Copy Markdown
Owner

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.
Not every user wants to share every note they create and very often maintain both private and public decks so I feel like having them opt-in for the initial upload makes more sense.

What do you think?

@LoackyBit

Copy link
Copy Markdown
Author

@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

@CravingCrates

Copy link
Copy Markdown
Owner

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

@LoackyBit

LoackyBit commented Jan 19, 2026

Copy link
Copy Markdown
Author

@CravingCrates maybe there can be added an option in global settings to make the memory work even after closing.
For example:

  • Remember 'Suggest on AnkiCollab' state between sessions

@LoackyBit LoackyBit marked this pull request as draft January 19, 2026 20:09
@CravingCrates

Copy link
Copy Markdown
Owner

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?

@LoackyBit

Copy link
Copy Markdown
Author

sure

@LoackyBit LoackyBit closed this Jan 26, 2026
@LoackyBit LoackyBit reopened this Apr 29, 2026
@LoackyBit LoackyBit marked this pull request as ready for review April 29, 2026 17:54
@LoackyBit LoackyBit marked this pull request as draft April 29, 2026 17:55
@LoackyBit LoackyBit marked this pull request as ready for review April 30, 2026 10:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_sessions and suggest_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.

Comment thread plugin_source/hooks.py
Comment thread plugin_source/hooks.py
return

cfg = mw.addonManager.getConfig(__name__) or {}
settings = cfg.get("settings", {}) if isinstance(cfg, dict) else {}
Comment thread plugin_source/menu.py
Comment on lines +920 to +924
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."
)
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.

3 participants