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

Clean up progress indicator implementation: JS & styling #36

Closed
2 tasks done
sergei-maertens opened this issue Jul 14, 2021 · 3 comments · Fixed by #589, open-formulieren/design-tokens#43, #595, #603 or open-formulieren/open-forms#3633

Comments

@sergei-maertens
Copy link
Member

sergei-maertens commented Jul 14, 2021

The sass does weird things because it's based on the card component and on mobile spacing is different. It's also very contextual w/r to the font-size.

The combination of position: sticky + flexbox + having the expanded progress indicator overlay the rest of the page is challenging.

Additional input:

  • Refactor involved React components
  • Clean up SCSS & address known bugs
@sergei-maertens
Copy link
Member Author

Note that this may potentially be a breaking change due to the ProgressIndicatorDisplay component API

@sergei-maertens
Copy link
Member Author

The LinkOrSpan component that we now use should use the UtrechtLink placeholder variant: https://nl-design-system.github.io/utrecht/storybook/?path=/story/css-link-placeholder--placeholder

Additionally, the utrecht-link--of-active now sets styles that are not scoped to .openforms-theme, these need to be scoped or get a proper design token. Font-weight & margin are affected. The focus state also has similar issues.

@joeribekker
Copy link
Contributor

Refinement: Sergei says we need to toss out the old implementation and get something new and shiny. We should look at NLDS for existing components or inspiration.

@vaszig vaszig moved this from Todo to In Progress in Development Oct 6, 2023
@vaszig vaszig moved this from In Progress to Todo in Development Oct 9, 2023
@vaszig vaszig moved this from Todo to In Progress in Development Oct 9, 2023
@vaszig vaszig moved this from In Progress to Todo in Development Oct 10, 2023
@vaszig vaszig moved this from Todo to In Progress in Development Oct 30, 2023
@sergei-maertens sergei-maertens modified the milestones: SDK 2.0, SDK 2.1 Nov 6, 2023
vaszig added a commit that referenced this issue Nov 8, 2023
vaszig added a commit that referenced this issue Nov 8, 2023
vaszig added a commit that referenced this issue Nov 8, 2023
vaszig added a commit that referenced this issue Nov 8, 2023
vaszig added a commit that referenced this issue Nov 10, 2023
vaszig added a commit that referenced this issue Nov 10, 2023
vaszig added a commit that referenced this issue Nov 10, 2023
vaszig added a commit that referenced this issue Nov 10, 2023
sergei-maertens added a commit that referenced this issue Nov 24, 2023
Rather than having the progress indicator component inherit the card
component styles, it shares the implementation details with it but
uses its own component namespace in the design tokens.

Implemented in a backwards compatible manner to point to existing
design tokens, but you can specify more specific ones if you'd like
so.
sergei-maertens added a commit that referenced this issue Nov 24, 2023
* Use flexbox and gap for spacing between caption and link list in
  progress indicator
* Hide the mobile header/toggle button on desktop
* Manage spacing between list items with gap rather than margins
sergei-maertens added a commit that referenced this issue Nov 24, 2023
This now uses a flexbox approach for the content, while using the normal
document flow as much as possible to fit the element inside its
container element(s).

The story is updated so that it's clear how overflowing content is
handled.

Padding is removed from the parent element and moved into the button
element, so that it is more touch-device friendly. Tapping anywhere on
the header now toggles it between open/closed state.

Finally, most of these appearance aspects are now parametrized through
design tokens.
sergei-maertens added a commit that referenced this issue Nov 24, 2023
When scrolling the main content, the progress indicator should stay
in view.
sergei-maertens added a commit that referenced this issue Nov 27, 2023
This is quite involved as there are some styling edge cases to consider:

* form title that overflows and is truncated with ellipsis - if you're not
  careful, this can cause a horizontal scrollbar
* form title that is long and the main content being scrollable - this can also
  cause a small horizontal scrollbar due to the ellipsis situation
* the progress indicator content itself should be scrollable, independent from
  the main content
* possibly there is an external header/footer that may take up some vertical
  space, which limits the amount of vertical space available for our progress
  indicator

The implementation now passes a ref to the button element in React, which
allows us to calculate the height of the button (our 'menu' bar) AND its offset
to the top of the page, in case there is another external UI element taking
space. We then allocate a maximum block size (= vertical space) as the
dynamic viewport block (100dvb, dynamic taking into account the address bar
that can dissapear on actual mobile devices) minues the vertical/block spacing
reserved for the button and possible third party content.

When scrolling down, our button may overlay the third party content (due to the
position: sticky) and this frees up a little bit of space below the progress
indicator - this is deliberate. Users are allowed to interact with buttons
below it and simplifies us having to track more things in React.
sergei-maertens added a commit that referenced this issue Nov 27, 2023
On mobile, apply some padding to push the language buttons down.
sergei-maertens added a commit to open-formulieren/design-tokens that referenced this issue Nov 27, 2023
Add new, update existing and remove obsolete design tokens related to the
progress indicator styling. This includes some bigger changes to the app
component as well.
sergei-maertens added a commit to open-formulieren/design-tokens that referenced this issue Nov 27, 2023
Add new, update existing and remove obsolete design tokens related to the
progress indicator styling. This includes some bigger changes to the app
component as well.
@github-project-automation github-project-automation bot moved this from Implemented to In Progress in Development Nov 27, 2023
sergei-maertens added a commit that referenced this issue Nov 27, 2023
The fixed steps being added don't need to be falsy, they
need to not be added at all.
@sergei-maertens sergei-maertens moved this from In Progress to Implemented in Development Nov 27, 2023
sergei-maertens added a commit that referenced this issue Nov 28, 2023
The explicit z-index creates a stacking context which puts it on top of
the date picker in appointments. Not specifying the z-index seems to
work equally well.
sergei-maertens added a commit to open-formulieren/design-tokens that referenced this issue Nov 29, 2023
Add new, update existing and remove obsolete design tokens related to the
progress indicator styling. This includes some bigger changes to the app
component as well.
sergei-maertens added a commit that referenced this issue Nov 29, 2023
Something went wrong with the previous version of design tokens,
so I've redone them. Even the git reflog couldn't help :(
sergei-maertens added a commit that referenced this issue Nov 29, 2023
On request we can bring it back, but currently it doesn't seem that
anyone makes use of this mechanism.
sergei-maertens added a commit that referenced this issue Nov 29, 2023
The overview should be navigable once all the preceding steps are
completed, rather than always rendering a placeholder.
sergei-maertens added a commit to open-formulieren/open-forms that referenced this issue Nov 29, 2023
@github-project-automation github-project-automation bot moved this from Implemented to Done in Development Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment