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

AuLoader updates #464

Merged
merged 1 commit into from
Feb 15, 2024
Merged

AuLoader updates #464

merged 1 commit into from
Feb 15, 2024

Conversation

Windvis
Copy link
Contributor

@Windvis Windvis commented Feb 2, 2024

This updates the AuLoader component so it matches the Webuniversum <vl-ui-loader> component.

Notable changes:

  • visual loading message by default
  • an option to hide the loading message, if needed
  • inline loading message variant
  • the "old" version is now deprecated

Closes #456

Migration guide

The existing options that aren't supported by the <vl-ui-loader> component are now deprecated.

No arguments / default loading message

If you were using the AuLoader component without any arguments the component would use a (visually hidden) default message. You can achieve a similar result by passing the previous default message as the block content.

{{! Before }}
<AuLoader />

{{! After }}
<AuLoader @hideMessage={{true}}>Aan het laden</AuLoader>

@message

Use the block content of the component to pass the loading message. If you want this loading message to only be visible for screenreaders you can combine this with the @hideMessage argument.

Before:

{{! Before }}
<AuLoader @message="Only visible for screenreaders" />

{{! After }}
<AuLoader @hideMessage={{true}}>Only visible for screenreaders</AuLoader>

@disableMessage

Disabling the message is not recommended for accessibility reasons. This option was originally added because there was no way to display a visible loading text with the previous implementation. Apps could then disable the internal hidden one, and add a visual loading message themselves. This is now no longer needed since the block content will be used as the visual message by default.

{{! Before }}
<AuLoader @disableMessage={{true}} />
<p>Some loading message</p>

{{! After }}
<AuLoader>Some loading message</AuLoader>

If you have a valid reason for not showing any sort of loading message, please open an issue to request this.

@padding

The padding argument was used to align the loader with other whitespace on the page, since the loader is now centered this shouldn't be needed anymore.

It's still possible to add whitespace by using the spacing util classes.

Component alignment

The new loader defaults to a centered position to match the Webuniversum version. There are use-cases where this can look a bit strange so for those you can set the @centered argument to false and add extra classes to align the component however you want.

Note

@centered was added in the 3.2.0 release

@Windvis
Copy link
Contributor Author

Windvis commented Feb 2, 2024

We also use the AuLoader in the AuButton component, and I think we don't want to output any loading text there, since the button already does that, but the current PR doesn't support that (in a non-deprecated way).

We could keep the @disableMessage but I'm not sure if we should. I think we want to push the version with a loading message for accessibilty reasons, but maybe there are valid cases where we only want the loading animation. We could go for a private argument that we only use in Appuniversum itself maybe. 🤔.

Another option could be to display the inline version inside the button instead, maybe? It will look a bit different from the current version though.

Edit: Hmm, I just looked at the Webuniversum version, and they use a custom animation there, not the vl-ui-loader inside the button. Maybe we should do a similar thing here?

@brenner-company Any insights?

@brenner-company
Copy link
Collaborator

I didn't have the time today to give this a look. I'll pick this up on wednesday if that's ok?

@brenner-company
Copy link
Collaborator

I think both the 'private argument' & 'custom animation (within the button)' are good options. I'm not a fan of the 'inline version' solution because of, as you said, the visual difference.

Could it also be an option to extract the <div class="au-c-loader__animation" aria-hidden="true"></div> as a private component (somethin along addon/private/components/loader-animation) and use that within the actual loader & button component? Maybe I'm overthinking it 😅

@Windvis
Copy link
Contributor Author

Windvis commented Feb 7, 2024

I think both the 'private argument' & 'custom animation (within the button)' are good options. I'm not a fan of the 'inline version' solution because of, as you said, the visual difference.

Could it also be an option to extract the

as a private component (somethin along addon/private/components/loader-animation) and use that within the actual loader & button component? Maybe I'm overthinking it 😅

Yea, that's indeed an option 👍

The main thing I'm not sure about is, do we want to prevent apps from using the AuLoader component without a loading message (so not a non-visual one either). With the current component that's possible. With the new one that won't be. I don't think it's needed, but I might be missing use-cases 😅.

Windvis added a commit that referenced this pull request Feb 12, 2024
This updates the `AuLoader` component so it matches Webuniversum's `<vl-ui-loader>` component.

Notable changes:
- visual loading message by default
- an option to hide the loading message, if needed
- inline loading message variant
- the "old" version is now deprecated. Migration guide: #464

Webuniversum reference: https://overheid.vlaanderen.be/webuniversum/v3/documentation/atoms/vl-ui-loader/
@Windvis Windvis force-pushed the feat/au-loader-improvements branch from cb04c40 to d8fa1ba Compare February 12, 2024 14:37
@Windvis Windvis marked this pull request as ready for review February 12, 2024 14:41
Windvis added a commit that referenced this pull request Feb 12, 2024
This updates the `AuLoader` component so it matches Webuniversum's `<vl-ui-loader>` component.

Notable changes:
- visual loading message by default
- an option to hide the loading message, if needed
- inline loading message variant
- the "old" version is now deprecated. Migration guide: #464

Webuniversum reference: https://overheid.vlaanderen.be/webuniversum/v3/documentation/atoms/vl-ui-loader/
@Windvis Windvis force-pushed the feat/au-loader-improvements branch from d8fa1ba to 6cc0f71 Compare February 12, 2024 14:48
@Windvis Windvis added the enhancement Used when the PR adds a new feature or enhancement. label Feb 12, 2024
Windvis added a commit that referenced this pull request Feb 12, 2024
This updates the `AuLoader` component so it matches Webuniversum's `<vl-ui-loader>` component.

Notable changes:
- visual loading message by default
- an option to hide the loading message, if needed
- inline loading message variant
- the "old" version is now deprecated. Migration guide: #464

Webuniversum reference: https://overheid.vlaanderen.be/webuniversum/v3/documentation/atoms/vl-ui-loader/
@Windvis Windvis force-pushed the feat/au-loader-improvements branch from 6cc0f71 to 44f63f2 Compare February 12, 2024 15:10
This updates the `AuLoader` component so it matches Webuniversum's `<vl-ui-loader>` component.

Notable changes:
- visual loading message by default
- an option to hide the loading message, if needed
- inline loading message variant
- the "old" version is now deprecated. Migration guide: #464

Webuniversum reference: https://overheid.vlaanderen.be/webuniversum/v3/documentation/atoms/vl-ui-loader/
@Windvis Windvis force-pushed the feat/au-loader-improvements branch from 44f63f2 to d13bade Compare February 14, 2024 08:39
@Windvis Windvis changed the title AuLoader improvements AuLoader updates Feb 15, 2024
@Windvis Windvis merged commit 2993795 into master Feb 15, 2024
8 checks passed
@Windvis Windvis deleted the feat/au-loader-improvements branch February 15, 2024 12:30
@Windvis Windvis mentioned this pull request Feb 28, 2024
Windvis added a commit to lblod/frontend-mow-registry that referenced this pull request Sep 4, 2024
Windvis added a commit to lblod/frontend-toezicht-abb that referenced this pull request Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Used when the PR adds a new feature or enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AuLoader visible message version
2 participants