Skip to content

Close all menus when tapping outside the mobile menu sheet - #144

Merged
MattiasBuelens merged 3 commits into
developfrom
feature/close-all-menus
Oct 23, 2026
Merged

MattiasBuelens merged 3 commits into
developfrom
feature/close-all-menus

Conversation

@MattiasBuelens

@MattiasBuelens MattiasBuelens commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • New API: MenuScope.closeAllMenus() closes all open menus at once. UIControllerScopeImpl empties its menu stack, so the existing cleanup drops the closed menus' saved state. With no menus open, it does nothing. MenuScope requires an opt-in to implement, so adding a member doesn't affect apps.
  • Mobile: tapping outside the menu sheet now calls closeAllMenus() instead of closeCurrentMenu(). From a submenu, it used to go back one level instead of closing the sheet. Back and the back arrow still go back one level. The Menu KDocs say tapping outside "closes all open menus".
  • TV: no behavior change, because there's no tap-outside. The preview scope and test scopes implement the new method.
  • Changelog: a 🚀 entry for closeAllMenus() and the new tap-outside behavior.

Test plan

  • ./gradlew ktfmtCheck :ui-common:testDebugUnitTest :ui:testDebugUnitTest :ui-tv:testDebugUnitTest :app:assembleLatestPlayerDebug
  • New UIControllerScopeImplTest: closeAllMenus() with three open menus leaves no current menu and no menu IDs, and marks the last change as a close; with no open menus it does nothing; closeCurrentMenu() only closes the top menu
  • New MenuSheetTest cases with a real UIController: tapping outside from a submenu closes the whole sheet; Back from a submenu returns to the parent menu
  • Not checked on a device

Generated with Devin

@MattiasBuelens
MattiasBuelens added this pull request to stack #145 October 22, 2026 13:19
@MattiasBuelens MattiasBuelens added the enhancement New feature or request label Oct 22, 2026
Base automatically changed from feature/text-track-style to develop October 22, 2026 14:53
MattiasBuelens and others added 3 commits October 22, 2026 16:53
Tapping the scrim only closed the top menu, so from a submenu it went back one level instead of dismissing the sheet. Add MenuScope.closeAllMenus() and use it for the scrim; Back and the back arrow still close one level.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…tTest

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@MattiasBuelens
MattiasBuelens force-pushed the feature/close-all-menus branch from 91d5dc0 to 9bb676d Compare October 22, 2026 14:53
@MattiasBuelens
MattiasBuelens merged commit b26c848 into develop Oct 23, 2026
1 check passed
@MattiasBuelens
MattiasBuelens deleted the feature/close-all-menus branch October 23, 2026 10:09
@theoplayer-bot theoplayer-bot Bot mentioned this pull request Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant