Intuitive field management screen

Hello.
I’m one of the Anki & Ankidroid users. I’m using everyday to study English words (I am Japanese), and grateful to these Apps.

The other day, I felt field management screen unfonfrtable and came up with a new field management screen, that will allow users to edit more intuitively.

I made a prototype (see below). How about it? This includes the migration to viewmodel and Coroutines to catch up with the modern implementation and the feature of showing the current keyborad hint, not implemented yet in official.

Video

(link fixed)

source code is here

Let me know what you think.

1 Like

The video link says 404.

I’m sorry.
I tried to reupload the video and paste the url of it, but this forum site says “An error occurred: Sorry, you can’t include links in your posts.” So, I uploaded it on gist. Please access to
S-H-Y-A/intuitive-field-management-screen_links.md (or combine “/S-H-Y-A/112b8e4c1971534fb628d23841a7a440” to the home url of gist.)

Looks really good!

However, I believe there should be a save button and the ability to discard changes, since some actions are dangerous and require a full sync.

1 Like

Of cause, if sync is enabled, the dialog will show up when it needs one-way sync. (though I cannot show you the screenshot due to the restriction)

To show snackbar with the button for undo actions is a good way, but I’m looking for the way to undo programically.

1 Like

I believe that native Anki’s undo/redo feature is the best option, but found the current field management operation depends on the Ankidroid backend operation, that doesn’t provide native Anki’s undo/redo information. There is an alternative operation which support it, except for language hint, as language hint is not the native Anki’s feature, but Ankidroid’s feature. To resolve this, I need to modify Ankidroid backend. I will continue to explore other possible solutions.

1 Like

I’ve made it possible to undo the field change via the deckpicker menu. However, it turned out that language settings cannot be undone definitely because native Anki’s undo/redo feature can recognize only database manipulation defined by Anki. To avoid user’s confusion, I added a menu item to show the dialog to tell the way to undo and this technical limitation.


I’m ready to open a PR, but are there any suggestions before I do?

Wouldn’t it be better to have a save button and not apply the changes until the button is tapped?

That’s how Anki Desktop works, btw.

1 Like

I see. I wanted to remove as many required user action as possible, but changed my mind. It is better to have a save button to clarify changes and coinside with the Anki desktop, as you mentioned.
I’ll put a save button. Have you any other suggestions?

1 Like

Great! Since the changes before saving will be temporary in the screen, I imagine that it would be possible to have an undo snackbar when deleting a field, right?

Oh and another thing that is not clear from the video: when adding, deleting or otherwise modifying a field in the current screen, it scrolls to the top, which is annoying when you have many fields and you want to rename them. I hope that your implementation keeps the scroll position.

Showing snackbar with the button to undo delete action is nice!
Moving to the top position is a bug. It seems that saving language settings doesn’t work properly. I’ll also approach that issue.

1 Like

If you mean this bug Set keyboard language hint breaks if you type in a language other than the hint language · Issue #19839 · ankidroid/Anki-Android · GitHub, then you should know that others have tried and it “doesn’t seem fixable”.

Thank you for the information.The bug was caused by a mistake in my code and is unrelated to issue #19839. I have fixed it.
I added a save button; now, when the field properties are changed, an undo snackbar will appear. I’ll open a PR if there are no objections.

1 Like