-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ML] Fix modal titles #147855
[ML] Fix modal titles #147855
Conversation
Pinging @elastic/ml-ui (:ml) |
@jgowdyelastic I reckon it's semantically incorrect putting the |
The EUI examples use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
These changes look good, but it looks like titles aren't being styled correct for any For example: Compared to one which hasn't been opened from a flyout: @elastic/kibana-design is this a known issue for |
@peteharverson Thank you for the ping on our Slack channel. If you pass a bare string or HTML tag as the The EUI team is working on a documentation update to spell out using H1 for modal titles today. After some discussion and reviews, we're recommending modals use H1 because it's a significant shift in user context. We want to visually and semantically convey this is a break in the previous flow, and we need your (user's) attention on this window for a moment. |
@1Copenut Are you sure this is the case now? this is how it used to work, but after a recent eui change it no longer seems to do this, hence the reason we've created this PR. |
@jgowdyelastic I took a second look and found the root cause. EUI PR #6321 removed a containing
If there's time for another round of changes, I'd recommend swapping H2 for H1 to give semantic parity to the default EUI modal. Or if this patch needs to land quickly, can we add an improvement ticket to the backlog? |
Without seeing the source React code, I'm speculating a bit, but... The |
Yes, looks like the ones where we have the small text is because we are passing
Trying this out now leads me to a design question - this looks a bit odd where there is just a title and no child component: compared to this, where I added a child @elastic/kibana-design what do you think? Should we add a child component for all our |
@peteharverson I don't think we need to force adding in text here unless it adds more value for the user. (See EUI Modal Guidelines). We also try to avoid saying 'Are you sure' (Writing guidelines) . |
@peteharverson updated |
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested latest changes and LGTM
An EUI change has caused modal titles to no longer be implicitly wrapped in a header tag. This change adds a `h2` to all modal titles. **Old** <img width="824" alt="image" src="https://user-images.githubusercontent.com/22172091/208673148-3da918c4-f1d7-48c5-8afd-022b912b49fc.png"> **New** <img width="857" alt="image" src="https://user-images.githubusercontent.com/22172091/208673087-1b8cba03-504b-4505-ac65-0fcfcce4b99b.png">
An EUI change has caused modal titles to no longer be implicitly wrapped in a header tag.
This change adds a
h2
to all modal titles.Old
New