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

Redesign change Note Type Screen

Open nourhanbakry opened this issue 7 months ago • 29 comments

Purpose / Description

  • Show the current note type name in the change note type screen.
  • Ensure user can clearly see which note type is selected before confirming any change.
  • Improve clarity when switching between multiple note types

Fixes

  • Fixes #20846

Approach

  • Update the change note type screen binding logic
  • Fetch and display the currently selected note type name in the UI
  • Ensure the displayed value updates immediately when selection changes
  • Handle null or empty note type values safely to avoid blank UI state
  • Keep behavior consistent during rotation and screen reopen

How Has This Been Tested?

Android Emulator

Test cases

Open change note type screen
Check current note type name displayed
Switch between note types
Confirm UI updates immediately
Rotate device
Reopen screen

Before

before fix

After

https://github.com/user-attachments/assets/40b99791-c446-4a83-b5f6-f8d839431a66

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

nourhanbakry avatar Apr 26 '26 16:04 nourhanbakry

  • The new note type's name should not be truncated. If it's not possible to make it wrap, then consider removing "Type:" and moving the current note type's name to a different line above the new one. We can then have a vertical arrow "↓" between, or "From:"/"To:" prefixes.
  • The cloze's blue color shouldn't apply to the arrow nor the other note type (if it isn't also a cloze note type). Same for image occlusion.
  • Using an arrow icon instead of text would be nice.

ZornHadNoChoice avatar Apr 26 '26 19:04 ZornHadNoChoice

  • The new note type's name should not be truncated. If it's not possible to make it wrap, then consider removing "Type:" and moving the current note type's name to a different line above the new one. We can then have a vertical arrow "↓" between, or "From:"/"To:" prefixes.
  • The cloze's blue color shouldn't apply to the arrow nor the other note type (if it isn't also a cloze note type). Same for image occlusion.
  • Using an arrow icon instead of text would be nice.

I changed it to appear like this photo, is that what you mean? could you please take a look? Screenshot 2026-04-27 at 1 06 27 AM

nourhanbakry avatar Apr 26 '26 22:04 nourhanbakry

  • I'd pick one of the two: the arrow or the "From:"/"To:" prefixes.
  • If you go with the arrow approach, I suggest centering the note type names.
  • If you go with the prefixes, I think it'd look better if the prefix was on the same line as the note type name.
  • Either way, I think "Type:" should go and the selection should be combined with the "To" part so as to avoid showing the name twice.

ZornHadNoChoice avatar Apr 27 '26 00:04 ZornHadNoChoice

@ZornHadNoChoice I went through a few designs (please let me know if LLM designs are an issue for you).

Screenshot 2026-04-27 at 09 43 51 Screenshot 2026-04-27 at 09 43 41 Screenshot 2026-04-27 at 09 43 35

I'd love to see the UX of the final design [the visual flourishes can be split out to a separate issue], and would like your opinion on this.

david-allison avatar Apr 27 '26 08:04 david-allison

I despise LLMs, but oh well.

The first option is basically the same as the one by nourhanbakry, which I talked about above.

The second option has too much going on ("CURRENT NOTE TYPE"/"NEW NOTE TYPE" are overly long, the "B" icon is useless, and the small "hints" contains "Source" which is unnecessary).

The third design looks nice, but maybe there shouldn't be that much empty space.


Other remarks:

  • Is the "lock" icon necessary?
  • Material 3 suggests to always use sentence case, unless otherwise specified.
  • The hints for field & card counts: are they really necessary? There is already a warning that indicates which fields/card types will be removed. Also, if you're going to add it, I'd change "card" to "template" since the number of cards can change per note, but that is still misleading/not useful when the note type is cloze/IO.

ZornHadNoChoice avatar Apr 27 '26 10:04 ZornHadNoChoice

I'll refine suggestions further in future. Apologies!

The LLM designs were only intended to be used as a starting/discussion point. The only focus I wanted was on the 'From/To' selector. I'm glad we both feel the third design is the best

Screenshot 2026-04-27 at 11 29 40
  • I like inclusion of the attributes, but change the 'card' string to N [card] templates
  • Remove the lock icon. The 'disabled grey' already handles this use case
  • Remove the uppercasing on 'To/From': uppercase is a Material 2 design choice, we're moving to Material 3
  • Reduce the vertical height, there should probably be 16/24dp padding between the note type name and the attributes

Anything else?

Depending on how @nourhanbakry feels about visual design, we can implement a simpler design now with the correct UX, and improve the visuals of the design in a follow-up (arrow between the boxes; border; better spinner)

david-allison avatar Apr 27 '26 10:04 david-allison

I'll refine suggestions further in future. Apologies!

The LLM designs were only intended to be used as a starting/discussion point. The only focus I wanted was on the 'From/To' selector. I'm glad we both feel the third design is the best

Screenshot 2026-04-27 at 11 29 40 * I like inclusion of the attributes, but change the 'card' string to `N [card] templates` * Remove the lock icon. The 'disabled grey' already handles this use case * Remove the uppercasing on 'To/From': uppercase is a Material 2 design choice, we're moving to Material 3 * Reduce the vertical height, there should probably be `16/24dp` padding between the note type name and the attributes

Anything else?

Depending on how @nourhanbakry feels about visual design, we can implement a simpler design now with the correct UX, and improve the visuals of the design in a follow-up (arrow between the boxes; border; better spinner)

  • Remove the lock icon. The 'disabled grey' already handles this use case
  • Remove the uppercasing on 'To/From': uppercase is a Material 2 design choice, we're moving to Material 3
  • Reduce the vertical height, there should probably be 16/24dp padding between the note type name and the attribute

Thanks for the suggestions, @david-allison . They really helped clarify the direction.

I agree that the third option looks the best. I’m thinking of simplifying it a bit more by removing the extra text under each note type (like “4 fields, 2 cards” and “2 fields, 1 card”), as it feels unnecessary here and doesn’t add much value, similar to what @ZornHadNoChoice mentioned.

I also agree with the other points:

  • removing the lock icon
  • using sentence case for “From” and “To”
  • reducing the vertical spacing to keep it more compact

So the layout would be a cleaner From/To design without extra details. Screenshot 2026-04-28 at 1 55 42 PM

What do you think about this direction? If that sounds good, I’ll proceed with implementing it this way.

nourhanbakry avatar Apr 28 '26 11:04 nourhanbakry

My understanding was that Zorn was referring to this, which I agree, is unnecessary

Screenshot 2026-04-28 at 21 19 22

I'd keep the field/card counts, but the rest is good.

david-allison avatar Apr 28 '26 20:04 david-allison

No, I was referring to counts under the note type names which aren't necessary since the user can just... count. The warning, however, is important to let the user know that some fields/cards will be removed.

ZornHadNoChoice avatar Apr 28 '26 20:04 ZornHadNoChoice

I'd like the summary of the note type [card/field count], but I'm happy to defer it for further discussion so we don't block this change.

The warning already exists, and is very useful, I'm glad it's staying [although the same argument could be made: a user could see that a card/field will be mapped to nothing]

david-allison avatar Apr 29 '26 09:04 david-allison

[although the same argument could be made: a user could see that a card/field will be mapped to nothing]

[Or it could be mapped to an already used field.]

ZornHadNoChoice avatar Apr 29 '26 10:04 ZornHadNoChoice

[!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 May 12 '26 11:05 github-actions[bot]

Please remove the merge commit and rebase onto main & force push


Do you have an updated screenshot?

david-allison avatar May 12 '26 11:05 david-allison

Please remove the merge commit and rebase onto main & force push

Do you have an updated screenshot?

Hi @david-allison,

I tried redesigning the screen based on the points we agreed on: Here’s a screen recording of the current result. Do you have any further comments or adjustments before I push the updated code?

https://github.com/user-attachments/assets/8a173fa7-5e29-4255-bf48-a4250c703173

Thanks!

nourhanbakry avatar May 15 '26 23:05 nourhanbakry

There's too much empty space in the boxes, and the warning should be changed imo:

  • I don't like the "crosshair" icon. It should be more like a warning icon and the colors should be red.
  • There are two warnings that appear in the recording. One of them should go, and in the case we choose the one above the tabs, we'd need two of them to show up in the cases where both fields and cards will be removed.

ZornHadNoChoice avatar May 16 '26 00:05 ZornHadNoChoice

There's too much empty space in the boxes, and the warning should be changed imo:

  • I don't like the "crosshair" icon. It should be more like a warning icon and the colors should be red.
  • There are two warnings that appear in the recording. One of them should go, and in the case we choose the one above the tabs, we'd need two of them to show up in the cases where both fields and cards will be removed.

Hello @ZornHadNoChoice, hope you're doing well. Thank you so much for the feedback. These were really important points and helped clarify the direction more.

I tried to address the issues you mentioned:

  • reduced the empty space inside the boxes
  • replaced the crosshair icon with a warning-style icon and updated the warning colors to red
  • removed the duplicate warning inside the templates section and kept the warning above the tabs instead
  • updated the warning handling so it reflects both fields and cards removal cases more clearly

Here’s the updated screen recording:

https://github.com/user-attachments/assets/1b5f0cfd-51e4-4179-b467-f955cb102651

What do you think about this? Do you have any additional changes or feedback before I push the updated code?

nourhanbakry avatar May 16 '26 12:05 nourhanbakry

Looks great!

Just a nitpick: the warning says "1 cards will be removed". I'm not sure if this is a translation issue, but it should be "1 card will be removed".

Also, your recording doesn't show how the error looks when both fields and cards are empty.

Edit: actually, there's a problem: the warning is showing when it shouldn't. Changing the note type from "Basic" to "Basic (and reversed card)" won't remove any cards.

ZornHadNoChoice avatar May 16 '26 13:05 ZornHadNoChoice

Looks great!

Just a nitpick: the warning says "1 cards will be removed". I'm not sure if this is a translation issue, but it should be "1 card will be removed".

Also, your recording doesn't show how the error looks when both fields and cards are empty.

Edit: actually, there's a problem: the warning is showing when it shouldn't. Changing the note type from "Basic" to "Basic (and reversed card)" won't remove any cards.

Thanks!

For the singular/plural issue, I fixed it and the updated recording shows it now.

https://github.com/user-attachments/assets/059721f4-4fd0-447b-9dc6-f5c1742dbf3a

About the case when both fields and cards are empty, the video also shows that no warning appears in that case.

For this part though: "Changing the note type from 'Basic' to 'Basic (and reversed card)' won't remove any cards."

I think I may have misunderstood the expected behavior here. Could you explain a bit more what scenario you mean exactly? I tried reproducing it but couldn't fully understand the issue.

nourhanbakry avatar May 16 '26 17:05 nourhanbakry

About the case when both fields and cards are empty, the video also shows that no warning appears in that case.

That's not what I meant. Try remapping some of the fields in the current screen to see the warning for removed fields. Here's an example:

ResizedImage_2026-05-16_20-24-36_5459

We want to see both warnings if there are both fields and cards that'll be removed.

I think I may have misunderstood the expected behavior here.

I'm the one who misunderstood. I didn't notice that your "Basic" note type is modified and has 3 card types.

ZornHadNoChoice avatar May 16 '26 17:05 ZornHadNoChoice

About the case when both fields and cards are empty, the video also shows that no warning appears in that case.

That's not what I meant. Try remapping some of the fields in the current screen to see the warning for removed fields. Here's an example:

ResizedImage_2026-05-16_20-24-36_5459 We want to see both warnings if there are both fields and cards that'll be removed.

I think I may have misunderstood the expected behavior here.

I'm the one who misunderstood. I didn't notice that your "Basic" note type is modified and has 3 card types.

Thanks for the clarification

I tried reproducing this case by remapping fields on a note type

https://github.com/user-attachments/assets/4051b492-6403-407f-97b9-701e2968768e

Is this exactly the case you wanted me to validate? Also let me know if there are any improvements you still expect in the warning UI or logic

nourhanbakry avatar May 16 '26 20:05 nourhanbakry