"Undo Preferences" does not undo

I found this issue while demonstrating for someone how to change their Preferences. The changes I saved to test them out did not revert when I clicked Undo.

I don’t see anything else reported like this, or anything documented that certain Prefs changes cannot be undone. I haven’t tested beyond the specific preferences mentioned here.

Version info

Anki 24.06.2 (33a92379) (ao)
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
Platform: Windows-10-10.0.22621

Tested with all add-on disabled

Steps to reproduce:

  1. [Case A] On “Review” tab of Preferences, uncheck the “Spacebar” box (5th box down) in the Review section – and change the 4 mapped Answer keys.
    [Case B] On “Review” tab of Preferences, uncheck the first 5 boxes in the Review section – and change the 4 mapped Answer keys.
  2. Close.
  3. Click Edit > “Undo Preferences” – observe that confirmation message displays.
  4. Open preferences to see “Review” tab again.

Current behavior:

[Case A]
None of the changes revert.
[Case B]
The top 4 checkboxes revert to checked, but the other changes do not revert.

Expected behavior:

All 5 checkboxes revert to checked, and the answer keys revert.


Before changes:

Changes made:

Menu item for “Undo Preferences” and confirmation message:


After Undo:

1 Like

The problem here is the preference screen stores some settings in your profile, instead of your collection. We have undo infrastructure for the latter, but not the former. Changing them to collection settings would fix this, but be a little less efficient, and would require users to change their settings again unless we also migrated the existing settings over.

I’m glad to know there is a reason for it, but I don’t think that’s a solution. Doesn’t there need to be some sort of warning to the user then – that their changes will or might not be Undo-able? I was pretty surprised when it happened, and felt lucky that I had a reason to take a screenshot just before that, so I knew how to put everything back. (Prefs doesn’t have reset-to-default buttons like in Deck Options.)

The expectation has been built in to Anki is that pretty much everything is Undo-able (that’s the reason for no confirmation pop-ups, right?). I don’t think it’s fair to users to have this undisclosed gap in that. It seems like there are a few ways to handle this –

  1. Migrate the profile-stored settings to the collection, so they are included in the undo infrastructure.

  2. Take all Preferences-screen settings out of the undo infrastructure. Pop-up warn before closing Prefs that changes will be permanent.

  3. Leave the undo infrastructure and settings as-is. Pop-up warn all users before closing Prefs that changes might be permanent.

  4. Leave the undo infrastructure and settings as-is. Pop-up warn before closing Prefs that changes will be permanent – but only to users making changes to the profile-stored settings.

  5. Leave the undo infrastructure and settings as-is. Rearrange the Preferences screens to group together profile-stored settings. Include a changes-will-be-permanent warning in that group of settings. [Alternative-- *'ing the settings and adding a changes-will-be-permanent warning in a footnote.]

  6. Leave the undo infrastructure and settings as-is. Leave the Preferences screens as-is. But at least prevent changes to the profile-stored settings from creating an entry in the Undo “queue” (since it’s not true).

[Did I deliberately include some options that I believe you’ll find unpalatable, just to make the other options look more attractive? … maybe.]

I’ve logged it on “Undo Preferences” does not undo · Issue #3303 · ankitects/anki · GitHub

Making these options be stored in the collection is likely going to be the path of least resistance, but it doesn’t fully solve the problem, as the sync key still needs to be stored separately.

1 Like