Page MenuHomePhabricator

docs: Implement the new "copy token" icon button
Open, LowPublic

Description

Overview

The design tokens on the docs site is being redesigned. The tables are getting restyled and restructured as a part of T373200. Part of the redesign involves changing the "copy" button to an icon-only button and displaying only when hovering over the cell for the token to copy.

Example

Screenshot 2024-09-10 at 15.10.25.png (716×928 px, 52 KB)

Acceptance criteria

  • The copy button in token tables is updated to use an icon-only button and appears only on hover with a tooltip that reads "Copy token"

Event Timeline

CCiufo-WMF renamed this task from docs: Implement the "hover" state for the copy token icon to docs: Implement the new "copy token" icon button.Sep 18 2024, 5:04 PM

Thank you for tagging this task with good first task for Wikimedia newcomers!

Newcomers often may not be aware of things that may seem obvious to seasoned contributors, so please take a moment to reflect on how this task might look to somebody who has never contributed to Wikimedia projects.

A good first task is a self-contained, non-controversial task with a clear approach. It should be well-described with pointers to help a completely new contributor, for example it should clearly pointed to the codebase URL and provide clear steps to help a contributor get setup for success. We've included some guidelines at https://phabricator.wikimedia.org/tag/good_first_task/ !

Thank you for helping us drive new contributions to our projects <3

Hey I would like to work on this but not sure where repo and where things is? I'm confused, like I was doing open source contribution on github but i'm not sure things works on phabricator? please help!

@Catrope would you mind helping or finding someone to help @3MindedScholar get set up to be able to do this task?

Hey @3MindedScholar take a look at this page, https://doc.wikimedia.org/codex/latest/contributing/development-basics.html, to clone down the Gerrit repo and go through the Gerrit tutorial. We use Phabricator to keep track of bugs/issues (similar to GitHub "issues").

Additionally, the first section of https://doc.wikimedia.org/codex/latest/contributing/developing-components.html is useful for learning how to get the demos running locally.

Change #1179735 had a related patch set uploaded (by 3MindedScholar; author: 3MindedScholar):

[design/codex@main] docs: Implement the new 'copy token' icon button (T374486)

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

@DTorsani-WMF @Catrope @lwatson @Aklapper Hey guys I have added copy token button please review it.

ChangeId - I3306d38999b25dee6076c5bc11dabc89f1503b4e

@3MindedScholar Congrats! But please don't duplicate review requests and avoid pinging random folks like me. The automated comment by @gerritbot, right above yours in this task, is already a review request and we all already get too much notifications. Thanks for your understanding! :)

@Aklapper sorry didn't know you were a random person, I thought you are on design team sorry again.... next time I'll keep this in mind!

lwatson added a subscriber: Volker_E.

@Volker_E thanks for reviewing the patch! I'll move this task to the "Code Review" column.

Change #1179735 had a related patch set uploaded (by Aklapper; author: 3MindedScholar):

[design/codex@main] docs: Fix linting error and shift back to original coding style

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

Change #1179735 abandoned by 3MindedScholar:

[design/codex@main] docs: Shifted back to original coding style

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

DTorsani-WMF moved this task from Code Review to Ready for Design/Dev on the Codex board.
DTorsani-WMF removed a project: Patch-For-Review.

@DTorsani-WMF I’ve implemented the requested fix.

Current Behavior / UI:
I was considering the UI state when the user clicks the copy icon. Since this behavior wasn’t specified in the design or acceptance criteria, here’s how it currently looks:

Screenshot 2025-09-16 at 10.35.27 AM.png (1×2 px, 409 KB)
Screenshot 2025-09-16 at 10.38.11 AM.png (1×2 px, 407 KB)
Screenshot 2025-09-16 at 10.38.34 AM.png (1×2 px, 484 KB)

Questions / Clarifications:

  • The previous implementation showed the cdxIconCheck on successful copy. Should I incorporate this into the new fix as well?
  • Since we’re making the button icon-only, should the button text be removed entirely, or should it remain optional?

Please let me know if this is acceptable or if any adjustments are needed.

Hi @Formasit-chijoh thanks for picking this up. do you have a patch to share? Your screenshots look good, except I'm a little confused by the last one. We will want to do code review once you are ready.

Change #1188893 had a related patch set uploaded (by Formasit-chijoh; author: Formasit-chijoh):

[design/codex@main] Implement the new "copy token" icon button Change the "copy" button to an icon-only button Display the button only on hovering on a cell to copy Pass appropriate text for design tokens and components

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

@DTorsani-WMF I pushed a patched, I think I have a merge conflict but I made sure my branch was up to date before I pushed

Change #1179735 restored by 3MindedScholar:

[design/codex@main] docs: Shifted back to original coding style

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

Change #1179735 abandoned by 3MindedScholar:

[design/codex@main] docs: Shifted back to original coding style

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

Thanks for the contribution @Formasit-chijoh! I just saw the ping by @Catrope on the patch for revisiting this.
Just a user-experience question for all contributors here:

image.png (622×1 px, 66 KB)

I don't find that this current outcome easier to navigate. At minimum I'd advise a icon + label button on the components demo level. Or revise the icon-only approach differently.