Skip to content

Fix #8241: Ensure UI back button navigates to Drafts folder when editing a draft #8993

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

Merged
merged 1 commit into from
Mar 26, 2025

Conversation

sergiolpzgmz
Copy link
Contributor

Issue

Fixes #8241: Closing a draft via Thunderbird's back button navigates to the inbox instead of the drafts folder.

Summary of Changes

Modified the prepareToFinish method in MessageCompose.java to check if the current action is EDIT_DRAFT. If so, the UI back button uses super.onBackPressed() instead of openDefaultFolder(), ensuring the user is navigated back to the Drafts folder instead of the Inbox. This makes the UI back button behavior consistent with the system back button.

Testing

  • Tested manually by opening an existing draft, pressing the UI back button, and verifying navigation to the Drafts folder.
  • Tested other flows (e.g., creating a new message, replying to a message) to ensure they are unaffected.
  • Ran ./gradlew test to confirm no regressions in existing tests.

Additional Notes

I did not add new tests for this change, as it involves navigation behavior that may require UI/integration testing. I'm happy to add tests if the team provides guidance on how to test this scenario.

@wmontwe wmontwe self-assigned this Mar 26, 2025
Copy link
Member

@wmontwe wmontwe left a comment

Choose a reason for hiding this comment

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

Thank you!

@wmontwe wmontwe merged commit 9433e98 into thunderbird:main Mar 26, 2025
3 checks passed
Copy link
Contributor

Thanks for your contribution! Your pull request has been merged and will be part of Thunderbird 11. We appreciate the time and effort you put into improving Thunderbird. If you haven’t already, you’re welcome to join our Matrix chat for contributors. It’s where we discuss development and help each other out. https://matrix.to/#/#tb-android-dev:mozilla.org
Hope to see you there! 🚀📱🐦

@github-actions github-actions bot added this to the Thunderbird 11 milestone Mar 26, 2025
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.

Closing a draft via Thunderbird's back button navigates to the inbox instead of the drafts folder
2 participants