Skip to content

Support drawer menus opening as overlay instead of pushing content in ios #7986

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 32 commits into from
May 27, 2025

Conversation

liatnetach
Copy link
Contributor

@liatnetach liatnetach commented Mar 30, 2025

This PR adds the ability to configure how side drawer menus open, introducing an overlay mode in addition to the traditional push-content behavior.

NOTE: Work on this has succeeded in #8039

… ios (#7984)

* add example in playground and some animations changes with Yogi

* fix drag animations (open+close) in left drawer and add overlay on center

* support all features in right drawer

* supoprt both old and new opening mode using openAboveScreen param

* connect the new parameter to rnn platform

* update param from boolean to enum

* clean

* install

* update lock

* fix unit
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces overlay mode for side drawer menus on iOS, allowing the drawer to open above the content rather than pushing it.

  • Added new test IDs for left and right menus.
  • Added new functions and UI buttons in SetRootScreen to configure left and right menus with overlay behavior.
  • Updated the Options interface to support the new openMode property.

Reviewed Changes

Copilot reviewed 5 out of 10 changed files in this pull request and generated no comments.

File Description
playground/src/testIDs.ts Added new test IDs for the left and right side menus.
playground/src/screens/SetRootScreen.tsx Added buttons and functions to configure side menus in overlay mode for iOS.
lib/src/interfaces/Options.ts Extended the Options interface with an openMode property for side menus.
Files not reviewed (5)
  • lib/ios/RNNSideMenu/MMDrawerController/MMDrawerController.h: Language not supported
  • lib/ios/RNNSideMenuPresenter.m: Language not supported
  • lib/ios/RNNSideMenuSideOptions.h: Language not supported
  • lib/ios/RNNSideMenuSideOptions.m: Language not supported
  • playground/ios/NavigationTests/RNNSideMenuPresenterTest.m: Language not supported
Comments suppressed due to low confidence (2)

playground/src/screens/SetRootScreen.tsx:336

  • [nitpick] The component id 'sideMenu' is used for the left menu configuration; consider renaming it to 'leftSideMenu' for clarity and to avoid confusion with the right menu configuration.
id: 'sideMenu',

playground/src/screens/SetRootScreen.tsx:376

  • [nitpick] The component id 'sideMenu' is used for the right menu configuration; consider renaming it to 'rightSideMenu' for clearer distinction between the left and right menus.
id: 'sideMenu',

Copy link
Collaborator

@d4vidi d4vidi left a comment

Choose a reason for hiding this comment

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

Impressive overall, but needs to be seriously improved before we can merge this in. Please see notes 🙏🏻

@liatnetach liatnetach force-pushed the support-drawer-menu-open-mode branch from f1d3449 to 4803f82 Compare April 15, 2025 13:03
@liatnetach liatnetach requested a review from d4vidi April 15, 2025 13:28
@liatnetach
Copy link
Contributor Author

#rebuild

[self sideDrawerViewControllerForSide:self.openSide];
[sideDrawerViewController beginAppearanceTransition:NO animated:NO];
[sideDrawerViewController endAppearanceTransition];
if (openMode == MMDrawerOpenModeAboveContent) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

... Same here. The change here is massive, you need to find a way to elegantly extract this massive amount of logic onto several sub-methods. Also, please minimize the extra-comments = fluff 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ive split panGestureCallback method into small methods, you can see this commit
🙂

Copy link
Collaborator

@d4vidi d4vidi left a comment

Choose a reason for hiding this comment

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

Hey @liatnetach, some further discussion - above. Still a lot to be done but please keep up the good work. It's mainly about:

  1. Getting the side-menu thoroughly tested in the SideMenu's suite (not the SetRoot one) - "full matrix" (all tests for both modes)
  2. Massively cleaning up and reorg'ing the work in panGestureCallback
  3. Fix an odd bug - the drawer disappears unexpectedly when panning out
Simulator.Screen.Recording.-.iPhone.13.Pro.Max.-.2025-05-13.at.13.30.11.mp4

@liatnetach liatnetach requested a review from d4vidi May 18, 2025 14:48
@liatnetach
Copy link
Contributor Author

Hey @d4vidi 🙂
I've answered and pushed everything you asked for (including the bug fix - thanks for noticing!).
Please resolve what can be resolved, and let me know if there's anything else. 🙂

@liatnetach
Copy link
Contributor Author

#rebuild

@liatnetach liatnetach requested a review from d4vidi May 27, 2025 05:32
@d4vidi d4vidi merged commit 0bdfb20 into 7.x.x May 27, 2025
2 checks passed
@d4vidi d4vidi deleted the support-drawer-menu-open-mode branch May 27, 2025 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants