Skip to content

Introduce ChangeNoteType Dialog#18602

Merged
david-allison merged 1 commit intoankidroid:mainfrom
Haz3-jolt:changeNT
Jan 19, 2026
Merged

Introduce ChangeNoteType Dialog#18602
david-allison merged 1 commit intoankidroid:mainfrom
Haz3-jolt:changeNT

Conversation

@Haz3-jolt
Copy link
Member

@Haz3-jolt Haz3-jolt commented Jun 22, 2025

Purpose / Description

Introduces the changeNoteTypeDialog and changeNoteTypeViewModel

Fixes

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.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • 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

@github-actions
Copy link
Contributor

Important

Maintainers: This PR contains 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

@Haz3-jolt Haz3-jolt force-pushed the changeNT branch 3 times, most recently from 94aef84 to 9fd2a79 Compare June 22, 2025 20:15
@Haz3-jolt Haz3-jolt marked this pull request as ready for review June 22, 2025 20:37
Copy link
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

People have been wanting this for AGES, thanks so much!! 🥳🥳🥳🥳🥳

Looks great, cheers!

SO many users will love this, let me know if you want me to dig in and rebase/force push to get this up to scratch

Crash (resolved)

1 card: Basic

  • Go to 'Templates'
  • Change' Type' to 'Basic & Reversed'

Crash

2025-06-22 21:38:42.737 24328-24328 ChangeNote...ateSpinner com.ichi2.anki.debug                 D  Updating card mapping: old template 0 -> new template 0
2025-06-22 21:38:42.738 24328-24328 ChangeNote...ateSpinner com.ichi2.anki.debug                 D  Updating card mapping: old template 1 -> new template null
2025-06-22 21:38:42.738 24328-24328 ChangeNoteTypeViewModel com.ichi2.anki.debug                 W  Attempted to update card mapping before initialization
2025-06-22 21:38:42.757 24328-24328 ThrowableFilterService  com.ichi2.anki.debug                 V  exceptionIsUnwanted - examining IndexOutOfBoundsException
2025-06-22 21:38:42.757 24328-24328 ThrowableFilterService  com.ichi2.anki.debug                 V  exceptionIsUnwanted - exception was wanted
2025-06-22 21:38:42.757 24328-24328 UsageAnalytics          com.ichi2.anki.debug                 D  sendAnalyticsException() description/fatal: java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 1/true
2025-06-22 21:38:42.763 24328-24328 ACRA                    com.ichi2.anki.debug                 E  ACRA caught a IndexOutOfBoundsException for com.ichi2.anki.debug
                                                                                                    java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 1
                                                                                                    	at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
                                                                                                    	at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
                                                                                                    	at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
                                                                                                    	at java.util.Objects.checkIndex(Objects.java:385)
                                                                                                    	at java.util.ArrayList.get(ArrayList.java:434)
                                                                                                    	at com.ichi2.anki.dialogs.ChangeNoteTypeViewModel.getDiscardedCards(ChangeNoteTypeViewModel.kt:261)
                                                                                                    	at com.ichi2.anki.dialogs.ChangeNoteTypeViewModel$getDiscardedCards$1.invokeSuspend(Unknown Source:20)
                                                                                                    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                                                                                                    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:995)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:103)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:248)
                                                                                                    	at android.os.Looper.loop(Looper.java:338)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:9067)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:932)
                                                                                                    	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@6e28089, Dispatchers.Main.immediate]

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Jun 23, 2025
@Haz3-jolt Haz3-jolt added the Needs a new dev For PR that were good start but the original dev' left. Any dev can take over and finish it. label Jun 24, 2025
@david-allison david-allison marked this pull request as draft June 24, 2025 02:36
@david-allison david-allison self-assigned this Jun 24, 2025
@david-allison

This comment was marked as resolved.

@david-allison david-allison force-pushed the changeNT branch 5 times, most recently from 8e5adbe to 0e5bebe Compare June 27, 2025 22:31
@Haz3-jolt Haz3-jolt added this to the 2.22 release milestone Jun 28, 2025
@david-allison david-allison removed Needs Author Reply Waiting for a reply from the original author Needs a new dev For PR that were good start but the original dev' left. Any dev can take over and finish it. Has Conflicts labels Jun 29, 2025
@david-allison david-allison removed their assignment Jun 29, 2025
@Haz3-jolt
Copy link
Member Author

Nothing much, just a commit message fix

@david-allison david-allison added the Review High Priority Request for high priority review label Jan 14, 2026
@Haz3-jolt Haz3-jolt force-pushed the changeNT branch 2 times, most recently from af36c6a to 9f4ea80 Compare January 15, 2026 21:27
@mikehardy mikehardy dismissed criticalAY’s stale review January 17, 2026 14:01

I'm no longer able to see any of the review comments here, but David has reviewed it quite recently and approved after a fair bit of back and forth, so will assume these are stale

Copy link
Member

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incredible piece of functionality, the test implementation looks really thorough and I don't have any quibbles on the implementation as I read it except a desire to make the "TODO" for list separator a concrete thing by doing it in compat

the other two tiny comments are adminsitrative (attribution) or trivial (spacing)

consider this an approve if those are handled, I'd love to get this merged

@mikehardy mikehardy added Needs Author Reply Waiting for a reply from the original author and removed Needs Second Approval Has one approval, one more approval to merge Next version Changes to be merged in the next version, to keep the current release stable. labels Jan 17, 2026
@mikehardy
Copy link
Member

strings are in sync and ready to go, I was hoping to merge it for what it's worth :-), let's go!

@Haz3-jolt Haz3-jolt added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Author Reply Waiting for a reply from the original author labels Jan 19, 2026
@Haz3-jolt Haz3-jolt requested a review from mikehardy January 19, 2026 00:14
This dialog allows the bulk remapping of either
fields or card templates to a different note type

A full sync is required for this operation

inputs:
* output note type
* a map of fields (based on the output)
* a map of templates (based on the output)
* only if both input and output are non-cloze

Fixes 14134

Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com>
Copy link
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GREAT JOB!!!!!!!

Image

@david-allison
Copy link
Member

@david-allison david-allison dismissed mikehardy’s stale review January 19, 2026 10:29

consider this an approve if those are handled

@david-allison david-allison added this pull request to the merge queue Jan 19, 2026
Merged via the queue into ankidroid:main with commit 9f845f0 Jan 19, 2026
15 checks passed
@github-actions
Copy link
Contributor

Maintainers: Please Sync Translations to produce a commit with only the automated changes from this PR.

Read more about updating strings on the wiki,

@github-actions github-actions bot removed Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) Review High Priority Request for high priority review labels Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add: Change Note Types Dialog

4 participants