Skip to content

Ensure all modals have headers - #1259

Merged
microbit-robert merged 2 commits into
mainfrom
dialog-headers
Aug 14, 2026
Merged

Ensure all modals have headers#1259
microbit-robert merged 2 commits into
mainfrom
dialog-headers

Conversation

@microbit-robert

Copy link
Copy Markdown
Collaborator

Uses a new DialogHeading component with title slot to ensure that these are used to label the dialog. We have header props for GenericDialog that are never used since they change the appearance of the dialogs. We continue to avoid using them here as I'm not sure there's a nice way to use them while maintaining the existing styling and positing of the h2 elements.

About and feedback don't look amazing:
Screenshot 2026-08-13 at 17 13 23
Screenshot 2026-08-13 at 17 13 06

See See microbit-foundation/ui#29

@github-actions

Copy link
Copy Markdown

Preview build will be at
https://review-python-editor-v3.microbit.org/dialog-headers/

@microbit-matt-hillsdon

Copy link
Copy Markdown
Collaborator

Interesting. So it's too visually different to align them with dialogs using ModalHeader?

I think we'll have to use aria-label (or whatever it is) for About/Feedback. Feedback we can fix in time by dropping the form embed.

@microbit-robert

microbit-robert commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator Author

Interesting. So it's too visually different to align them with dialogs using ModalHeader?

I think we'll have to use aria-label (or whatever it is) for About/Feedback. Feedback we can fix in time by dropping the form embed.

Hmm yeah, we could do it but it's a bit awkward to keep the existing layout / spacing. An example for one header, but we could have this as a component.

header={
  <styled.span display="block" px="5" pt="3" mb="-6">
    <FormattedMessage id="connect-cable-title"/>
  </styled.span>
}

If the library dialog header or body padding changes then this will drift and need re-calculating.

@microbit-matt-hillsdon

Copy link
Copy Markdown
Collaborator

Discussed with Rob. The right fix here is a reworking of the dialogs to align with the more normal use in ml-trainer. But this will require visual change to the heading location (e.g. relative to the close button) and reworking the padding around each dialog. I think it's worth doing but this change is a clear improvement without requiring us to discuss the visual aspect so let's get it in first then raise an issue in this repo for the rest.

@microbit-robert

Copy link
Copy Markdown
Collaborator Author

Raised issue as #1262

@microbit-robert
microbit-robert merged commit 4fdb2cb into main Aug 14, 2026
1 check passed
@microbit-robert
microbit-robert deleted the dialog-headers branch August 14, 2026 11:34
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