Skip to content

feat(formplayer): UX improvements#560

Merged
r0ssing merged 12 commits intoOpenDataEnsemble:devfrom
HelloSapiens:fix/formplayer-layout-issues
Mar 21, 2026
Merged

feat(formplayer): UX improvements#560
r0ssing merged 12 commits intoOpenDataEnsemble:devfrom
HelloSapiens:fix/formplayer-layout-issues

Conversation

@r0ssing
Copy link
Contributor

@r0ssing r0ssing commented Mar 21, 2026

Formplayer UX improvements

Description

This PR resolves critical UX issues in the formplayer layout, particularly affecting mobile WebView interactions. The changes focus on:

  1. Button Styling Fixes – Replaced the ad-hoc .button-reverse-primary class with a comprehensive CSS system that properly freezes button hover/focus states for outline buttons, preventing unintended visual changes (e.g., "Previous" button appearing to randomly turn solid). Added dedicated .ode-button styling for all button variants (primary, neutral, secondary, danger) with appropriate dark mode support and keyboard focus indicators.

  2. Layout Architecture Redesign – Refactored FormLayout to use flexbox column layout instead of position: fixed footer with visualViewport calculations. The previous approach broke when the host app resized the WebView for mobile keyboards (e.g., Android adjustResize). The new approach keeps the prev/next bar in normal flex flow at the bottom, so it automatically stays visible when the viewport shrinks.

  3. Draft Management for New Observations – Added draftSessionKey to distinguish multiple unsaved drafts for the same formType (previously only observationId was tracked, which is null for new observations). This allows concurrent draft sessions for new forms and backward-compatible migration of legacy drafts.

  4. Mobile Keyboard UX – Implemented auto-focus for the first text input on page transitions in SwipeLayout, keeping the mobile keyboard open across page changes for faster form entry.

  5. Draft Selector Improvements – Updated date formatting to include time (ISO locale string), improved responsive layout with boxSizing: border-box, and refined draft summary display.

Type of Change

  • Bug Fix
  • New Feature / Enhancement
  • Refactor / Code Cleanup
  • Documentation Update
  • Maintenance / Chore
  • Other (please specify):

Component(s) Affected

  • formulus (React Native mobile app)
  • formulus-formplayer (React web app)
  • synkronus (Go backend server)
  • synkronus-cli (Command-line utility)
  • Documentation
  • DevOps / CI/CD
  • Other:

Related Issue(s)

Closes/Fixes/Resolves:


Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manually tested
  • Tested on multiple platforms (if applicable)
  • Not applicable

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

Checklist

  • Code follows project style guidelines
  • All existing tests pass
  • New tests added for new functionality
  • PR title follows Conventional Commits format

Thank you for contributing to Open Data Ensemble (ODE)!

r0ssing added 12 commits March 21, 2026 20:37
…tructure

- Removed the visual viewport handling logic for keyboard inset, simplifying the component.
- Updated comments for clarity regarding mobile keyboard submission.
- Adjusted layout properties to ensure proper flex behavior and padding without relying on keyboard inset.
- Enhanced the navigation bar and scroll area structure for better responsiveness.
- Updated CSS for body to use flex properties for better content handling.
- Adjusted FormLayout component to ensure proper flex display and column direction.
- Improved scrolling behavior by allowing the FormLayout to manage overflow effectively.
…responsiveness

- Replaced Stack component with Box to enhance layout flexibility.
- Adjusted button alignment and spacing for better responsiveness.
- Removed unused spacing logic to simplify the component structure.
…nsistency

- Changed button alignment from 'flex-start' and 'flex-end' to 'stretch' for better visual consistency.
- Adjusted button styles to ensure full width usage while maintaining maximum width constraints.
- Replaced instances of 'button-reverse-primary' with 'formplayer-solid-primary' for the Finalize and Next buttons.
- Updated CSS to reflect new button behavior, ensuring primary buttons remain filled at rest and darken slightly on hover.
@r0ssing r0ssing requested review from IamLRBA and najuna-brian March 21, 2026 20:55
@IamLRBA
Copy link
Contributor

IamLRBA commented Mar 21, 2026

Good work Emil!

@r0ssing r0ssing merged commit 52ab010 into OpenDataEnsemble:dev Mar 21, 2026
10 checks passed
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.

2 participants