Fix hardcoded 'transparent' values in test_moz_button.html
Categories
(Toolkit :: UI Widgets, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox140 | --- | fixed |
People
(Reporter: tgiles, Assigned: matthias_r, Mentored)
References
Details
(Keywords: good-first-bug, Whiteboard: [recomp] [lang=js])
Attachments
(1 file)
In test_moz_button.html, there are two instances of transparent that should be replaced with --button-background-color.
To help Mozilla out with this bug, here's the steps:
- Comment here on the bug that you want to volunteer to help.
- This will tell others that you're working on the next steps.
- Download and build the Firefox source code
- If you have any problems, please ask on Element/Matrix in the
#introductionchannel. They're there to help you get started. - You can also read the
Firefox Contributors' Quick Reference,
which has answers to most development questions.
- If you have any problems, please ask on Element/Matrix in the
- Start working on this bug. In test_moz_button.html, there are two instances of
transparentthat should be replaced with--button-background-color.- If you have any problems with this bug, please comment on this bug and set the needinfo flag for me.
- Also, you can find me and my teammates on the
#reusable-componentschannel on Element/Matrix most hours of most days.
- Build your change with
mach buildand test your change withmach test toolkit/content/tests/widgets/test_moz_button.html.- Also check your changes for adherence to our style guidelines by using
mach lint
- Also check your changes for adherence to our style guidelines by using
- Submit the patch (including an automated test, if applicable) for review. Mark me as a reviewer so I'll get an email to come look at your code.
- Getting your code reviewed
- This is when the bug will be assigned to you.
- After a series of reviews and changes to your patch, I'll push it to autoland.
- Your code will soon be shipping to Firefox users worldwide!
- ...now you get to think about what kind of bug you'd like to work on next.
- Let me know what you're interested in and I can help you find your next contribution.
Updated•1 year ago
|
| Assignee | ||
Comment 1•1 year ago
|
||
This is my first time contributing, I thought it would be an ideal task to introduce myself to Firefox development.
I successfully onboarded, and could apply the modification.
However, this causes the tests concerned to fail:
FAIL backgroundColor should be --button-background-color - got "rgba(0, 0, 0, 0)", expected "rgba(0, 0, 0, 0.07000000029802322)"
Should I investigate this, or is it outside the scope of this task?
| Reporter | ||
Comment 2•1 year ago
|
||
Hi Matthias, thanks for taking on this task! I'm going to go ahead and assign this to you as well, just for record-keeping.
You should continue to investigate this, but please submit your current work in progress so I can take a look at exactly what is going on with your patch and help you investigate the issue! You can submit your work in progress by:
- Committing your work,
git add .andgit commit -m "<replace with your commit message>" - Installing moz-phab, our tool for managing revisions and reviews, via this guide on how to submit a patch
- Submitting your patch using
moz-phab submit -s --wip
4. Using-swill only submit a single commit, as I'm assuming the change you made will be in one commit- Using
--wipwill allow you to submit a patch without notifying other potential reviewers and what not, as our system may automatically assign reviewers based on the modified files paths in our repository.
- Using
- Feel free to needinfo if you need help with the work in progress submission or to let me know that you've successfully submitted the patch so I can take a look at it.
As for my initial hunch to the issue, I think it's because I incorrectly assumed --button-background-color was the right design token for those transparent values. I believe the token we want to use is actually --button-background-color-ghost. I saw where the --button-background-color-ghost token gets reassigned to --button-background-color and it seems I made an false leap that we could just use that token, my mistake 😅
You can skim/read/skip this if you want, but I just wanted to explain how I got to that conclusion as a learning opportunity. First, I saw that the two buttons in question for this bug have type="icon ghost" or type="ghost icon". Next, I went to our Storybook instance (or you could run Storybook locally with ./mach storybook) and went to the "Button" folder under UI Widgets and specifically to the "Icon Ghost" story. There I inspected the <moz-button> element in the story and looked for the "background-color" CSS rule, which then led me to noticing ghost buttons use --button-background-color-ghost instead of --button-background-color.
| Assignee | ||
Comment 3•11 months ago
|
||
| Assignee | ||
Comment 4•11 months ago
|
||
Thank you for this instructive answer, I just discovered storybook! I successfully applied the correct token and submitted the patch, which is waiting for your review.
| Reporter | ||
Comment 5•11 months ago
|
||
Thanks for the update! The patch looks good to me, but I can't approve it until you take the patch out of the Draft state. You can do this by navigating to the bottom of the page on your Phabricator revision and search for the "Add Action" dropdown. In this dropdown there should be an option called "Request Review" or something similar. Go ahead and do that and we can keep this moving!
| Assignee | ||
Comment 6•11 months ago
|
||
My bad, it should be ready for review now!
Updated•11 months ago
|
Comment 8•11 months ago
|
||
| bugherder | ||
Updated•11 months ago
|
Description
•