Page MenuHomePhabricator

[WtC-M3] [QB] Replace WiKit Button component by Codex's
Open, Needs TriagePublic5 Estimated Story Points

Description

Problem

The Query Builder's user interface was composed using a combination of Vue 2 custom components and WiKit elements, such as Button. The WiKit design system is now on its deprecation path, as it has been superseded by Codex, the official Wikimedia design system. The utilization of WiKit components is not recommended, and they should be replaced in order to reduce maintenance costs and ensure consistency.

Solution

We have to replace the WiKit Button by the Codex equivalent: cdx-button (See demo). This will take us a step closer to switching to the new design system and deprecating the old.

Considerations

We'll need to apply a local solution to fix the alignment of icons and labels within buttons (e.g. Language selector trigger). Refer to the solution applied in Mismatch finder (See T346797)

Acceptance criteria
  • All WiKit Button types used in Query Builder are replaced by their Codex equivalent

Event Timeline

Sarai-WMDE renamed this task from [SW] [WtC-M3] [QB] Replace WiKit Button component by Codex's to [WtC-M3] [QB] Replace WiKit Button component by Codex's.Apr 10 2024, 12:06 PM
karapayneWMDE set the point value for this task to 5.Apr 16 2024, 8:25 AM

Change #1041104 had a related patch set uploaded (by Guergana Tzatchkova; author: Guergana Tzatchkova):

[wikidata/query-builder@master] Replace all instances of wikit button with cdx-button

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

Change #1041104 merged by jenkins-bot:

[wikidata/query-builder@master] Replace all instances of wikit button with cdx-button

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

Thanks for the changes! I'm assuming that the following issue is related to this patch (looking at https://1041104--clicky-sparqly.netlify.app/):

Screenshot 2024-06-20 at 18.08.36.png (378×429 px, 30 KB)

The icon within the information button that triggers the tooltip is not properly centered. If correcting the alignment proves to be too difficult, we could iterate on the design (e.g. adjust the paddings or the icon size if needed). Thanks again!

Change #1076765 had a related patch set uploaded (by Hasan Akgün (WMDE); author: Hasan Akgün (WMDE)):

[wikidata/query-builder@master] Fix tooltip alignment

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

Change #1076765 abandoned by Itamar Givon:

[wikidata/query-builder@master] Fix tooltip alignment

Reason:

As agreed. This is resolved by another change Ic5ecd9049ab85

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

Hey all, could someone provide me with a netlify link so that i can review the changes? the one that sarai linked a few comments up doesn't work anymore. thanks!

Hey all, I've noticed a couple of things here:

  1. The icon button (trash can) has a a hover behavior that is not consistent with the one of codex. On hover the background changes to a darker grey than currently in the QB and the icon color should remain the same (currently becomes slightly lighter). Active state should not have an outline.
  1. The hover colour for the primary progressive button (run query) is also not consistent with codex. it becomes a lighter shade of blue whereas it should become a darker shade of blue.
  1. Same for the normal progressive button (copy link to query). Please check the appropriate tokens for that button. For this button the active state is also not consistent. The background color should remain the same as in the hover state.
  1. Hover state for the normal neutral button (add condition) is incorrect. Background should become a darker grey, instead it currently turns white.

That's all regarding buttons from my side. Let me know if you need me to provide the exact tokens for the color changes, but I assume they're accessible from the codex docs?

Hey all, I've noticed a couple of things here:

  1. The icon button (trash can) has a a hover behavior that is not consistent with the one of codex. On hover the background changes to a darker grey than currently in the QB and the icon color should remain the same (currently becomes slightly lighter). Active state should not have an outline.
  1. The hover colour for the primary progressive button (run query) is also not consistent with codex. it becomes a lighter shade of blue whereas it should become a darker shade of blue.
  1. Same for the normal progressive button (copy link to query). Please check the appropriate tokens for that button. For this button the active state is also not consistent. The background color should remain the same as in the hover state.
  1. Hover state for the normal neutral button (add condition) is incorrect. Background should become a darker grey, instead it currently turns white.

That's all regarding buttons from my side. Let me know if you need me to provide the exact tokens for the color changes, but I assume they're accessible from the codex docs?

I have tried these and found out we don't have the latest version of Codex and that's the reason. To be able to have the latest version, we need to do some adjustments which I'm not sure we can right now. I will look into it and update here shortly.