`RemoveCards` should return `OpChangesWithCount`

I’ve had a request that AnkiDroid should update its UI after 'Check → Empty Cards.

Architecturally, an ideal solution seems to be that RemoveCards should return an OpChanges[WithCount]

RemoveNotes returns collection.OpChangesWithCount

RemoveCards returns generic.empty


Implementation

ref:

1 Like

In case it can’t easily be done, I think this can be done directly in the DeckPicker’s callback after removing the cards is done.
Anyway, unless it becomes undoable, having a OpChanges from the backend is not needed.

For the context, the UI that I wanted to update is a widget, created during google summer of code.
I guess the deck picker should also update. I have not even realized that

1 Like

I’ve already implement this in the AnkiDroid code, longer-term it’d be better in the shared backend if at all possible

No longer requesting this: we have bigger fish to fry

Given that it seemed relatively simple to do (assuming we accept to make “Empty Cards” undoable) I opened a PR for it Empty cards become undoable by Arthur-Milchior · Pull Request #3386 · ankitects/anki · GitHub

1 Like