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

Expand/collapse icon rendering immediately when adding subdeck

Open gayatriii0803 opened this issue 9 months ago • 3 comments

Purpose / Description

Expand/collapse icon was not updating immediately after adding a subdeck

Fixes

  • Fixes #18278

Approach

Added oldItem.children.isEmpty() == newItem.children.isEmpty() to areContentsTheSame() in DiffUtil.ItemCallback to correctly reflect changes in child deck presence.

How Has This Been Tested?

Emulator

https://github.com/user-attachments/assets/c3780b5f-afef-4f81-a776-0526944cae30

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).
  • [ ] 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)
  • [] UI Changes: You have tested your change using the Google Accessibility Scanner

gayatriii0803 avatar May 05 '25 16:05 gayatriii0803

https://github.com/user-attachments/assets/88a8f377-5da1-4426-b49d-1811b47d3637

Actually, there is still an issue. If you create the first subdeck or if you delete the last subdeck, you'll end up with decks that are not aligned. This is because, if there is a single subdeck anywhere in the collection, all decks are moved to the right in order to let room for the icon on the left when needed. And in order that even when the icon is not needed, the decks are aligned together

Which means that your state need to record also whether there was a subdeck somewhere in the collection

Arthur-Milchior avatar May 08 '25 03:05 Arthur-Milchior

Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically

github-actions[bot] avatar May 24 '25 09:05 github-actions[bot]

@gayatriii0803 Eh, can you please let us know whether you plan to update?

Arthur-Milchior avatar May 30 '25 08:05 Arthur-Milchior

Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically

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

Fixed in main

david-allison avatar Jun 24 '25 20:06 david-allison