Page MenuHomePhabricator

Add TreeView component to Codex (MVP)
Open, LowPublic

Description

NOTE: This task should be reformatted to the new component mvp template (T329320)

Background

  • Description: Hierarchical structure that provides nested levels of navigation.
  • History: Conversations about Accordion Vs. TreeView in this task T280785
  • Considerations: list any known challenges or blockers, or any other important information
  • Known use case(s): the following use cases have been detected:
    • Vector 2022 toc sections
      Captura de Pantalla 2022-12-16 a las 12.10.41.png (1×2 px, 2 MB)

User stories

  • As a designer/developer I need to use the TreeView component to create different levels of navigation.
  • As a designer/developer I need to understand the difference between Accordion and TreeView components.

Previous implementations

These artifacts are listed for historical context. The figma spec, linked below, is the source of truth for the new component.

  • Design style guide: There are no previous guidelines for this component
  • OOUI: There is no previous implementation in OOUI for this component

Design proposals

Captura de Pantalla 2022-12-16 a las 12.33.55.png (1×1 px, 497 KB)
Captura de Pantalla 2022-12-16 a las 12.34.00.png (1×1 px, 539 KB)
Captura de Pantalla 2022-12-16 a las 12.34.09.png (1×938 px, 502 KB)
Captura de Pantalla 2022-12-16 a las 12.34.04.png (1×972 px, 468 KB)
Captura de Pantalla 2022-12-16 a las 12.34.15.png (1×1 px, 739 KB)
Black titleBold titleLineGray backgroundBlue background

Previous conversations about the ToC indentation and enumeration in T307316


Codex implementation

Component task owners

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

Design spec

Once a component spec sheet has been created in Figma, remove the note stating that the spec is missing and link to the spec below.

A component spec sheet has not been created yet.

Component spec sheet

Stage 1: Minimum viable product (MVP)

MVP includes basic layout, default states, and most important functionality.

Acceptance criteria

  • Determine what MVP includes for this component and document this in a subtask. Assign task to designer.
  • Design MVP. Once complete, assign task to developer.
  • Implement MVP

Stage 2: Additional states, features, and variants

This might include a disabled state, framed/frameless designs, transitions, supporting different use cases, etc., which will be captured in separate subtasks.

Acceptance criteria

  • Document design and implementation of additional states and features in individual subtasks
  • Complete each additional state/feature subtask

Stage 3: Refinement

This stage includes any final touches or bug fixes needed before the component can be deemed complete, which will be captured in separate subtasks.

Acceptance criteria

  • Finalize docs: open and complete a subtask for any additional demos that need to be added or documentation that needs work
  • Meet accessibility standards: open and complete a subtask for any necessary accessibility improvements
  • Meet internationalization standards: open and complete a subtask to fix any i18n bugs
  • Complete testing: open and complete a subtask for any additional unit or functional tests that are needed

Event Timeline

Should this component be part of our core components list T313357? cc: @AnneT @egardner @Catrope @Volker_E

We need a TreeView for both Web ToC and Abstract Wikipedia projects as defined in the task description.

Should this component be part of our core components list T313357? cc: @AnneT @egardner @Catrope @Volker_E

We need a TreeView for both Web ToC and Abstract Wikipedia projects as defined in the task description.

@bmartinezcalvo That makes sense. I just noticed that the tree view element was listed in the spreadsheet that we originally used to classify components, but for some reason never made it to the list in that task. I think we should document it in that ticket. To me, this looks like a core/planned component too, but let's see what the rest of the DST think.

some relevant discussion here regarding the indentation, spacing, use of list-item indicators, etc.: T307316: [ToC] Enumeration of sections in the new ToC (numbers for ToC items)

egardner moved this task from Inbox to Needs Refinement on the Design-System-Team board.

I found a (potential?) existing use case for a tree view component, there's a tree-like UI under the Visual Editor to display Wikidata entities, pages transcluded, and categories.

CleanShot 2022-12-21 at 19.30.57.gif (352×800 px, 3 MB)

I see this component as applying a particular design style to a native HTML <details> element, which would explicitly support the nesting of additional expandable elements. This would be related to but distinct from the idea of an "accordion" or expander component.

Codex already has a couple of "Group" components – ButtonGroup, ToggleButtonGroup, etc. Maybe what we really need is:

  • Expander (aka details / accordion)
  • ExpanderGroup (aka tree-view)

(Actual names TBD). Potential usage:

<cdx-expander-group>
    <cdx-expander title="First item title">
        <cdx-expander title="Nested item">
        <!-- contents -->
        </cdx-expander>
    <cdx-expander title="Second Item Title">
        <!-- contents -->
    </cdx-expander>
</cdx-expander-group>

Both of these components could easily have CSS-only implementations if we rely on <details> under the hood.

I found a (potential?) existing use case for a tree view component, there's a tree-like UI under the Visual Editor to display Wikidata entities, pages transcluded, and categories.

CleanShot 2022-12-21 at 19.30.57.gif (352×800 px, 3 MB)

@AAlhazwani-WMF this use case would be an Accordion component instead T314569 (so I will add it in the task description).

ldelench_wmf renamed this task from [EPIC] Add TreeView component to Codex to Add TreeView component to Codex (MVP).Feb 17 2023, 11:06 PM
ldelench_wmf moved this task from Inbox to Proposed New Components on the Codex board.