Page MenuHomePhabricator

docs: Use a quiet toggle button for "Show code" in component demos
Open, LowPublic

Assigned To
None
Authored By
Volker_E
Nov 5 2022, 4:03 AM
Referenced Files
F58111847: image.png
Jan 3 2025, 3:36 PM
F35885887: Captura de Pantalla 2022-12-21 a las 17.12.04.png
Dec 21 2022, 4:12 PM
F35862479: Captura de Pantalla 2022-12-14 a las 11.31.04.png
Dec 14 2022, 8:05 PM
F35862477: Captura de Pantalla 2022-12-14 a las 11.27.16.png
Dec 14 2022, 8:05 PM
F35707948: image.png
Nov 5 2022, 4:24 AM
Restricted File
Nov 5 2022, 4:03 AM

Description

Background

I'd like to add a pain point from my understanding:
Currently the "Show code" button is a neutral button and it's not visually appropriate in the demo boxes. For example in the Button demo where both neutral buttons are one on top of the other. The button is too prominent in comparison to the component demoed

Captura de Pantalla 2022-12-14 a las 11.27.16.png (624×1 px, 230 KB)

Proposal

Use a quiet ToggleButton for "Show code" button in the Codex demos.

Captura de Pantalla 2022-12-14 a las 11.31.04.png (954×1 px, 558 KB)

Open questions:

  • Add 'code' icon?
  • Use progressive, which we don't support that for ToggleButtons yet? That would prioritize it over “Reset“. And align with “Copy code”

Acceptance criteria (or Done)

  • Use a quiet toggle button for "Show code" button

Details

Related Changes in Gerrit:

Event Timeline

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

[design/codex@main] docs: Use quiet ToggleButton quiet in Code demo

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

Change 853464 abandoned by VolkerE:

[design/codex@main] docs: Use quiet ToggleButton quiet in Code demo

Reason:

Abandoning for now until we've got progressive ToggleButtons

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

Volker_E renamed this task from docs: De-emphasize the toggle code button in component demos to docs: Use a quiet toggle button for "Show code" in component demos.Dec 14 2022, 8:05 PM
Volker_E updated the task description. (Show Details)

I don't know this is still under consideration, but personally I find the current (outlined) button more findable / legible in this context.

Also, I think that this part of our docs site is good enough for now and would be ok with just leaving things as they are until we re-vamp the site more broadly based on T324228: [EPIC] Codex as the Design System for Wikimedia.

If others agree with me, feel free to close this task.

I don't know this is still under consideration, but personally I find the current (outlined) button more findable / legible in this context.

@egardner the problem with the current Normal "Show code" button is that it competes with the component that the demo displays, specially in the Button component demo.

Captura de Pantalla 2022-12-21 a las 17.12.04.png (1×2 px, 2 MB)

During the docs simplification work in T379299, @AnneT and I discussed this again. The "Show code" action is actually a ToggleButton. We determined that the quiet ToggleButton would not work as well here since it is too subtle, so we decided to leave this as-is. Do @Volker_E and @bmartinezcalvo agree, and therefore can we close this task?

During the docs simplification work in T379299, @AnneT and I discussed this again. The "Show code" action is actually a ToggleButton. We determined that the quiet ToggleButton would not work as well here since it is too subtle, so we decided to leave this as-is. Do @Volker_E and @bmartinezcalvo agree, and therefore can we close this task?

@DTorsani-WMF why do we need the "Show code" to be more prominent when it's toggled on? I think the important part when checking a demo is the component itself, so I would not make the rest of elements to be so prominent to avoid distracting the user from the component's review.

I think it's worth exploring how to improve the demo visualization to fix/improve this and other elements in these demos:

  1. The style of the "Show code" button could be less prominent. In case we want to make these actions more prominent, we could use a muted line on top of the footer with buttons in the demo.
  2. The ToggleButton guidelines recommend using the same text and icon in both off and on states. So we should label the button "Show code" in both toggled off and toggled on states.
  3. We are currently using 3 styles of buttons in the demos (normal neutral ToggleButton for "Show code", quiet neutral Button for "Reset", and quiet progressive Button for "Copy code"). We could simplify them by using a quiet neutral Button or ToggleButton in all them.

image.png (2×3 px, 240 KB)

Anyway, we could explore these and other improvements as part of T357703: Redesign the Configurable demo.

I like these ideas, thanks! I've added this task as a subtask of T357703.