Mockup: in-editor field protection toggle#1281
Draft
RisingOrange wants to merge 2 commits into
Draft
Conversation
Adds a padlock icon to each field header in the note editor that reflects the note's current AnkiHub_Protect tags and toggles them on click. Intended for design review via screenshots before being promoted to a finished feature.
Shield reads as "protection" naturally, works cleanly at 14px, and leaves room for AnkiHub branding treatment later if we decide the origin needs to be more visually explicit.
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.
Design mockup for moving the "protect fields" UI out of its separate browser-context-menu dialog and into the note editor itself, so users can see each field's protection state at a glance and toggle it in place.
This is intentionally unpolished — it's being put up as a draft so the team can pull the branch, open a note in the editor, take screenshots of variants, and decide on the final direction before we invest in productionizing it.
Related issues
Proposed changes
ankihub/gui/field_protection.pyinjecting a small padlock button into each field header in the note editor.AnkiHub_Protect::<FieldName>tag on the note, persists viacol.update_note, and reloads the editor so the UI reflects the new state.AnkiHub_Protect::Allis handled: toggling one field off expands it into per-field tags minus the unprotected one; toggling the last missing field back on collapses to::All.ankihub_db.is_ankihub_note_type(...)and skips the internalankihub_idfield.Only per-note (tag-based) protection is surfaced. Per-notetype protection (
ProtectedFieldsSet) is a deliberate follow-up, possibly as a second icon or a dropdown on the same control.How to reproduce
<>HTML toggle area.Screenshots and videos
To be added once we pick a variant.
Further comments
Open design questions for team input:
<>toggle to group per-field controls together. Trade-off: state indicator vs. action cluster. Easy to flip either way.#f59e0b) for "protected". Neutral choice — red reads as danger/error, green reads as "good", blue reads as "info/link". Happy to try alternatives.pickHeader()with fallbacks (.label-container,.field-state,[class*="label"], firstChild). Works on Anki 25.09.2. Older versions may place the icon unexpectedly — needs hardening before ship.