Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) Restore side navigation #417

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

samuelmale
Copy link
Member

@samuelmale samuelmale commented Oct 24, 2024

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

Brings back the form's side navigation with some improvements! The nav shows up when you have multiple pages and enough screen space (extra-wide or ultra-wide workspace).

Under the Hood

Three new hooks make this work:

  1. useFormWorkspaceSize: Figures out how much space we have to work with
  2. usePageObserver: Keeps track of pages, errors, and what's visible
  3. useCurrentActivePage: Handles page navigation

Known Limitations

Few things we might want to add later:

  • Can't jump directly to fields with errors yet
  • No toggle to hide/show the navigation
  • No "mark all as unspecified" feature

Screenshots

extra-wide workspace:

2024-10-29 14-52-33 2024-10-29 14_55_03

ultra-wide workspace:

Screenshot 2024-10-29 at 14 57 21

wider workspace:

Screenshot 2024-10-29 at 15 00 36

Related Issue

Other

@samuelmale samuelmale marked this pull request as draft October 24, 2024 12:30
Copy link

github-actions bot commented Oct 24, 2024

Size Change: -353 kB (-22%) 🎉

Total Size: 1.25 MB

Filename Size Change
dist/343.js 0 B -253 kB (removed) 🏆
dist/697.js 0 B -111 kB (removed) 🏆
ℹ️ View Unchanged
Filename Size Change
dist/151.js 379 kB 0 B
dist/225.js 2.57 kB 0 B
dist/254.js 88.7 kB 0 B
dist/277.js 1.85 kB 0 B
dist/300.js 642 B 0 B
dist/335.js 968 B 0 B
dist/353.js 3.02 kB 0 B
dist/41.js 3.37 kB 0 B
dist/539.js 262 kB 0 B
dist/540.js 2.63 kB 0 B
dist/55.js 758 B 0 B
dist/585.js 112 kB 0 B
dist/635.js 14.4 kB 0 B
dist/690.js 11.5 kB 0 B
dist/70.js 483 B 0 B
dist/979.js 6.87 kB 0 B
dist/99.js 691 B 0 B
dist/993.js 3.09 kB 0 B
dist/main.js 354 kB +9.93 kB (+2.88%)
dist/openmrs-esm-form-engine-lib.js 3.8 kB +1 B (+0.03%)

compressed-size-action

@denniskigen
Copy link
Member

Could we get some early design feedback on this, @samuelmale? Screenshots or videos would be ideal.

@samuelmale samuelmale marked this pull request as ready for review October 29, 2024 12:01
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