Skip to content

Notification slot and design update for ModalDialog - #339

Merged
devmount merged 10 commits into
mainfrom
enhancements/234-notification-slot-and-design-update-for-modal-dialog
Oct 5, 2026
Merged

devmount merged 10 commits into
mainfrom
enhancements/234-notification-slot-and-design-update-for-modal-dialog

Conversation

@devmount

Copy link
Copy Markdown
Collaborator

What changed?

Added a new optional notification slot to ModalDialog, rendered between the header and body and only shown when content is provided. Extended ModalDialog.test.js to cover the slot's presence and absence, and added a "With Notification" story demonstrating a NoticeBar info message.

This PR also aligns the styles of the ModalDialog component with the current design.

Why?

Error or info messages shown inside a ModalDialog currently have no dedicated place and end up hand-placed in the body slot. Now they have a defined place.

Limitations and Notes

  • The designs show a services specific logo on top (Thundermail), which isn't part of this change, since it can just be inserted into the header slot together with the title. Please let me know if we want a dedicated slot or story for that.

Applicable Issues

Closes #234
Closes #321

QA Log

  • Ran vitest run test/components/ModalDialog.test.js, all 16 tests pass.
  • Ran vue-tsc --noEmit and eslint on the changed files, no errors.
  • Manually checked the WithNotification Storybook story and compared to the design.

Screenshots

Style changes:
services-ui_modal-dialog

With notification story
image

@devmount devmount self-assigned this Sep 29, 2026

@rwood-moz rwood-moz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried it out locally, ran the updated component tests (all pass), and had a look at the ModalDialog in the updated storybook. LGTM!

* The designs show a services specific logo on top (Thundermail), which isn't part of this change, since it can just be inserted into the header slot together with the title. Please let me know if we want a dedicated slot or story for that.

IMO a dedicated slot isn't necessary if the header can just be used, but I'll leave that up to you and @davinotdavid whatever you think. If you leave it in the header maybe you could add to the storybook an example with a header with the Thundermail logo in it if you think that would be useful.

@davinotdavid davinotdavid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work so far! Looks pretty good. A few things only to adjust:

  • There's also a variant in Zeplin that has a product logo on the top left. Perhaps we should add a slot for that just in case?
Image

Comment thread src/components/ModalDialog.vue Outdated
Comment on lines +59 to +61
<div v-if="$slots.notification" class="modal-notification">
<slot name="notification"></slot>
</div>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting and I like the idea of having a dedicated space for the notification. However, doing it like so as a sibling of the modal-body and having the modal-body be the scrollable point, it may cause some cropping:

Image

@devmount devmount Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find! I moved the notification slot inside the .modal-body class now. My intention here was to have the notification always visible, even when scrolled down.

Comment thread src/components/ModalDialog.vue Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having a padding-top to control the spacing here makes it a bit harder to adjust the layout overall IMHO.

Image

The spacing around the close button seems different than Zeplin and if we were to measure the title to the top it would be 6rem instead of 4rem (although I'd argue that your positioning of the title is better):

Image

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davinotdavid I removed the padding and tried to do the spacing element-wise, taking all possible slot configurations into account. I find the layout of this component difficult in general, also Zeplin and Figma seem to differ a lot in that regard. Maybe we can adjust this in a follow-up PR after a desgin-review.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it is indeed tricky because of the absolute positioned close button there I believe and designs are not really aligned either in Zeplin so agreed that it can be fixed in a future PR.

However, for modals without title, I believe we should still add some padding at the top otherwise it looks a bit strange:

With actions
image

Simple
image

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, agreed. I added 3rem top margin for the body if it's standalone now. Thanks for this suggestion!

@devmount

devmount commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

@davinotdavid Thanks so much for your review! I addressed all of your points. Since you requested it explicitly (see earlier discussion with Rob), I added a slot logo for this component now:

image

@devmount
devmount requested a review from davinotdavid October 5, 2026 15:29

@davinotdavid davinotdavid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after the reviews have been addressed, thanks!

One final thing:

Comment thread src/foundation/XIcon.vue
@devmount
devmount merged commit cc15965 into main Oct 5, 2026
5 checks passed
@devmount
devmount deleted the enhancements/234-notification-slot-and-design-update-for-modal-dialog branch October 5, 2026 19:35
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.

[Design Committee] Modal updates Additional slot for notifications in ModalDialog

3 participants