[NRT-508] Automatically protect fields when edited#1259
[NRT-508] Automatically protect fields when edited#1259RisingOrange wants to merge 6 commits intomainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces an "auto-protect" feature that automatically tags fields as protected when a user edits them, preventing local changes from being overwritten by future AnkiHub syncs. It also incorporates handling for globally protected fields, caching them locally and ensuring they are not personally protected to avoid conflicts if global protection is later removed. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
eb699e1 to
813df27
Compare
Add auto_protect_fields_when_edited option to DeckConfig that, when enabled, automatically adds AnkiHub_Protect tags when a user edits a field in the editor. Globally protected fields (cached from the API at sync time) are skipped to avoid redundant personal tags. Also updates the Protect Fields dialog to show globally protected fields as disabled items, fixes the protect fields docs link, and applies minor UI improvements to the Deck Management dialog.
Add auto-protect feature that automatically tags fields as protected when users edit them, preventing future AnkiHub syncs from overwriting local changes. Globally protected fields (set by deck owners on the web app) are cached locally and skipped to avoid conflicts when global protection is later removed. Also includes UI improvements to the Deck Management dialog (new checkbox, heading style, spacing) and the Protect Fields dialog (globally protected fields shown as greyed-out, OK disabled when unchanged).
Related issues
Proposed changes
auto_protect_fields_when_editedtoggle (enabled by default) andglobally_protected_fieldscache toDeckConfigeditor_did_unfocus_fieldto auto-addAnkiHub_Protect::FieldNametags when a field is edited (skips unchanged fields, non-AnkiHub notes, the ankihub_id field, already protected fields, and globally protected fields)choose_subset): Addchecked_and_disabled_choicesparam to show globally protected fields as greyed-out non-interactive items; adddisable_ok_when_unchangedparam; useApplicationModalso the dialog has a title bar on macOSdeck_updater.py) and on initial install (deck_installation.py)How to reproduce
AnkiHub_Protect::FieldNametag is added to the noteAnkiHub_Protecttag is added for itScreenshots and videos
N/A — UI changes are minimal (one checkbox added to existing options panel)
Further comments