Skip to content

Enable Drawer Menu Opening on Swipe From Left Gesture#3834

Open
qiarie wants to merge 2 commits intomainfrom
enable-open-drawer-menu-on-swipe-gesture
Open

Enable Drawer Menu Opening on Swipe From Left Gesture#3834
qiarie wants to merge 2 commits intomainfrom
enable-open-drawer-menu-on-swipe-gesture

Conversation

@qiarie
Copy link
Copy Markdown
Contributor

@qiarie qiarie commented Mar 24, 2026

IMPORTANT: Where possible all PRs must be linked to a Github issue

Fixes #3835

Engineer Checklist

  • I have written Unit tests for any new feature(s) and edge cases for bug fixes
  • I have added any strings visible on UI components to the strings.xml file
  • I have updated the CHANGELOG.md file for any notable changes to the codebase
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the project's style guide
  • I have built and run the FHIRCore app to verify my change fixes the issue and/or does not break the app
  • I have checked that this PR does NOT introduce breaking changes that require an update to Content and/or Configs? If it does add a sample here or a link to exactly what changes need to be made to the content.

Code Reviewer Checklist

  • I have verified Unit tests have been written for any new feature(s) and edge cases
  • I have verified any strings visible on UI components are in the strings.xml file
  • I have verifed the CHANGELOG.md file has any notable changes to the codebase
  • I have verified the solution has been implemented in a configurable and generic way for reuseable components
  • I have built and run the FHIRCore app to verify the change fixes the issue and/or does not break the app

@qiarie qiarie requested a review from ellykits March 24, 2026 14:39
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 24.6%. Comparing base (aaebbb6) to head (2a67135).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
...re/quest/ui/geowidget/GeoWidgetLauncherFragment.kt 0.0% 2 Missing ⚠️
...ter/fhircore/quest/ui/register/RegisterFragment.kt 0.0% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main   #3834     +/-   ##
=========================================
- Coverage     25.0%   24.6%   -0.5%     
- Complexity     844     849      +5     
=========================================
  Files          297     305      +8     
  Lines        16102   16517    +415     
  Branches      2689    2751     +62     
=========================================
+ Hits          4038    4074     +36     
- Misses       11580   11959    +379     
  Partials       484     484             
Flag Coverage Δ
engine 60.7% <ø> (-0.3%) ⬇️
geowidget 21.6% <ø> (+3.0%) ⬆️
quest 4.6% <0.0%> (+<0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...re/quest/ui/geowidget/GeoWidgetLauncherFragment.kt 0.0% <0.0%> (ø)
...ter/fhircore/quest/ui/register/RegisterFragment.kt 0.0% <0.0%> (ø)

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

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

Enables opening the app drawer via a left-edge swipe gesture on register and geo-widget launcher screens (Compose Scaffold), addressing the prior behavior where gestures were only enabled while the drawer was already open.

Changes:

  • Set drawerGesturesEnabled = true in RegisterFragment’s Compose Scaffold.
  • Set drawerGesturesEnabled = true in GeoWidgetLauncherFragment’s Compose Scaffold.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
android/quest/src/main/java/org/smartregister/fhircore/quest/ui/register/RegisterFragment.kt Enables drawer swipe gestures for the register screen’s drawer scaffold.
android/quest/src/main/java/org/smartregister/fhircore/quest/ui/geowidget/GeoWidgetLauncherFragment.kt Enables drawer swipe gestures for the geo-widget launcher screen’s drawer scaffold.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


Scaffold(
drawerGesturesEnabled = scaffoldState.drawerState.isOpen,
drawerGesturesEnabled = true,
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

drawerGesturesEnabled is now always true, which allows opening the drawer via edge-swipe even when this screen is configured with toolBarHomeNavigation = NAVIGATE_BACK (e.g., see RegisterFragmentTest where this argument is explicitly set). That bypasses the intended navigation mode and can expose the drawer when the UI is supposed to behave as a back-only screen. Consider enabling gestures only when the toolbar home mode is OPEN_DRAWER (while still allowing swipe-to-close when the drawer is already open).

Suggested change
drawerGesturesEnabled = true,
drawerGesturesEnabled = scaffoldState.drawerState.isOpen,

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

See my other comment below

AppTheme {
Scaffold(
drawerGesturesEnabled = scaffoldState.drawerState.isOpen,
drawerGesturesEnabled = true,
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

drawerGesturesEnabled is now always true, which means the drawer can be opened via edge-swipe even if this fragment is ever launched with toolBarHomeNavigation = NAVIGATE_BACK (this argument exists in the nav graph and is passed into GeoWidgetLauncherScreen). Consider gating drawer gestures on the toolBarHomeNavigation value (while still allowing swipe-to-close when the drawer is open) so the drawer can’t be opened on back-only screens.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@qiarie Please follow up on this. The menu action can either be used for back navigation or launching the side navigation. With this change can you test when the toolbar action is used for back navigation like in the projects using the geowidget module. We should not allow opening of the drawer via the gesture if the action for the toolbar is for navigating back to the previous screen.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@ellykits I have a commit ready that will handle that. I am waiting for credentials for an app with maps to fully test.

On NAVIGATE_BACK screens, gestures remain enabled only when the drawer is already open so swipe-to-close still works.
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.

Enable Drawer Menu Opening on Swipe From The Left

3 participants