Skip to content

Improve instant note saving error dialog#20639

Merged
BrayanDSO merged 1 commit intoankidroid:mainfrom
bartonlu:improve-instant-note-saving-error-dialog
Apr 5, 2026
Merged

Improve instant note saving error dialog#20639
BrayanDSO merged 1 commit intoankidroid:mainfrom
bartonlu:improve-instant-note-saving-error-dialog

Conversation

@bartonlu
Copy link
Copy Markdown
Contributor

Purpose / Description

Previously, the "Try Again" button was on the left, and the "Cancel" button was on the right. As well, clicking "Try Again" did not actually automatically reattempt to save the card.

Fixes

Approach

This change swaps the order of the buttons and also triggers another save after clicking "Try Again"

How Has This Been Tested?

  1. Add some code to trigger the savingErrorDialog each time there is an attempt to save an instant note

I added the following code:

// a flag
private var forceSaveFailureDialogForUiTest = true

// under handleSaveNoteResult()
if (forceSaveFailureDialogForUiTest) {
        // toggle the flag to false so you can test Try Again's new behaviour
        forceSaveFailureDialogForUiTest = false
        savingErrorDialog("Forced failure dialog for UI testing")
        return
    }
  1. Attempt to save an Instant Note
  2. Observe that 'Try Again' is on the right side, and 'Cancel' is on the left side.
  3. Observe that clicking "Try Again" tries saving the card again immediately, rather than exiting out of the dialog back to the "Add" [dialog.]
savingErrorDialog.fixed.mp4

Learning (optional, can help others)

Describe the research stage

Links to blog posts, patterns, libraries or addons used to solve this problem

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

@Ayush-Patel-56
Copy link
Copy Markdown
Contributor

Hi @bartonlu use semantic commits in your PR, it's been easy to review it better. Thanks!

Copy link
Copy Markdown
Contributor

@criticalAY criticalAY left a comment

Choose a reason for hiding this comment

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

Looks good to me! thankyou

@criticalAY criticalAY added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels Apr 4, 2026
@criticalAY
Copy link
Copy Markdown
Contributor

@bartonlu Please change the commit message to something meaningful

Move the "Try Again" button to the right and the "Cancel" button to the
left, aligning with Material 3 Guidelines.

Make clicking "Try Again" immediately reattempt saving rather than
simply closing the dialog, aligning with users' expectations.
@bartonlu bartonlu force-pushed the improve-instant-note-saving-error-dialog branch from bcb6c3d to de13016 Compare April 5, 2026 07:30
@bartonlu
Copy link
Copy Markdown
Contributor Author

bartonlu commented Apr 5, 2026

@Ayush-Patel-56 @criticalAY Thanks for the comments, I've changed the description of my commit! Let me know if you'd prefer a simple one-liner for this kind of change, or if explaining the reasoning for the change in the commit body is okay!

@Ayush-Patel-56
Copy link
Copy Markdown
Contributor

Looks better now, thanks!

@BrayanDSO BrayanDSO added this pull request to the merge queue Apr 5, 2026
@BrayanDSO BrayanDSO 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 Apr 5, 2026
Merged via the queue into ankidroid:main with commit a875ff1 Apr 5, 2026
15 checks passed
@github-actions github-actions bot added this to the 2.24 release milestone Apr 5, 2026
@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 Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve instant note save-failure dialog to align with Material guidelines

4 participants