Page MenuHomePhabricator

[EPIC] Popover: Add Popover component to Codex
Closed, ResolvedPublic

Description

Overview

A Popover is a localized, non-modal container that pops up over all other elements on a page to convey additional content and actions.

User stories

  • As a user, I need additional space to provide information or interactivity based on an existing element on the page.

Component task owners

Potential use cases

image.png (722×384 px, 62 KB)
Growth implementation in Vue (See related task T340199)
Captura de pantalla 2024-01-24 a las 11.34.31.png (2,876×1,398 px, 1 MB)
Captura de pantalla 2024-01-24 a las 11.34.53.png (2,878×1,394 px, 1 MB)
Captura de pantalla 2024-01-24 a las 11.34.07.png (2,880×1,392 px, 1 MB)
Popups with different content in Wikipedia.
image.png (726×722 px, 73 KB)
Popover to show user account reputation score data (see T384702)
Popover to surface structured tasks to readers (see T376680)

Codex implementation

Component scope

The initial component will have the following features:

  • A target element that opens the Popover. The target element is triggered on hover or toggle. This can be a toggle button or a link triggered on hover (eg. Wikipedia link previews).
    • If the target element is a toggle button, ensure the toggle button has a type="button" to prevent browsers from mistaking the button as a submit button when placed inside forms.
  • A live region to announce the Popover information.
  • Use Floating UI to absolutely position the Popover to the target element.
  • Customize with a title, close button, text, and actions.
  • Customize by including images (eg. Wikipedia link previews).
  • Customizable layouts such as vertical and horizontal (eg. Wikipedia link previews).
  • An optional caret tip that points to the triggering element (opt-in to use this feature). Refer to Floating UI's arrow to position the caret tip.

API:

  • Slots: header, body, and footer.
  • Props: open, title, useCloseButton, closeButtonLabel, props related to actions and their layout, target (similar to Dialog).

Open questions

  • Regarding focus behavior and tab order, what is the expected behavior for entering and exiting the focus of the Popover when using a keyboard?
  • Define the user flow when interacting with elements in the background.
    • Option 1: First lose the focus of the Popover, then interact with other elements. Example: When a Popover is visible, clicking on a link in the background will close the Popover.
    • Option 2: Instantly able to interact with other elements. Example: When a Popover is visible, clicking on a link in the background will close the Popover and navigate to another page.
  • In OOUI, the PopupButton uses the title HTML attribute. Should the Popover use the title attribute? And do we style it similarly to the Tooltip?
  • In mobile, Popover appears as a bottom sheet and there are known issues with bottom sheets in iOS. Do we include the mobile-friendly version in the MVP?
  • Does this need a global event handler for the Escape key?
  • Does it need to be aware of the teleport target like the Dialog?
  • Does this need to have a z-index different than tooltip? Is the popover from a user logic stacked above or below a toast notification – tooltip right now is 800, toast notification 900?

Design spec

Guidelines

Demos

Designer should describe how the component should be documented in the demos, including configurable and standalone demos.

Acceptance criteria

Minimum viable product

This task covers the minimum viable product (MVP) version of this component. MVP includes basic layout, default states, and most important functionality.

Design

  • Implement the component in Figma

Code

  • Implement the Vue component in Codex
  • Add the WIP component
  • Add a basic demo to Sandbox
  • Add snapshot and unit tests
  • Add demo page with guidelines and code examples

Details

Other Assignee
lwatson

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
CCiufo-WMF raised the priority of this task from Low to Needs Triage.Dec 10 2024, 10:40 AM
CCiufo-WMF moved this task from Next to Later on the Design-System-Team (Roadmap) board.
CCiufo-WMF moved this task from Later to Next on the Design-System-Team (Roadmap) board.

Hi! The Moderator Tools team is starting work on Codex-ifying the filters in Special:Recent Changes T382952.
In the current flow a popover is used to save filters, we would need this component to work on the Recent Changes filters.

Use of popover component in 'Saved Filters'
Popup component example.png (1,440×424 px, 122 KB)

@kostajh cool! Could you let us know when you're starting to approach the design phase? That'll be a good time for us to assign DST members to collaborate.

Sure, will do. Thanks!

@CCiufo-WMF and I chatted yesterday and discussed that this task would be needed for the work that TSP intends to do in Q3 around showing a popover for user account reputation data (tasks to be created).

CCiufo-WMF changed the task status from Open to In Progress.Feb 10 2025, 5:12 PM
CCiufo-WMF assigned this task to DTorsani-WMF.
CCiufo-WMF updated Other Assignee, added: lwatson.
CCiufo-WMF updated the task description. (Show Details)
CCiufo-WMF moved this task from Next to Now on the Design-System-Team (Roadmap) board.
CCiufo-WMF added a subscriber: lwatson.
lwatson changed the status of subtask T386152: Popover: add an arrow from Open to In Progress.Mar 4 2025, 2:45 AM

Hi, I just wanted to share an update from TSP. We recently asked Stewards and functionaries to provide feedback on a custom popover design for a user info card (write-up of results is in progress). The popover we are intending to build has the addition of a menu button next to the close icon. My understanding is that this will be fine to add in/customise?

image.png (2,150×924 px, 344 KB)

Hi, I just wanted to share an update from TSP. We recently asked Stewards and functionaries to provide feedback on a custom popover design for a user info card (write-up of results is in progress). The popover we are intending to build has the addition of a menu button next to the close icon. My understanding is that this will be fine to add in/customise?

image.png (2,150×924 px, 344 KB)

That should be fine, but we should maybe spin up a quick demo in the sandbox to test the "menu on top of Popover" behavior. We know that menu within menu is an issue (T385639). cc @lwatson @AnneT

We're targeting to release Popover next week (~ March 18th). If we encounter any delays, we'll push its release to two weeks out, the week of April 1st.
cc: @kostajh @KColeman-WMF

We're targeting to release Popover next week (~ March 18th). If we encounter any delays, we'll push its release to two weeks out, the week of April 1st.
cc: @kostajh @KColeman-WMF

wonderful, thanks!

We're targeting to release Popover next week (~ March 18th). If we encounter any delays, we'll push its release to two weeks out, the week of April 1st.
cc: @kostajh @KColeman-WMF

Brilliant, thank you for working on this!

We released Popover in the latest Codex release v1.21.1 and it will ride the train next week!

cc: @kostajh & @KColeman-WMF

We released Popover in the latest Codex release v1.21.1 and it will ride the train next week!

cc: @kostajh & @KColeman-WMF

🎉 wonderful, thanks!

We released Popover in the latest Codex release v1.21.1 and it will ride the train next week!

cc: @kostajh & @KColeman-WMF

Fantastic, thank you!