Page MenuHomePhabricator

Improve VectorComponentButton.php and Button.mustache to be generic
Closed, ResolvedPublic5 Estimated Story Points

Description

Description

Currently we only use VectorComponentButton for one button because it is hardcoded to only work for certain button cases. Meanwhile we use Button.mustache for 6 cases. This task is for updating the PHP component and Button template to both be generic to be used for all buttons across Vector. This will also prepare us for using the new Codex CSS only buttons.

TODO

Update props according to Codex

  • Add action prop to account for progressive, destructive and default colors
  • Add weight prop to account for quiet, primary and default, replace 'is-quiet'
  • Add icon-only prop
  • Use Icon.mustache instead of html-vector-button-icon
  • Update data to use a consistent post fix -button. i.e. data-collapse-icon is renamed to data-collapse-button

QA

Inspect every button in the skin, including in the user menu, sticky header, language button, page toolbar, etc.

  • No visual changes, (especially note the progressively enhanced buttons like echo buttons and watchstar)
  • All buttons should have the 'mw-ui-button' class but not the 'mw-ui-icon' class

QA Results - Beta

ACStatusDetails
1T334881#8839042
2T334881#8839042

QA Results - Prod

ACStatusDetails
1T334881#8848462
2T334881#8848462

Event Timeline

ovasileva set the point value for this task to 5.Apr 20 2023, 5:37 PM

Change 911907 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Update VectorComponentButton to be able to handle all button designs/variants

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

Change 911908 had a related patch set uploaded (by Jdlrobson; author: Bernard Wang):

[mediawiki/skins/Vector@master] Update instances of Button.mustache to use to use VectorComponentButton

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

Jdlrobson updated Other Assignee, added: bwang.

Change 913979 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] Remove margin top from language button

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

Change 913979 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Remove margin top from language button

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

Change 911907 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Update VectorComponentButton to be able to handle all button designs/variants

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

Change 914027 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] User links menu is incorrect font size

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

Change 914027 merged by jenkins-bot:

[mediawiki/skins/Vector@master] [VISUAL CHANGE] User links menu is incorrect font size

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

Change 911908 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Update instances of Button.mustache to use to use VectorComponentButton

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

Change 914380 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Make limited width button consistent with button spec

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

Change 914380 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Make limited width button consistent with button spec

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

Change 914385 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Update no js collapsed TOC button consistent with spec

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

Change 914387 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Update user menu buttons to be consistent with spec

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

Change 914392 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Update watchstar button to be consistent with button spec

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

Change 914385 had a related patch set uploaded (by Jdlrobson; author: Bernard Wang):

[mediawiki/skins/Vector@master] Update no js collapsed TOC button consistent with spec

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

Change 914385 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Update no js collapsed TOC button consistent with spec

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

Change 914392 abandoned by Bernard Wang:

[mediawiki/skins/Vector@master] Update watchstar button to be consistent with button spec

Reason:

merging into previous patch in relation chain

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

Change 914875 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/core@master] Update watchstar hook to handle updated button markup

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

Change 914875 merged by jenkins-bot:

[mediawiki/core@master] Watchstar: Update watchstar hook to handle updated button markup

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

Edtadros subscribed.

@bwang please add some test steps.

Test Result - Beta

Status: ✅ Pass
Environment: beta
OS: macOS Ventura
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

Inspect every button in the skin, including in the user menu, sticky header, language button, page toolbar, etc.

✅ AC1: No visual changes, (especially note the progressively enhanced buttons like echo buttons and watchstar)
✅ AC2: All buttons should have the 'mw-ui-button' class but not the 'mw-ui-icon' class
@bwang, the only buttons I couldn't find an 'mw-ui-button' class for are the ones in the user menu (both logged in and out). Are these in or out of scope?
pass per T334881#8846351

Screenshot 2023-05-09 at 3.32.52 PM.png (1×1 px, 379 KB)

@Edtadros those are normal links inside menu items, so its out of scope!

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Ventura
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

Inspect every button in the skin, including in the user menu, sticky header, language button, page toolbar, etc.

✅ AC1: No visual changes, (especially note the progressively enhanced buttons like echo buttons and watchstar)
✅ AC2: All buttons should have the 'mw-ui-button' class but not the 'mw-ui-icon' class