Skip to content

Conversation

@Bahati308
Copy link
Contributor

@Bahati308 Bahati308 commented Dec 10, 2025

Pull Request Title

fix(formplayer): fix navigation button overlap and mobile keyboard layout issues

Type of Change

  • Bug Fix
  • New Feature / Enhancement
  • Refactor / Code Cleanup
  • Documentation Update
  • Maintenance / Chore / Dependency Update
  • CI/CD or Build System Update
  • Security Fix
  • Style / Formatting (no logic changes)
  • Performance Improvement
  • Test Addition / Update
  • Revert
  • Other (please specify):

Component(s) Affected


Related Issue(s)

Closes/Fixes/Resolves:

Related: Closes #7


Description

Summary

Fixed navigation button overlap and mobile keyboard layout issues by implementing a sticky bottom navigation layout with proper scrollable content area.

Changes Made

  • Created new FormLayout.tsx component with sticky navigation and scrollable content area
  • Refactored SwipeLayoutRenderer.tsx to use new FormLayout component instead of absolute-positioned buttons
  • Updated App.tsx to use dynamic viewport height (100dvh) instead of 100vh for mobile keyboard support
  • Updated index.css to remove fixed height constraints from .swipelayout_screen class

Rationale / Context

Problem:

Previous/Next navigation buttons were absolutely positioned and floated over form content, blocking form fields. On mobile devices, when the on-screen keyboard appeared, the layout broke and users couldn't scroll to some inputs. The fixed viewport height (100vh) didn't adapt when the keyboard appeared.

Solution:

Implemented a robust MUI-based layout architecture with:

  • Sticky bottom navigation bar that never overlaps content
  • Scrollable content area with proper bottom padding (120px) to ensure inputs are never hidden
  • Dynamic viewport height (100dvh) that adapts when mobile keyboard appears/disappears
  • Proper flex layout structure separating header, content, and navigation areas

Testing Instructions

Prerequisites

  • Android device or emulator with adb access
  • Built formplayer assets in formulus/android/app/src/main/assets/formplayer_dist/

Expected Behavior

  • Navigation buttons remain visible at bottom without overlapping form content
  • When keyboard appears on mobile, layout adapts correctly
  • All form fields remain accessible via scrolling
  • Progress bar and percentage indicator have reduced spacing
  • Layout works consistently across all devices and orientations

Test Coverage

  • Unit tests added/updated
  • Integration tests added/updated
  • End-to-end tests added/updated
  • Manually tested on device(s) / browser(s)
  • Tested on multiple platforms (ADB/Android studio/Web)
  • Tested with different data sets
  • Not applicable

Test Results

Manually tested on Android device. Navigation buttons no longer overlap content, and mobile keyboard layout works correctly.


Breaking Changes

  • This PR introduces breaking changes
  • This PR does NOT introduce breaking changes

If breaking changes, please describe:

Migration Steps:


Documentation Updates

  • Documentation has been updated
  • Documentation update is not required
  • Documentation update will follow in a separate PR

Files Updated:

New Documentation:


Screenshots / Videos

Before

Navigation buttons floated over form content using absolute positioning. On mobile, keyboard appearance broke the layout.

After

Navigation buttons are in a sticky bottom bar that never overlaps content. Layout adapts correctly when keyboard appears.

Screenshot 2025-12-10 at 14 59 57 Screenshot 2025-12-10 at 14 59 38 Screenshot 2025-12-10 at 14 59 07
Screen.Recording.2025-12-10.at.15.01.49.mov

Performance Impact

  • Performance improvement
  • No performance impact
  • Performance regression (explain below)

Details:


Security Considerations

  • Security improvement
  • Security fix
  • No security impact

Details:


Checklist

Code Quality

  • Code follows project style guidelines
  • Code is self-documenting with clear variable/function names
  • Comments added for complex logic
  • No hardcoded values or magic numbers
  • Error handling is appropriate

Testing

  • All existing tests pass
  • New tests added for new functionality
  • Tests updated for changed functionality
  • Manual testing completed
  • Edge cases considered and tested

Linting & Formatting

  • Linting passes (npm run lint / go fmt / etc.)
  • Code formatted according to project standards
  • No console.log statements left in code
  • No commented-out code blocks
  • No unused imports or variables

Git & PR Standards

Documentation

Review Readiness


Additional Notes

The FormLayout component is designed to be reusable for other form layouts in the future. It follows MUI best practices and provides a clean, maintainable solution for form navigation.


Reviewer Notes

Suggested Reviewers:

Priority:

  • Low
  • Medium
  • High
  • Critical

@Bahati308 Bahati308 requested review from IamLRBA and r0ssing December 10, 2025 12:41
@Bahati308 Bahati308 added bug Something isn't working ui For issues related to user interface components, layout, styling, and front-end interactions. formplayer Issues related to the FormPlayer React application priority:medium Medium priority issues status:needs-review platform:all Issues affecting all platforms labels Dec 10, 2025
Copy link
Contributor

@r0ssing r0ssing left a comment

Choose a reason for hiding this comment

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

Thanks! This is great 👍
I really like that you refactored it to use more standards MUI components..

Copy link
Contributor

@IamLRBA IamLRBA left a comment

Choose a reason for hiding this comment

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

Looks good, video was a great addition too!
I was wondering if on the last page, the single "Previous" button would be entered and I saw It is.
That's awesome work @Bahati308

@Ndacyayisenga-droid Ndacyayisenga-droid merged commit 5883aee into OpenDataEnsemble:dev Dec 11, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working formplayer Issues related to the FormPlayer React application platform:all Issues affecting all platforms priority:medium Medium priority issues ui For issues related to user interface components, layout, styling, and front-end interactions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FormPlayer on-screen keyboard and prev/next buttons hide form fields

4 participants