Feature: Initial visibility config, default pen selection, and tag-based auto-toggle#57
Open
wasubu wants to merge 4 commits intoRytisgit:masterfrom
Open
Feature: Initial visibility config, default pen selection, and tag-based auto-toggle#57wasubu wants to merge 4 commits intoRytisgit:masterfrom
wasubu wants to merge 4 commits intoRytisgit:masterfrom
Conversation
…make it visible and hide after reviewing
Rytisgit
reviewed
Jan 31, 2026
|
|
||
| ts_profile_loaded = False | ||
|
|
||
| saved_value_defaults = { |
Owner
There was a problem hiding this comment.
new config fields items should go here, and be editable in the menu. Here is an example of an option being added https://github.com/Rytisgit/Anki-StylusDraw/pull/48/changes
Rytisgit
reviewed
Jan 31, 2026
| @@ -0,0 +1,4 @@ | |||
| { | |||
| "start_visible": true, | |||
Owner
There was a problem hiding this comment.
adding the separate config.json here is not correct as mentioned in the previous comment
Rytisgit
reviewed
Jan 31, 2026
|
|
||
| from aqt.qt import QTimer | ||
|
|
||
| def apply_visibility_logic(): |
Owner
There was a problem hiding this comment.
how does this work for people who would like to keep the current behaviour, it looks like apply_visibility_logic will run even if start_visible is true and disable the visibility if no tag is present
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.
This pull request introduces new configuration options and logic to better control the initial state of the drawing canvas.
Changes:
start_visible: Boolean option to determine if the canvas should be open by default when reviewing.
default_pen_index: Integer option to set the active pen when the card loads.
Added a check for the tag "draw" on the current note.
If the "draw" tag is present, the canvas is forced to show regardless of the default configuration.
If the tag is absent, it respects the specific hide/show logic defined in the configuration.
Implemented forceShowCanvas() and forceHideCanvas() functions to programmatically control display states.
Added a Python hook to showQuestion (with a slight QTimer delay) to evaluate tags and trigger the Javascript state changes.
Known Issues: