[go: up one dir, main page]

Page MenuHomePhabricator

Design and build initial Dialog component (MVP)
Closed, ResolvedPublic5 Estimated Story Points

Description

This task defines the minimum viable product (MVP) of the Dialog component.


Scope

The MVP covers the scope introduced by the design spec for "SimpleDialog."

Design spec

Anatomy

The initial component will include:

  • A pane that displays on top of the UI. It can contain:
    • An optional header that can contain a title and/or a close button
    • The dialog body
    • An optional footer that can contain up to two action buttons. One button can be primary, otherwise the buttons should be default.
  • Dialog markup is placed at the end of the <body> element
  • (Should this be part of MVP? We're almost done building it) Elements with absolutely positioned parts, like anything with a Menu, should function normally when placed in a Dialog. See also T307030

Style

The initial component will present the following visual features:

  • Size: Dialog frame will have a static max-width for now (once a grid is established we can use that to set different max-widths per breakpoint), and a max-height of 100vh minus a 40px top and bottom padding
  • Dialog frame will have a box-shadow to emphasize its placement over other content
  • Below the frame, a background blur effect will be created over the rest of the UI with a semi-transparent white background-color
  • Action buttons can either be horizontal and aligned to the end of the dialog, or stacked and 100% width

Interaction

The initial component will follow these interaction specifications:

  • The dialog can be closed via the close button, a "safe" action, the esc button, or clicking on the background below the frame
  • Focus will be placed on the first focusable element in the Dialog when it's opened, then back to the previous location when it's closed
  • Users can tab through focusable elements of the Dialog in a loop
  • Body content will have overflow-y hidden via scroll when the max-height is exceeded
  • Content below the open dialog cannot scroll
  • (MVP or future scope?) Transitions should be applied to the Dialog on open and close

Documentation

  • Structure: For now, the Dialog will have its own top-level page on the docs site
  • Content:
    • A configurable demo where the controls live inside the Dialog so that changes can be seen immediately
    • A basic example
    • An example of a component with a Menu, e.g. Select, placed inside a dialog
    • An example with a lot of content to demonstrate overflow behavior
    • An example with stacked action buttons

Considerations

  • Optionally include any other information important to clarifying MVP scope, what's out of scope, other related tasks that should be created, etc.

Open questions

  • Back button: we will implement the back button once we get to the MultistepDialog, and not make it a part of the Dialog component at this time
  • Number of action buttons: we should start with 2 action buttons since we don't have a clear use case for more until we get to process/multistep dialogs. Since implementing Multistep seems far in the future and we don't know exactly what we'd include in the design for it, we think it makes sense to stick with 2 buttons max for the MVP Dialog.
  • Top and bottom dividers: we can add a prop to add the dividers as props and document that the prop should be turned on when the body content of the dialog is expected to be longer than a couple of sentences.
  • Dialog sizes (now captured in design fixes task T319026):
    • Small/Normal size: @width-3200 (512px wide) for desktop (current size in normal dialogs in production) and full grid for mobile (leaving 16px on each side)
    • Big size: 848px wide (we should add a new width token) for desktop (current size in big dialogs) and fullscreen for mobile (will be handled in separate task, T321893: Evaluate fullscreen mobile Dialog in Codex)
  • Loading state: we will implement it in the Dialog as a state that can be turned on/off

Acceptance criteria

This task will pass from the designer to the developer once the Figma spec is created.

Design:

  • A Figma spec sheet is created for the component that includes the scope defined here. A link to the Figma spec sheet's MVP version has been added to this task's description.
  • Add component in the Figma library

Code:

  • The initial component is implemented in Codex.

Design Review:

  • Improve the demo page:
    • "Open dialog" buttons are not prominent enough in the demo box, specially when the properties are expanded. Could we use a Primary Button instead? Declined, not needed with other changes to demo page
      Captura de Pantalla 2022-11-23 a las 11.24.08.png (950×1 px, 1006 KB)
    • Properties are quite hidden inside the accordion. I would display them by default and I would add the "Open dialog" button before the properties:
      Captura de Pantalla 2022-11-23 a las 11.29.02.png (1×1 px, 1 MB)

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

@AnneT added all these questions as open questions in the task. We should solve them before updating the Figma spec with the new Dialog version.

cc: @Catrope @egardner

  1. If the Multistep Dialog will be built with a Dialog component, then we should include the Back button as optional in the Dialog component.

Roan and I were chatting about how we're not exactly sure how we'd build a Multistep Dialog in terms of component architecture and how each step (and their associated actions) is added. It's possible we'd need to add the back button to the Dialog component itself, or it might just be a part of the MultistepDialog component. I'd recommend we wait to answer this question until we're actually building a MultistepDialog. If we did need to implement the back button within Dialog, I'm sure we could figure out a way to make that happen.

That said, if you think we need to decide this now in order to design a future-proof Dialog component, we can do that!

@AnneT regarding the Back button, I would implement it just in the Multistep Dialog since we won't use the back button in a normal Dialog, so I think it will be less confusing for the users if they don't have this back button available in the Dialog. The back button should be before the title, so I think we won't have problems with the structure of the dialog if we want to implement it in the future.

Captura de Pantalla 2022-08-29 a las 12.56.50.png (896×1 px, 482 KB)

@Jdlrobson We're considering how to provide multiple sizes of dialogs, plus an option to go fullscreen on mobile. As Bárbara outlined above, we are considering the following options:

  • Small/Normal size: 498px wide for desktop (current size in normal dialogs in production) and not fullscreen for mobile.
  • Big size: 848px wide for desktop (current size in big dialogs) and fullscreen for mobile

Does going fullscreen on mobile when the big size is used make sense? Or does there need to be a separate prop called fullscreenOnMobile or something, to separate size from fullscreen? We'd like to combine the two, if possible, since the configuration would be more streamlined, but also want to make sure this will work in MFE.

@bmartinezcalvo the engineers talked about this today and agreed on the following:

  • Back button: like you said in your last comment, we agree that we can implement the back button once we get to the MultistepDialog, and not make it a part of the Dialog component at this time
  • 2 or 3 action buttons: we think we should start with 2 action buttons since we don't have a clear use case for more until we get to process/multistep dialogs. Since implementing Multistep seems far in the future and we don't know exactly what we'd include in the design for it, we think it makes sense to stick with 2 buttons max for the MVP Dialog.
  • Size: we're hoping we can combine size and fullscreen as you've suggested, but want to validate this with the MobileFrontend use case first (see my comment above)
bmartinezcalvo added a subscriber: DAbad.

@DAbad moving to the sprint since it was part of our sprint goals (I will update the Figma spec in this sprint as we commented during our last Sprint Planning)

@bmartinezcalvo the engineers talked about this today and agreed on the following:

  • Back button: like you said in your last comment, we agree that we can implement the back button once we get to the MultistepDialog, and not make it a part of the Dialog component at this time
  • 2 or 3 action buttons: we think we should start with 2 action buttons since we don't have a clear use case for more until we get to process/multistep dialogs. Since implementing Multistep seems far in the future and we don't know exactly what we'd include in the design for it, we think it makes sense to stick with 2 buttons max for the MVP Dialog.

@AnneT thank you, updated task description with these questions solved in the open questions section

  • Size: we're hoping we can combine size and fullscreen as you've suggested, but want to validate this with the MobileFrontend use case first (see my comment above)

Ok, I will start updating the Dialog spec with what was agreed and I will create the new size of the Dialog later if needed.

@Jdlrobson We're considering how to provide multiple sizes of dialogs, plus an option to go fullscreen on mobile. As Bárbara outlined above, we are considering the following options:

  • Small/Normal size: 498px wide for desktop (current size in normal dialogs in production) and not fullscreen for mobile.
  • Big size: 848px wide for desktop (current size in big dialogs) and fullscreen for mobile

@AnneT I've been updating the Figma spec sheet and I've realized that we should use 512px width instead for the small size of the dialog, since it's one of our size tokens. If we finally implement the big size of the dialog we will add a new sizing token for the width of this big dialog.

As we commented yesterday with @egardner during our DST standtup the size of the dialog could be improve in the future and we could start with the normal size for the Dialog MVP. So I'm sharing the updated Figma spec sheet with all the things agreed in the task and moving the task to Ready for development now.

Change 829872 had a related patch set uploaded (by Eric Gardner; author: Eric Gardner):

[design/codex@main] [WIP] Dialog component v2

https://gerrit.wikimedia.org/r/829872

egardner set the point value for this task to 5.Sep 15 2022, 7:08 PM

Change 829872 merged by jenkins-bot:

[design/codex@main] Dialog: Introduce Dialog component, useResizeObserver

https://gerrit.wikimedia.org/r/829872

Change 789708 abandoned by Eric Gardner:

[design/codex@main] [WIP] Dialog component

Reason:

See https://gerrit.wikimedia.org/r/c/design/codex/+/829872

https://gerrit.wikimedia.org/r/789708

MVP dialog has been merged, and is available for inspection here: https://doc.wikimedia.org/codex/main/components/demos/dialog.html

As an "experimental" component, Dialog is not yet part of the public Codex release. Extensive testing and follow-up work will be necessary before that can happen.

Things that can happen next:

@egardner Following our team agreement, design fixes were collected in a subtask of this MVP ticket: T319026: Dialog MVP: Design fixes

Moving the open question on Dialog sizes to T319026 design fixes task…

bmartinezcalvo changed the task status from In Progress to Stalled.Oct 19 2022, 6:20 PM

This task is blocked until T319026 is completed.

Change 849191 had a related patch set uploaded (by VolkerE; author: VolkerE):

[mediawiki/core@master] Update Codex from v0.2.1 to v0.2.2

https://gerrit.wikimedia.org/r/849191

Change 849191 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v0.2.1 to v0.2.2

https://gerrit.wikimedia.org/r/849191

Based on today's DST planning discussion, we've decided to move ahead with the simple dialog only – all fullscreen / large size behavior can be addressed at a later time.

egardner changed the task status from Stalled to In Progress.Nov 21 2022, 5:46 PM
egardner claimed this task.

Change 859126 had a related patch set uploaded (by Eric Gardner; author: Eric Gardner):

[design/codex@main] Dialog: prepare basic Dialog for release

https://gerrit.wikimedia.org/r/859126

Change 859126 merged by jenkins-bot:

[design/codex@main] Dialog: prepare basic Dialog for release

https://gerrit.wikimedia.org/r/859126

Change 859597 had a related patch set uploaded (by Anne Tomasevich; author: Anne Tomasevich):

[mediawiki/core@master] Update Codex from v0.2.2 to v0.3.0

https://gerrit.wikimedia.org/r/859597

Change 859597 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v0.2.2 to v0.3.0

https://gerrit.wikimedia.org/r/859597

@egardner design sign-off done. The demo looks much better with the properties outside the Dialog.

Just a couple of things we could do to improve the Dialog demo page:

Captura de Pantalla 2022-11-23 a las 11.20.48.png (1×1 px, 605 KB)

  1. "Open dialog" buttons are not prominent enough in the demo box, specially when the properties are expanded. Could we use a Primary Button instead?
    Captura de Pantalla 2022-11-23 a las 11.24.08.png (950×1 px, 1006 KB)
  1. Properties are quite hidden inside the accordion. I would display them by default and I would add the "Open dialog" button before the properties:
    Captura de Pantalla 2022-11-23 a las 11.29.02.png (1×1 px, 1 MB)

Change 860055 had a related patch set uploaded (by Anne Tomasevich; author: Anne Tomasevich):

[design/codex@main] docs, Dialog: Use normal configurable setup for Dialog demo

https://gerrit.wikimedia.org/r/860055

Change 860055 merged by jenkins-bot:

[design/codex@main] docs, Dialog: Use normal configurable setup for Dialog demo

https://gerrit.wikimedia.org/r/860055

@egardner I added some things to fix about the demo in my last comment (added them as design review list items in the task description).

Moving the task to Ready for development so you can fix them.

Change 864862 had a related patch set uploaded (by Eric Gardner; author: Eric Gardner):

[design/codex@main] Dialog: Allow custom header content

https://gerrit.wikimedia.org/r/864862

Change 865151 had a related patch set uploaded (by Eric Gardner; author: Eric Gardner):

[mediawiki/core@master] Update Codex from v0.3.0 to v0.4.0

https://gerrit.wikimedia.org/r/865151

Change 865151 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v0.3.0 to v0.4.0

https://gerrit.wikimedia.org/r/865151

ldelench_wmf claimed this task.

@ldelench_wmf There's still one patch open for this task – Dialog: Allow custom header and footer content
It's a norm in most contexts here at Wikimedia to not resolve tasks until all patches are merged, superseded by others or abandoned.

Change 864862 abandoned by Eric Gardner:

[design/codex@main] Dialog: Allow custom header and footer content

Reason:

Abandoned in favor of https://gerrit.wikimedia.org/r/c/design/codex/+/893808

https://gerrit.wikimedia.org/r/864862