Skip to content

(fix) O3-4463: Hide sidebar on wider workspaces to fix multi-section form layout#700

Open
praneeth622 wants to merge 7 commits into
openmrs:mainfrom
praneeth622:O3-4463/fix-sidebar-form-content-spacing
Open

(fix) O3-4463: Hide sidebar on wider workspaces to fix multi-section form layout#700
praneeth622 wants to merge 7 commits into
openmrs:mainfrom
praneeth622:O3-4463/fix-sidebar-form-content-spacing

Conversation

@praneeth622

Copy link
Copy Markdown

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

PR #461 (O3-4410) changed the sidebar visibility logic so that the sidebar shows on all workspace sizes except narrow. This caused a layout regression on wider workspaces — the sidebar (180px) and form content compete for space, resulting in a cramped/squished layout for multi-section forms.

This fix adds 'wider' to the isFormWorkspaceTooNarrow check, so the sidebar only renders on extra-wide and ultra-wide workspaces where there is sufficient room. On narrow and wider workspaces, multi-section forms use bottom navigation buttons instead.

Workspace Size Sidebar Navigation
narrow Hidden Bottom buttons
wider Hidden (was showing — the bug) Bottom buttons
extra-wide Visible Left sidebar
ultra-wide Visible Left sidebar

Screenshots

Before (bug — sidebar cramped on wider workspace)

image

After (fix — sidebar hidden on wider, bottom buttons used instead)

image

Related Issue

https://openmrs.atlassian.net/browse/O3-4463

Other

…orm spacing

PR openmrs#461 changed the sidebar visibility to show on all workspaces except
narrow. This caused a layout issue on wider workspaces where the sidebar
and form content compete for space. Adding wider to the too-narrow check
restores the intended behavior: sidebar only shows on extra-wide and
ultra-wide workspaces where there is sufficient room.
Copilot AI review requested due to automatic review settings March 11, 2026 11:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adjusts the FormEngine layout rules to prevent the multi-section sidebar from rendering on wider workspaces, addressing a regression where the sidebar and form content competed for space.

Changes:

  • Treat wider workspaces as “too narrow” for the multi-section sidebar.
  • As a result, multi-page forms on wider now use bottom navigation controls instead of the left sidebar.

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

Comment thread src/form-engine.component.tsx Outdated
Comment thread src/form-engine.component.tsx Outdated
@denniskigen denniskigen changed the title (fix) O3-4463: Hide sidebar on wider workspace to fix multi-section f… (fix) O3-4463: Hide sidebar on wider workspaces to fix multi-section form layout Mar 11, 2026
@praneeth622

Copy link
Copy Markdown
Author

@gracepotma 👋

Could you please take a look at this PR when you get a chance?
It fixes the sidebar visibility regression on wider workspaces for multi-section forms (O3-4463).

Would really appreciate your review and approval for merge

Thanks!

@praneeth622

Copy link
Copy Markdown
Author

Hi @NethmiRodrigo , gentle ping on this PR. It addresses O3-4463 (Blocker priority, targeted for RefApp 3.8.0) which causes a layout/spacing issue with multi-section forms using left navigation.

The fix hides the sidebar on wider workspaces to prevent the layout from breaking. Happy to address any feedback or make changes.

Would you (or @jayasanka-sack / @denniskigen ) be able to take a look? Thank you!

@praneeth622

Copy link
Copy Markdown
Author

This PR addresses BLOCKER-priority O3-4463 (reported by @gracepotma) and has been awaiting review for 5 weeks. I've now addressed Copilot's feedback, renamed the memoized flag from isFormWorkspaceTooNarrow to shouldHideFormSidebar to match current semantics (the flag is true for both 'narrow' AND 'wider' sizes, so the old name was misleading), and added a test that covers the 'wider' workspace multi-section case.

Test added in src/form-engine.component.test.tsx: mocks useFormWorkspaceSize → 'wider' and usePageObserverhasMultiplePages: true, then asserts the sidebar is not rendered and the bottom ButtonSet (Cancel + Save) is. yarn test --testPathPattern=form-engine.component passes; existing form-engine.test.tsx (41 tests) also still passes.

No change to the sidebar visibility logic itself only rename + new test coverage.

Requesting review from @dkayiwa @ibacher @samuelmale happy to jump on a call if there are design concerns about hiding the sidebar on wider workspaces vs the earlier behavior

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