Skip to content

fix(formulus): make tables responsive on small screens - #930

Merged
r0ssing merged 9 commits into
OpenDataEnsemble:devfrom
allennakalema06-web:fix/formulus-responsive-tables
Sep 25, 2026
Merged

r0ssing merged 9 commits into
OpenDataEnsemble:devfrom
allennakalema06-web:fix/formulus-responsive-tables

Conversation

@allennakalema06-web

Copy link
Copy Markdown
Contributor

Summary

Fixes #921.

Makes the Formulus Observations and Forms tables more usable on small screens by responsively hiding secondary columns instead of requiring horizontal scrolling.

Changes

  • Added a 600px responsive breakpoint using 'useWindowDimensions'.
  • Observations table:
    • Keeps Form, Created, and Sync visible on narrow screens.
    • Hides Author and ID below 600px.
  • Forms table:
    • Keeps the form name visible on narrow screens.
    • Hides the observation count below 600px.
    • Keeps the New action as a compact icon-only control.
    • Hides the wide New Observation header label on narrow screens.
  • Replaced fixed column widths in the Forms table with flexible sizing for wider layouts.

Testing

  • 'pnpm run format:check'
  • 'pnpm run lint'
  • 'pnpm test --runInBand' - 43 test suites, 266 tests passed
  • 'git diff --check'

Notes

The responsive breakpoint is below 600px.

Manual Android device testing was not performed because an Android development environment is not currently configured.

@najuna-brian

Copy link
Copy Markdown
Member

Hello @allennakalema06-web,
Thanks for this PR.
Can you please comment on the issue requesting it to be assigned to you

@Mishael-2584 Mishael-2584 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for this — nice fix, and the flex-based column resizing is
the right approach (better than the old fixed-width columns).
useWindowDimensions() is also the correct choice here since it
updates on rotation.

Two small things before merge, both explained inline.

Comment thread formulus/src/components/common/FormListTable.tsx Outdated
Comment thread formulus/src/components/common/ObservationListTable.tsx

@IamLRBA IamLRBA left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the initiative @allennakalema06-web and the changes look mostly good.
My only pointer is to also make use of the Packages folder as that's where we defined the tokens to be used.

Just like @Mishael-2584 pointed out, our breakpoint.sm = 640px, in packages/tokens, so it'd be great if the hook used that token instead of the hardcoded 600.

The packages folder also has documentations on how to build and use the tokens.
It's really easy and fun to use them 😁🔥🔥

@allennakalema06-web

Copy link
Copy Markdown
Contributor Author

Thanks @Mishael-2584 and @IamLRBA for the feedback!

I've updated the implementation to move the duplicated narrow-screen logic into a shared 'useIsNarrowScreen()' hook under 'formulus/src/hooks/'. The hook now uses the existing 'breakpoint.sm' design token (640px) instead of the hardcoded 600px value.

I also confirmed that the Author and Observation ID hidden on narrow screens are still available on the Observation Detail screen when a user taps an observation row, so that information isn't lost.

I ran formatting, linting, git diff --check, and the full test suite after the changes, all 43 test suites and 266 tests passed.

Thanks again for pointing me toward the shared tokens and hook approach!

r0ssing
r0ssing previously approved these changes Sep 25, 2026

@r0ssing r0ssing left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Look good! Thanks @allennakalema06-web

@r0ssing
r0ssing self-requested a review September 25, 2026 14:28
@r0ssing
r0ssing merged commit d579fd5 into OpenDataEnsemble:dev Sep 25, 2026
8 checks passed
@najuna-brian
najuna-brian self-requested a review September 25, 2026 14:28
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.

Formulus: make Observations and Forms tables usable on small screens

5 participants