"Fixes 20133. Fix back navigation after canceled multimedia attachment" #20146
+0
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.