adobe / spectrum-web-components

Spectrum Web Components
https://opensource.adobe.com/spectrum-web-components/
Apache License 2.0
1.21k stars 192 forks source link

fix(progress-bar): removed duplicate label #4494

Open nikkimk opened 1 month ago

nikkimk commented 1 month ago

Description

Removes duplicate label from progress bar.

Related issue(s)

How has this been tested?

Types of changes

Checklist

github-actions[bot] commented 1 month ago

Branch preview

Visual regression test results When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs: - [High Contrast Mode | Medium | LTR](https://a511fc6462fc989da41ff9a931162478--spectrum-web-components.netlify.app/review/) - [Spectrum | Lightest | Medium | LTR](https://66a22494bc02101f7f5923381c932ba4--spectrum-web-components.netlify.app/review/) - [Spectrum | Lightest | Medium | RTL](https://2e1422785eefe9a01e2fc8e884102916--spectrum-web-components.netlify.app/review/) - [Spectrum | Lightest | Large | LTR](https://2f2fb6b4a18cfea9c04c1f031d9ead88--spectrum-web-components.netlify.app/review/) - [Spectrum | Lightest | Large | RTL](https://390e4f76158703f3460dc656c6cb10bd--spectrum-web-components.netlify.app/review/) - [Spectrum | Light | Medium | LTR](https://538fbefc97f5b045d8a06cdefce32fd9--spectrum-web-components.netlify.app/review/) - [Spectrum | Light | Medium | RTL](https://0d7255c755f05b370e1ac1ddd7906050--spectrum-web-components.netlify.app/review/) - [Spectrum | Light | Large | LTR](https://396a54794a9709ee44121d26b361799c--spectrum-web-components.netlify.app/review/) - [Spectrum | Light | Large | RTL](https://696f7231ec2af2962650dc866a57ab36--spectrum-web-components.netlify.app/review/) - [Spectrum | Dark | Medium | LTR](https://7bab0f9c983bce5b8728c947b09c7bad--spectrum-web-components.netlify.app/review/) - [Spectrum | Dark | Medium | RTL](https://2477cc98d27e69cbd5e44114891ca1d1--spectrum-web-components.netlify.app/review/) - [Spectrum | Dark | Large | LTR](https://c2c4f2ff8adb197e37d046bbc09d8a0a--spectrum-web-components.netlify.app/review/) - [Spectrum | Dark | Large | RTL](https://b584d9e13eb95ee19c8a5f0bb4d8eef7--spectrum-web-components.netlify.app/review/) - [Spectrum | Darkest | Medium | LTR](https://5a6b29d8d035f27e9389873cc967e462--spectrum-web-components.netlify.app/review/) - [Spectrum | Darkest | Medium | RTL](https://d34b649b2c38b7ef49709e081e777b56--spectrum-web-components.netlify.app/review/) - [Spectrum | Darkest | Large | LTR](https://2aa8c3d0ff47b4d29a4a960bc278144a--spectrum-web-components.netlify.app/review/) - [Spectrum | Darkest | Large | RTL](https://defa266aa1d1aeb4fdfc3a00c6efc9c3--spectrum-web-components.netlify.app/review/) - [Express | Lightest | Medium | LTR](https://92e7c2828b9ad564df798d0bf70c81d3--spectrum-web-components.netlify.app/review/) - [Express | Lightest | Medium | RTL](https://5db43f0da48d58099c0c5146936336a7--spectrum-web-components.netlify.app/review/) - [Express | Lightest | Large | LTR](https://e8e0bbd3ba81b7a5ed7943d371fe2cda--spectrum-web-components.netlify.app/review/) - [Express | Lightest | Large | RTL](https://e20af402785692f8057fc3dc82d48dd9--spectrum-web-components.netlify.app/review/) - [Express | Light | Medium | LTR](https://4d383ca0115c508a4d05b9fb001bfd4d--spectrum-web-components.netlify.app/review/) - [Express | Light | Medium | RTL](https://65e596c381bed3f96884ff711de61b1f--spectrum-web-components.netlify.app/review/) - [Express | Light | Large | LTR](https://9c4b42e1fe85a0f1156a817327bacc8e--spectrum-web-components.netlify.app/review/) - [Express | Light | Large | RTL](https://d0dd6e932b7b430c6e9b754db67951a3--spectrum-web-components.netlify.app/review/) - [Express | Dark | Medium | LTR](https://c3b9470088d753cb09d3c22088a0350d--spectrum-web-components.netlify.app/review/) - [Express | Dark | Medium | RTL](https://a9ebc9eb8e584842cbed8b3a99b8092c--spectrum-web-components.netlify.app/review/) - [Express | Dark | Large | LTR](https://f9cf9e05301258de9e1448742ab79be2--spectrum-web-components.netlify.app/review/) - [Express | Dark | Large | RTL](https://5bff2d3b4c9df9d847e709047342146b--spectrum-web-components.netlify.app/review/) - [Express | Darkest | Medium | LTR](https://78904cbeb599c8f97ffa906f03df77c7--spectrum-web-components.netlify.app/review/) - [Express | Darkest | Medium | RTL](https://d8604cbc6086c6a6a5922779908bc9c6--spectrum-web-components.netlify.app/review/) - [Express | Darkest | Large | LTR](https://67a9740ec4489155e735bb0a87f8369c--spectrum-web-components.netlify.app/review/) - [Express | Darkest | Large | RTL](https://66537ba817732ef2c07f2f85fea06ebc--spectrum-web-components.netlify.app/review/) - [Spectrum-two | Light | Medium | LTR](https://2237f2bfcf45ecf1c420cf5234d9052a--spectrum-web-components.netlify.app/review/) - [Spectrum-two | Light | Medium | RTL](https://1efeed10705f8e513f9616a3d6d3c21d--spectrum-web-components.netlify.app/review/) - [Spectrum-two | Light | Large | LTR](https://381cb659364afa1776e84f8a38aa48e2--spectrum-web-components.netlify.app/review/) - [Spectrum-two | Light | Large | RTL](https://88d3e66f5b55de9cd3a4f399c7ccc87f--spectrum-web-components.netlify.app/review/) - [Spectrum-two | Dark | Medium | LTR](https://cfc85d6faf0e0c2c96f5977fab2fa32c--spectrum-web-components.netlify.app/review/) - [Spectrum-two | Dark | Medium | RTL](https://0ada8810c14a4a96373c49b828cd205c--spectrum-web-components.netlify.app/review/) - [Spectrum-two | Dark | Large | LTR](https://6346cc9a7362860fa58a12643eda8ed6--spectrum-web-components.netlify.app/review/) - [Spectrum-two | Dark | Large | RTL](https://54c21c7b84e0769d8b396e66defc03c7--spectrum-web-components.netlify.app/review/)
github-actions[bot] commented 1 month ago

Lighthouse scores

Category Latest (report) Main (report) Branch (report)
Performance 0.99 0.99 0.94
Accessibility 1 1 1
Best Practices 1 1 1
SEO 1 0.92 0.92
PWA 1 1 1
What is this? [Lighthouse](https://github.com/GoogleChrome/lighthouse) scores comparing the documentation site built from the PR ("Branch") to that of the production documentation site ("Latest") and the build currently on main ("Main"). Higher scores are better, but *note that the SEO scores on Netlify URLs are artifically constrained to 0.92.*

Transfer Size

Category Latest Main Branch
Total 221.238 kB 210.968 kB 210.773 kB 🏆
Scripts 53.413 kB 48.609 kB 48.458 kB 🏆
Stylesheet 34.827 kB 30.416 kB 30.381 kB 🏆
Document 6.027 kB 5.321 kB 5.32 kB 🏆
Font 126.971 kB 126.622 kB 126.614 kB 🏆

Request Count

Category Latest Main Branch
Total 45 45 45
Scripts 37 37 37
Stylesheet 5 5 5
Document 1 1 1
Font 2 2 2
github-actions[bot] commented 1 month ago

Tachometer results

Chrome ## progress-bar [_permalink_](#user-content-progress-bar) ### basic-test | Version | Bytes | Avg Time | vs remote | vs branch | |---|---|---|---|---| | npm latest | 407 kB | 29.26ms - 30.54ms | - | slower ❌
1% - 7%
0.40ms - 2.00ms | | branch | 395 kB | 28.21ms - 29.19ms | faster ✔
1% - 7%
0.40ms - 2.00ms | - |
Firefox ## progress-bar [_permalink_](#user-content-progress-bar) ### basic-test | Version | Bytes | Avg Time | vs remote | vs branch | |---|---|---|---|---| | npm latest | 407 kB | 61.74ms - 65.34ms | - | slower ❌
0% - 9%
0.26ms - 5.18ms | | branch | 395 kB | 59.14ms - 62.50ms | faster ✔
0% - 8%
0.26ms - 5.18ms | - |
Rajdeepc commented 1 month ago

@nikkimk Can you catch up to main and add some documentation on this?

blunteshwar commented 1 month ago

Can we add a relevant test for this

blunteshwar commented 1 month ago

I have added a couple of tests and updated the logic as well

nikkimk commented 1 month ago

Think about how this will render <sp-progress-bar label="Loading" indeterminate>abcdefgh</sp-progress-bar>

@Rajdeepc What is the desired behavior for this use case?

blunteshwar commented 1 month ago

Think about how this will render <sp-progress-bar label="Loading" indeterminate>content</sp-progress-bar>

@Rajdeepc What is the desired behavior for this use case?

In this case <sp-progress-bar label="Loading" indeterminate>abcdefgh</sp-progress-bar> when both label is present and content are present then, both of them will exist inside slot sp-field-label which is logically not so correct. Either of them should be present in sp-filed-label. There shouldn't be a scenario when both label and slot content are present inside slot

nikkimk commented 1 month ago

Think about how this will render <sp-progress-bar label="Loading" indeterminate>content</sp-progress-bar>

@Rajdeepc What is the desired behavior for this use case?

In this case <sp-progress-bar label="Loading" indeterminate>abcdefgh</sp-progress-bar> when both label is present and content are present then, both of them will exist inside slot sp-field-label which is logically not so correct. Either of them should be present in sp-filed-label. There shouldn't be a scenario when both label and slot content are present inside slot

So when both are present, is the attribute the only one that should exist?

blunteshwar commented 1 month ago

Think about how this will render <sp-progress-bar label="Loading" indeterminate>content</sp-progress-bar>

@Rajdeepc What is the desired behavior for this use case?

In this case <sp-progress-bar label="Loading" indeterminate>abcdefgh</sp-progress-bar> when both label is present and content are present then, both of them will exist inside slot sp-field-label which is logically not so correct. Either of them should be present in sp-filed-label. There shouldn't be a scenario when both label and slot content are present inside slot

So when both are present, is the attribute the only one that should exist?

When both are present only the content should exist which in the above example is 'abcdefgh'.

nikkimk commented 1 month ago

When both are present only the content should exist which in the above example is 'abcdefgh'.

@Rajdeepc To make sure I'm understanding, is the following correct?

If label attribute is and default slot is then what appears visually should be and the aria-label should be
empty content content content
abcdefgh empty abcdefgh abcdefgh
abcdefgh content content abcdefgh
empty empty empty empty
blunteshwar commented 1 month ago

abcdefgh

In the third row when both label="abcdefgh" and content are present, then what appears visually should becontent

nikkimk commented 4 weeks ago

@blunteshwar

abcdefgh

In the third row when both label="abcdefgh" and content are present, then what appears visually should becontent

What about the aria-label? Ideally sighted screenreader users should hear and see the same content?

blunteshwar commented 3 weeks ago

@blunteshwar

abcdefgh

In the third row when both label="abcdefgh" and content are present, then what appears visually should becontent

What about the aria-label? Ideally sighted screenreader users should hear and see the same content?

Indeed I think we have to make sure that when content is present then, aria-label =content.

nikkimk commented 1 week ago

Making sure I capture that part of our discussion revolved around this previous issue: https://github.com/adobe/spectrum-web-components/issues/3146 and whether or not this is how progress bar should work.

Rajdeepc commented 1 week ago

Making sure I capture that part of our discussion revolved around this previous issue: #3146 and whether or not this is how progress bar should work.

I think since this is a part of a longer discussion chain, how do we feel we fix the related bug of duplicate label and take this in a follow up work?