Page MenuHomePhabricator

Design Divider component
Closed, DeclinedPublic

Description

Background/Goal

A Divider component needs to be designed and specified before its implementation as part of the TypeaheadSearch component.
Dividers are simple, one-line elements used to structure information in framed components (e.g. cards or menus)

Screenshot 2022-02-01 at 19.02.33.png (828×1 px, 255 KB)

User stories

As a designer and developer, I need to be able to reuse system-compliant Dividers, in order to compartmentalize information in menus or cards.

Considerations

Dividers are structural components that don't present any interactive states.

Development considerations

The Divider component might be based on the line-break <br> html element.
Due to their simplicity, it's unclear if dividers should be created as components, or mixins with custom attributes (color, radius, width), or whether they should be implemented at all.


Codex implementation

Component task owners

  • Designer: add the main designer's name
  • Developer: add the main developer's name

Open questions

  • List any current open questions here

Design spec

Anatomy
  • 1px width
Style
  • 3 different colors available: white, light gray and dark gray.
Interaction
  • There are no interactions with the Divider component.
Documentation
  • Configurable demo: the user can configure the color of the divider.

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.

MVP scope

  • List all parts of the MVP scope for this component

Design

  • Design the Figma spec sheet and add a link to it in this task
  • Update the component in the Figma library. This step will be done by a DST member.

Code

  • Implement the component in Codex

Future work

  • If applicable, list future work that should be done for this component after the MVP is implemented as part of this task. You should open new, standalone tasks for all future work.

Event Timeline

STH changed the task status from Open to In Progress.Apr 28 2022, 3:53 PM
STH triaged this task as Medium priority.

The figma spec linked in the description says that the file is not found (perhaps it needs to be made public?)

Hey, @DannyS712. Sorry about that! I just made the file public.

Nevertheless, I'm resolving this task because the Divider doesn't need to be implemented for now: we assumed it could be needed to create the TypeaheadSearch menu's footer, but of course a simple border was applied instead.

In Figma, we initially used this Divider design, but we were recently able to remove it from the Menu footer and (thanks to a new functionality) apply also a top border to the last option in the menu. We decided to keep the Divider component in the Codex design library for now because it might be needed in the future, but its implementation is not a priority (we're not sure a code component will ever be needed).

Sgs subscribed.

Hi @Sarai-WMDE,

I'm working in T300532: Migration of mentee overview to Vue as an on-going effort from the Growth-Team to migrate our interfaces to Vue. Coming from the review process of gerrit 778997 we think it might be useful for us to use a generic "HorizontalDivider" ( see attached screenshot ). This separator are already present in production in the current version of mentor dashboard but implemented with ad-hoc borders.

{F35256425}

Is this something that we could build/abstract to Codex?

Hi @Sgs! Thanks for sharing your use case. We had doubts regarding the need to incorporate this component into Codex. I originally thought that this could be introduced as a styled, reusable <hr> element. Nevertheless, like in the example you shared, these "dividers" are actually implemented as border in most cases (e.g. Wikipedia titles). A far as I can see, we have three alternatives:

  1. Do not abstract dividers to Codex and instead use individual design tokens to properly style these borders in context
  2. Create and distribute a "divider" mixin with all needed styles that apply to the border (border: 1px solid @border-color, width: 100%)
  3. Introduce an <hr> divider component to Codex (Some examples from other libraries: Google's Material UI, Microsoft's Fluent UI, Adobe's Spectrum, Elastic UI– please excuse the Reactness).

Of course, moving forward with the last alternative would involve changing the current implementation approach. It would be great to hear your opinion on what sounds more convenient for the Growth team. Would also like to hear what @Catrope, @AnneT and @Volker_E would have to say.

Thanks @Sarai-WMDE, the alternatives rundown makes sense to me.
Additionally I don't see any of these as mutually exclusive. Creating 2. could also be applied to most cases in 1. for example. A divider mixin might make sense in general IMO as soon as we identify two use cases in different components.
And 3. I'd defer to introduce right now, as it's low priority, but for page structure semantics we might want to pick it up in future again.

Thanks for breakdown @Sarai-WMDE. In the implementation of the mentor dashboard with Vue ( gerrit 778997 ) I have created a HorizontalDivider component because it made sense to me. It's not polished for a generic use, I did the MVP to fit my case.

As @Volker_E mentions I find alternatives (2) and (3) interesting to explore. Also if they are developed in order Growth team could use the mixin in instead of ad-hoc styles until the final component is created so our code is already "in-sync".

Personally I like the flexibility and options Google's Material and Elastic UI provide. If there's a Figma spec or even some draft to follow I can happily work on this.

Hey Sergio. That sounds really good in my opinion, but I should get back at the Design system team for alignment in order to provide a uniform answer. Will do that asap.

We do have draft design specifications for the Divider component (the Figma file is linked in the task description), but these are still pending to be reviewed by the team.

bmartinezcalvo updated the task description. (Show Details)
bmartinezcalvo edited subscribers, added: CCiufo-WMF, DTorsani-WMF; removed: nray.
Sarai-WMDE removed Sarai-WMDE as the assignee of this task.