Skip to content

Comments

fix(empty-cards): make undoable, correct result, use backend strings#17745

Merged
lukstbit merged 1 commit intoankidroid:mainfrom
david-allison:16945-2
Jan 11, 2025
Merged

fix(empty-cards): make undoable, correct result, use backend strings#17745
lukstbit merged 1 commit intoankidroid:mainfrom
david-allison:16945-2

Conversation

@david-allison
Copy link
Member

@david-allison david-allison commented Jan 6, 2025

Purpose / Description

Fixes

Approach

  • Extract operation to ViewModel
  • Extract output to Flow
  • add opChanges { }
  • Use the result of opChangesWithCount
  • Use TR rather than strings
  • Add Undo to the snackbar, and only show it for a short duration
  • Test!

How Has This Been Tested?

⚠️ Unit tests only

Checklist

  • 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

@david-allison david-allison added the Blocked by dependency Currently blocked by some other dependent / related change label Jan 6, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2025

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

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.

last commit looks good to me, just bikeshedded you on a name.
approving because that naming is not that important to me vs moving right along here, do what you wish

@david-allison david-allison added the Needs Second Approval Has one approval, one more approval to merge label Jan 7, 2025
@david-allison david-allison removed Blocked by dependency Currently blocked by some other dependent / related change Has Conflicts labels Jan 8, 2025
@david-allison david-allison force-pushed the 16945-2 branch 2 times, most recently from 16ac926 to 9b676a8 Compare January 9, 2025 14:07
@mikehardy mikehardy added the Needs Author Reply Waiting for a reply from the original author label Jan 9, 2025
@mikehardy
Copy link
Member

you're probably aware but unit tests failed, marked author reply

* We use the backend string
* We use `undoableOp`
* we add 'undo' to the snackbar
* We return the backend result, which may not
 be the supplied input
   - unit tested: duplicates

empty_cards_deleted => TR.emptyCardsDeletedCount

Fixes 16945

https://redirect.github.com/ankitects/anki/pull/3386
@david-allison
Copy link
Member Author

you're probably aware but unit tests failed, marked author reply

I wasn't. Fixed!

@david-allison david-allison removed the Needs Author Reply Waiting for a reply from the original author label Jan 9, 2025
@mikehardy mikehardy requested a review from lukstbit January 9, 2025 16:08
Copy link
Member

@lukstbit lukstbit left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@lukstbit lukstbit added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Second Approval Has one approval, one more approval to merge labels Jan 11, 2025
@lukstbit lukstbit added this pull request to the merge queue Jan 11, 2025
Merged via the queue into ankidroid:main with commit aa5da3f Jan 11, 2025
9 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 the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Jan 11, 2025
@github-actions github-actions bot added this to the 2.21 release milestone Jan 11, 2025
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.

Notifies the subscriber after "Check - Empty Cards" removed cards

3 participants