Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

Introduce ChangeNoteType Dialog

Open Haz3-jolt opened this issue 6 months ago • 16 comments

Purpose / Description

Introduces the changeNoteTypeDialog and changeNoteTypeViewModel

Fixes

  • Fixes #14134

How Has This Been Tested?

Pixel 9 Pro (Android 1

Screenshot 2025-07-19 at 08 41 01 Screenshot 2025-07-19 at 08 41 45 Screenshot 2025-07-19 at 08 42 37

Checklist

Please, go through these checks before submitting the PR.

  • [x] You have a descriptive commit message with a short title (first line, max 50 chars).
  • [x] You have commented your code, particularly in hard-to-understand areas
  • [x] You have performed a self-review of your own code
  • [x] UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • [x] UI Changes: You have tested your change using the Google Accessibility Scanner
    • ❗️ It doesn't like the fixed height of our spinner control - we should add an issue

Haz3-jolt avatar Jun 22 '25 19:06 Haz3-jolt

[!IMPORTANT] Maintainers: This PR contains https://github.com/ankidroid/Anki-Android/labels/Strings changes

  1. Sync Translations before merging this PR and wait for the action to complete
  2. Review and merge the auto-generated PR in order to sync all user-submitted translations
  3. Sync Translations again and merge the PR so the huge automated string changes caused by merging this PR are by themselves and easy to review

github-actions[bot] avatar Jun 22 '25 19:06 github-actions[bot]

Progress temporarily moved to https://github.com/david-allison/Anki-Android/commits/changeNT/. Still rough

david-allison avatar Jun 27 '25 02:06 david-allison

I've finished this off with a small number of TODOs remaining and will leave someone else to get this over the finish line in terms of code.

I think we could merge as-is, but there are a few 'nice to haves' which aren't handled yet

I did not test:

  • themes other than 'black'
  • tablets
  • RTL design
  • ⚠️ saving and restoring instance state to SaveHandle

  • We don't show the user inputs anywhere in the dialog (selected input note type/ids)
  • I don't like the centering of the 'output' template name, but can't figure a better way of doing this
  • Long field/card names are a problem due to truncation

david-allison avatar Jun 29 '25 02:06 david-allison

@Haz3-jolt I think this is done, if you have free time, could you take a look and be sure you're happy with my changes

david-allison avatar Jul 19 '25 08:07 david-allison

@Haz3-jolt It's been a long time since I worked on it.

I believe I was happy at the time, but didn't want to approve my own work.

  • Are there util changes which we can extract into a separate PR?
  • Can we de-risk this by moving it behind a 'developer-only' flag?

david-allison avatar Oct 27 '25 17:10 david-allison

@Haz3-jolt It's been a long time since I worked on it.

I believe I was happy at the time, but didn't want to approve my own work.

* Are there util changes which we can extract into a separate PR?

* Can we de-risk this by moving it behind a 'developer-only' flag?

Hey!, currently caught in the middle of finals month, so been stuck with it for a while,

So far in terms of util changes, I wanted to splinter off ViewModelUtils.kt into a separate PR, but not much for the others, since the feature is kinda tightly coupled for all the new files.

And yeah I think we should do developer-only for now, change note type is extremely destructive similar to find-and-replace, plus we have no way of testing for every possible edge case until we get some proper user testing.

Haz3-jolt avatar Oct 27 '25 18:10 Haz3-jolt

But from my testing so far, it does work as intended, and has parity with desktop, so it should be fine.

Haz3-jolt avatar Oct 27 '25 18:10 Haz3-jolt

Also Anki shows a warning dialog, we should also do that and IMO it should not be difficult Screenshot 2025-11-05 at 11 17 23 PM

criticalAY avatar Nov 05 '25 18:11 criticalAY

Also Anki shows a warning dialog, we should also do that and IMO it should not be difficult Screenshot 2025-11-05 at 11 17 23 PM

I'll address this tomorrow, it's getting late here.

Haz3-jolt avatar Nov 08 '25 23:11 Haz3-jolt

Also Anki shows a warning dialog, we should also do that and IMO it should not be difficult Screenshot 2025-11-05 at 11 17 23 PM

Is this something on the mac version? Isn't the case on Windows, it doesn't show up.

Haz3-jolt avatar Nov 09 '25 10:11 Haz3-jolt

this.launchCatchingRequiringOneWaySync { should be showing the dialog; but we likely also want a better 'help' screen here

david-allison avatar Nov 09 '25 13:11 david-allison

this.launchCatchingRequiringOneWaySync

I have quite a bit of free time this weekend, can you get me up to speed on what this screen will actually need? Do we copy the warning text on Anki on the Mac platform for our dialog? or do we create our own custom dialog.

Haz3-jolt avatar Nov 27 '25 15:11 Haz3-jolt

(I wrote a reply and lost it, then encountered another bug when trying to test launchCatchingRequiringOneWaySync . I'm not going to have time to give an example, but it SHOULD appear if the user has an AnkiWeb account linked, sync, then uses this screen, and be similar to Anki Desktop):

  • I want to focus on getting this merged as a developer setting, it should be good to go now
  • I think we can get away with showing a message on the screen, before OK is pressed:
    • This operation requires a one-way sync of your collection [learn more]

  • I'm concerned this has stalled (not your fault at all!), and I feel the above can be a TODO if this is merged as a developer-only/experimental option
  • I'm going to have time for this in 2.24, please push me here, I really want this one in

david-allison avatar Nov 27 '25 18:11 david-allison

Should be done with this!

Haz3-jolt avatar Nov 28 '25 20:11 Haz3-jolt

The colors look off in night mode

Screenshot 2025-12-04 at 13 30 29

david-allison avatar Dec 04 '25 06:12 david-allison

Fixed!

Haz3-jolt avatar Dec 05 '25 20:12 Haz3-jolt