-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Expand/collapse icon rendering immediately when adding subdeck #18279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the two new files. They are not needed.
Generally, it's nice if you take a look at the "files changed" on PR you open. That's the kind of surprise that occurs all of the time.
Appart from that, very good.
Note to reviewers: don't merge until the two log files are removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I'd love your commit message to be more than a single line. You could at least reuse your "approach" from your pr description.
But more importantly, it would be to explain why we need to consider whether there are subdecks or not
@@ -276,5 +276,6 @@ private val deckNodeDiffCallback = | |||
oldItem.fullDeckName == newItem.fullDeckName && | |||
oldItem.newCount == newItem.newCount && | |||
oldItem.lrnCount == newItem.lrnCount && | |||
oldItem.revCount == newItem.revCount | |||
oldItem.revCount == newItem.revCount && | |||
oldItem.children.isEmpty() == newItem.children.isEmpty() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not add this as the last element.
If you added it just after did
, it would allow you to change a single line instead of two. Also, it would ensure that the things you test are in the order in which they are displayed on screen.
I'd also add a comment stating
We need to know whether there are children in order to know whether we draw the icon on the left
Screen_recording_20250508_052856.mp4Actually, 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. Which means that your state need to record also whether there was a subdeck somewhere in the collection |
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 |
@gayatriii0803 Eh, can you please let us know whether you plan to update? |
Purpose / Description
Expand/collapse icon was not updating immediately after adding a subdeck
Fixes
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
WhatsApp.Video.2025-05-05.at.21.51.52_ef7d4075.mp4
Checklist
Please, go through these checks before submitting the PR.