Skip to content

Amogh/fix: add BACK button to error dialog (#298)#408

Open
Amoghhosamane wants to merge 1 commit into
anusii:devfrom
Amoghhosamane:Amogh/fix_error_popup_back_button
Open

Amogh/fix: add BACK button to error dialog (#298)#408
Amoghhosamane wants to merge 1 commit into
anusii:devfrom
Amoghhosamane:Amogh/fix_error_popup_back_button

Conversation

@Amoghhosamane
Copy link
Copy Markdown

@Amoghhosamane Amoghhosamane commented May 16, 2026

Description

When a user opens External Notes and clicks on a note that has no data (e.g. the note was deleted by the owner without first revoking access), an error popup is displayed via showErrDialog() in lib/widgets/err_dialogs.dart.

The popup had �arrierDismissible: false set, meaning the user must tap a button to dismiss it - but only a single OK button was present, and users could not intuitively find a way to return to the previous screen. The only workaround was navigating away via the app bar or nav bar.

What was changed:

  • Added a BACK button as the first action in the AlertDialog inside showErrDialog()
  • The existing OK button is retained alongside it
  • Both buttons dismiss the dialog via Navigator.of(context).pop()
  • Imported
    otepod/constants/ui.dart to use the canonical ButtonLabel.back constant ('BACK'), consistent with the rest of the app's button style

Why this is required:
All error popups should have an appropriately labelled button to let the user escape the error screen, as specified in issue #298.

Related Issues

Closes #298

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How To Test?

  1. Log in and open External Notes
  2. Find a note whose title shows a data error (note deleted by owner without revoking access)
  3. Tap on that note to trigger the error popup
  4. Verify the dialog now shows two buttons: BACK and OK
  5. Tap BACK - dialog dismisses, user returns to previous view ?
  6. Repeat step 3-4, tap OK - dialog also dismisses ?
  7. Confirm neither button causes a crash or unexpected navigation

Checklist

  • Screenshots included here/in linked issue BUG: Error pop up has no back button to exit error #298
  • Changes adhere to the style and coding guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules
  • The update contains no confidential information
  • The update has no duplicated content
  • No lint check errors are related to these changes (make prep or lutter analyze lib)
  • Integration test dart test output or screenshot included in issue BUG: Error pop up has no back button to exit error #298
  • I tested the PR on these devices:
    • Android
    • iOS
    • Linux
    • MacOS
    • Windows
    • Web
  • I have identified reviewers
  • The PR has been approved by reviewers

Finalising

  • Merge dev into this branch
  • Resolve any conflicts
  • Add a one line summary into the CHANGELOG.md
  • Push to the git repository and review
  • Merge the PR into dev

All error dialogs from showErrDialog now include a BACK button so
users can dismiss the alert and return to the previous view without
requiring navigation via the app bar or nav bar.

Adds ButtonLabel.back ('BACK') as first action alongside the existing
'OK' button in the AlertDialog returned by showErrDialog().
Imports notepod/constants/ui.dart for the ButtonLabel constant.
@Amoghhosamane Amoghhosamane changed the title fix: add BACK button to error dialog (#298) Amogh/fix: add BACK button to error dialog (#298) May 16, 2026
@gjwgit
Copy link
Copy Markdown
Contributor

gjwgit commented May 18, 2026

Thanks for the very clear PR @Amoghhosamane.

But what is the difference between BACK and OK now? Don't they do the same thing and so we only need the OK?

@Amoghhosamane
Copy link
Copy Markdown
Author

Thanks for reviewing @gjwgit.

You're right urrently both BACK and OK dismiss the dialog via Navigator.of(context).pop(), so behavior-wise they are identical.

My reasoning for adding BACK was based on issue, which specifically mentioned the lack of an obvious way to go back/exit the error popup. Since barrierDismissible: false is set, I interpreted this as needing an explicit escape action labelled BACK, consistent with other navigation patterns in the app (ButtonLabel.back)
t said, I agree the distinction between BACK and OK is unclear if both perform the same action. I'm happy to update the PR and either:

  1. remove OK and keep only BACK, or
  2. remove BACK and keep OK if that better matches the intended UX.
    Let me know which direction you'd prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Error pop up has no back button to exit error

2 participants