Skip to content

Conversation

@vinayakkumargupta
Copy link

@vinayakkumargupta vinayakkumargupta commented Jan 18, 2026

Purpose / Description

Fix back navigation after canceled multimedia attachment in Note editor.

Fixes

Remove the multimedia bottom sheet when in onActivityResult is coming as cancelled. Now Note editor correctly handled back navigation

Approach

The regression was caused by re-invoking showMultimediaBottomSheet() when the multimedia activity result was cancelled.
This caused the bottom sheet to be displayed again when navigating back, preserving an invalid selection state.
The fix removes the redundant call to re-show the bottom sheet and allows the existing back-navigation logic to proceed normally by handling only the selected multimedia action.
Regression analysis:
First bad commit: 7cc16f7
Last good commit: 2bbcf6b
The issue was identified using git blame and confirmed via git bisect.

How Has This Been Tested?

Open Note Editor
Tap Attach
Select Add Audio Clip
Press Back (cancel selection)
Press Back again
Result
Before fix: Multimedia bottom sheet reappears and selection state remains active
After fix: Returns cleanly to Note Editor with no residual selection

Learning (optional, can help others)

Using git blame together with git bisect helped identify the exact regression commit and understand how navigation state was unintentionally preserved.

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

@vinayakkumargupta
Copy link
Author

@david-allison here my pr for #20133

@david-allison
Copy link
Member

Thanks!

When fixing the issue, use the syntax

* Fixes #20133

As this links the PR to the issue, and closes the PR when merged:

Copy link
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

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

Thanks!

It would be ideal if you reworded the commit message and force pushed to give a little more context, and a line which says Fixes 20133

Since this is your first PR (excellent going!!!) we can do this for you

@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels Jan 18, 2026
@vinayakkumargupta vinayakkumargupta changed the title "Fix back navigation after canceled multimedia attachment" "Fixes 20133. Fix back navigation after canceled multimedia attachment" Jan 18, 2026
@david-allison david-allison added the squash-merge A squash & force push is required. The PR author may do this to speed up the merge process. label Jan 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Second Approval Has one approval, one more approval to merge New contributor squash-merge A squash & force push is required. The PR author may do this to speed up the merge process.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 'Add Audio Clip': two back presses are needed to return

2 participants