Skip to content

Conversation

@razvancir96
Copy link
Contributor

@razvancir96 razvancir96 commented Apr 12, 2023

Description

We need to add a loading spinner inside the picker's button.
Spectrum CSS

Related issue(s)

Motivation and context

In one of Adobe's projects, we need to support the loading spinner inside the picker's button.

How has this been tested?

Screenshots (if appropriate)

Size S:
Screenshot 2024-02-27 at 17 43 21

Size M:
Screenshot 2024-02-27 at 17 43 29

Size L:
Screenshot 2024-02-27 at 17 43 35

Size XL:
Screenshot 2024-02-27 at 17 43 41

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)

Checklist

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • If my change required a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices

Best practices

This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against main.

@razvancir96 razvancir96 self-assigned this Apr 12, 2023
@razvancir96 razvancir96 requested a review from Westbrook April 12, 2023 15:37
@github-actions
Copy link
Contributor

github-actions bot commented Apr 12, 2023

@razvancir96
Copy link
Contributor Author

@Westbrook I opened a new PR, directly from the main repo (not fork). Checked your review from the previous PR, and from what I see, there are 2 things left:

  • Testing that the loading state also makes the picker disabled (forgot to do it, will do it soon)
  • Verifying with pfulton (I'll let you tag if you consider necessary) about some variations

@github-actions
Copy link
Contributor

github-actions bot commented Apr 12, 2023

Tachometer results

Chrome

action-bar permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 483 kB 69.96ms - 72.99ms - unsure 🔍
-4% - +3%
-3.06ms - +2.17ms
branch 474 kB 69.78ms - 74.05ms unsure 🔍
-3% - +4%
-2.17ms - +3.06ms
-

action-menu permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 644 kB 166.46ms - 169.76ms - unsure 🔍
-1% - +2%
-2.19ms - +2.67ms
branch 636 kB 166.09ms - 169.66ms unsure 🔍
-2% - +1%
-2.67ms - +2.19ms
-

combobox permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 704 kB 36.82ms - 37.20ms - unsure 🔍
-1% - +1%
-0.53ms - +0.33ms
branch 696 kB 36.73ms - 37.49ms unsure 🔍
-1% - +1%
-0.33ms - +0.53ms
-

light-dom-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 705 kB 390.88ms - 397.90ms - unsure 🔍
-1% - +1%
-4.17ms - +5.21ms
branch 696 kB 390.75ms - 396.98ms unsure 🔍
-1% - +1%
-5.21ms - +4.17ms
-

menu permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 473 kB 207.59ms - 212.38ms - unsure 🔍
-3% - +0%
-6.06ms - +0.86ms
branch 465 kB 210.08ms - 215.09ms unsure 🔍
-0% - +3%
-0.86ms - +6.06ms
-

overlay permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 672 kB 458.91ms - 464.78ms - unsure 🔍
-1% - +1%
-5.65ms - +2.66ms
branch 685 kB 460.40ms - 466.28ms unsure 🔍
-1% - +1%
-2.66ms - +5.65ms
-

directive-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 788 kB 35.90ms - 36.46ms - unsure 🔍
-1% - +1%
-0.39ms - +0.38ms
branch 757 kB 35.92ms - 36.45ms unsure 🔍
-1% - +1%
-0.38ms - +0.39ms
-

element-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 756 kB 344.97ms - 349.26ms - unsure 🔍
-1% - +1%
-3.87ms - +2.40ms
branch 748 kB 345.56ms - 350.14ms unsure 🔍
-1% - +1%
-2.40ms - +3.87ms
-

lazy-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 757 kB 52.18ms - 53.38ms - unsure 🔍
-2% - +1%
-1.19ms - +0.64ms
branch 749 kB 52.37ms - 53.75ms unsure 🔍
-1% - +2%
-0.64ms - +1.19ms
-

picker permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 510 kB 563.77ms - 572.00ms - unsure 🔍
-1% - +1%
-5.52ms - +7.19ms
branch 502 kB 562.21ms - 571.89ms unsure 🔍
-1% - +1%
-7.19ms - +5.52ms
-

popover permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 382 kB 21.25ms - 21.56ms - unsure 🔍
-0% - +1%
-0.06ms - +0.27ms
branch 373 kB 21.24ms - 21.37ms unsure 🔍
-1% - +0%
-0.27ms - +0.06ms
-

split-button permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 717 kB 1866.34ms - 1869.14ms - unsure 🔍
-0% - +0%
-1.82ms - +2.36ms
branch 710 kB 1865.92ms - 1869.02ms unsure 🔍
-0% - +0%
-2.36ms - +1.82ms
-

tooltip permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 650 kB 61.19ms - 62.31ms - unsure 🔍
-1% - +2%
-0.69ms - +1.21ms
branch 642 kB 60.72ms - 62.26ms unsure 🔍
-2% - +1%
-1.21ms - +0.69ms
-

test-directive permalink

Version Bytes Avg Time vs remote vs branch
npm latest 630 kB 34.66ms - 35.21ms - unsure 🔍
-1% - +1%
-0.41ms - +0.40ms
branch 622 kB 34.64ms - 35.23ms unsure 🔍
-1% - +1%
-0.40ms - +0.41ms
-
Firefox

action-bar permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 483 kB 143.16ms - 150.80ms - unsure 🔍
-4% - +3%
-6.24ms - +4.60ms
branch 474 kB 143.95ms - 151.65ms unsure 🔍
-3% - +4%
-4.60ms - +6.24ms
-

action-menu permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 644 kB 315.95ms - 345.09ms - unsure 🔍
-4% - +6%
-14.44ms - +20.40ms
branch 636 kB 317.99ms - 337.09ms unsure 🔍
-6% - +4%
-20.40ms - +14.44ms
-

combobox permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 704 kB 67.24ms - 73.40ms - slower ❌
9% - 20%
5.75ms - 12.29ms
branch 696 kB 60.23ms - 62.37ms faster ✔
9% - 17%
5.75ms - 12.29ms
-

light-dom-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 705 kB 711.61ms - 733.11ms - slower ❌
4% - 7%
24.78ms - 49.74ms
branch 696 kB 678.76ms - 691.44ms faster ✔
3% - 7%
24.78ms - 49.74ms
-

menu permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 473 kB 431.23ms - 446.37ms - unsure 🔍
-1% - +3%
-5.21ms - +13.45ms
branch 465 kB 429.22ms - 440.14ms unsure 🔍
-3% - +1%
-13.45ms - +5.21ms
-

overlay permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 763 kB 714.22ms - 813.26ms - unsure 🔍
-2% - +15%
-11.25ms - +105.33ms
branch 755 kB 685.96ms - 747.44ms unsure 🔍
-13% - +1%
-105.33ms - +11.25ms
-

directive-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 765 kB 72.58ms - 78.70ms - unsure 🔍
-10% - +3%
-7.82ms - +2.78ms
branch 757 kB 73.83ms - 82.49ms unsure 🔍
-4% - +10%
-2.78ms - +7.82ms
-

element-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 756 kB 635.21ms - 724.59ms - unsure 🔍
-0% - +18%
+1.25ms - +112.51ms
branch 748 kB 589.90ms - 656.14ms faster ✔
1% - 16%
1.25ms - 112.51ms
-

lazy-test permalink

Version Bytes Avg Time vs remote vs branch
npm latest 757 kB 116.58ms - 124.66ms - slower ❌
2% - 14%
2.25ms - 15.19ms
branch 749 kB 106.85ms - 116.95ms faster ✔
2% - 12%
2.25ms - 15.19ms
-

picker permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 510 kB 994.72ms - 1015.52ms - unsure 🔍
-0% - +2%
-4.64ms - +17.84ms
branch 502 kB 994.24ms - 1002.80ms unsure 🔍
-2% - +0%
-17.84ms - +4.64ms
-

popover permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 382 kB 44.87ms - 51.01ms - unsure 🔍
-10% - +8%
-4.89ms - +3.73ms
branch 373 kB 45.50ms - 51.54ms unsure 🔍
-8% - +10%
-3.73ms - +4.89ms
-

split-button permalink

basic-test

Version Bytes Avg Time vs remote vs branch
npm latest 717 kB 1637.73ms - 1649.15ms - unsure 🔍
-0% - +1%
-4.24ms - +11.40ms
branch 710 kB 1634.51ms - 1645.21ms unsure 🔍
-1% - +0%
-11.40ms - +4.24ms
-

tooltip permalink

test-basic

Version Bytes Avg Time vs remote vs branch
npm latest 650 kB 208.54ms - 215.14ms - unsure 🔍
-0% - +4%
-0.41ms - +9.09ms
branch 642 kB 204.08ms - 210.92ms unsure 🔍
-4% - +0%
-9.09ms - +0.41ms
-

test-directive permalink

Version Bytes Avg Time vs remote vs branch
npm latest 630 kB 71.95ms - 74.09ms - faster ✔
17% - 23%
14.68ms - 21.08ms
branch 622 kB 87.89ms - 93.91ms slower ❌
20% - 29%
14.68ms - 21.08ms
-

Copy link
Contributor

@Westbrook Westbrook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start. Mainly want to make sure we're shoring up the accessibility tree that this delivers and clarifying how we're preventing interaction. @jnurthen if you have any suggestions beyond what's here, would love your insight.

--spectrum-picker-width: var(--spectrum-global-dimension-size-2400);
}

:host([loading]) sp-progress-circle {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pfulton does this make sense? Is it something that we could maybe get added to the Spectrum CSS source for the future?

? html`
<sp-progress-circle
indeterminate
aria-labelledby="label"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aria-hidden below cancels this out, so we can exclude this line.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sp-progress-circle throws a11y warnings if label is not provided, even when aria-hidden is present. Should we add a check for aria-hidden in this case too?

@Westbrook Westbrook marked this pull request as draft June 21, 2023 02:04
Copy link
Contributor

@Westbrook Westbrook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@razvancir96 could you sync up with @TarunAdobe about normalizing this with the work in #3163 so we could maybe get this over the line?

@Rocss
Copy link
Contributor

Rocss commented Feb 13, 2024

After a discussion with @razvancir96 we agreed that our team will take over this PR from next week.
@Westbrook are there any concerns about this functionality besides the code review on this PR?

@Westbrook
Copy link
Contributor

@Rocss please sync up with @TarunAdobe about normalizing this PR and the API applied to the Picker herein with the work done in #3163.

@Rocss Rocss assigned Rocss and unassigned razvancir96 Feb 15, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Feb 19, 2024

Lighthouse scores

Category Latest (report) Main (report) Branch (report)
Performance 0.97 0.97 0.98
Accessibility 1 1 1
Best Practices 1 1 1
SEO 1 0.92 0.92
PWA 1 1 1
What is this?

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 241.283 kB 228.748 kB 228.466 kB 🏆
Scripts 60.143 kB 54.572 kB 54.51 kB 🏆
Stylesheet 48.607 kB 42.298 kB 42.082 kB 🏆
Document 5.821 kB 5.166 kB 5.162 kB 🏆
Third Party 126.712 kB 126.712 kB 126.712 kB

Request Count

Category Latest Main Branch
Total 43 43 43
Scripts 35 35 35
Stylesheet 5 5 5
Document 1 1 1
Third Party 2 2 2

@Rocss
Copy link
Contributor

Rocss commented Feb 19, 2024

Given that the progress spinner is spinning inside the picker, VRT will fail because of different states of the spinner. Was there anything similar being done in the repo so far?

@Rocss Rocss marked this pull request as ready for review February 19, 2024 14:08
@Westbrook
Copy link
Contributor

For stability in the VRTs, checkout #4055. It should "just work ™️", 🤞🏼, after that PR lands.

type StoryArgs = {
onChange: (val: string) => void;
invalid: boolean;
pending: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TarunAdobe we broken Button into a while list of sized stories, particularly due to the custom sizing of the Progress Circle. Have you found value in that? Should we do it here, too?

@Rocss
Copy link
Contributor

Rocss commented Mar 7, 2024

I have no more things to add to this PR. Happy to implement any other feedback if there is.
cc: @Westbrook @TarunAdobe

@TarunAdobe
Copy link
Contributor

Hey @Rocss I just have a final comment before we can land this... we'd want to split up the Picker into a list of sized stories so that we can track down how the pending progress-circle looks in different sizes just like we do in button.

type=${ifDefined(type)}
>
<sp-button variant="primary" slot="trigger">Show Popover</sp-button>
<sp-popover
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pre-commit hook automatically does this, it's not me!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if there's a loose config somewhere. Not germain to this PR, indeed.

Copy link
Contributor

@TarunAdobe TarunAdobe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Tagging @Westbrook for one final pass before we land this.

@TarunAdobe TarunAdobe requested a review from Westbrook March 12, 2024 09:43
@Westbrook Westbrook changed the title feat(picker): add loading state to the picker fix(picker): add loading state to the picker Mar 12, 2024
Copy link
Contributor

@Westbrook Westbrook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adopting this lost child of a PR and giving it a good home! :shipit:

type=${ifDefined(type)}
>
<sp-button variant="primary" slot="trigger">Show Popover</sp-button>
<sp-popover
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if there's a loose config somewhere. Not germain to this PR, indeed.

@Westbrook Westbrook merged commit d91e2c9 into main Mar 12, 2024
@Westbrook Westbrook deleted the razvancir96/add-picker-loading-state branch March 12, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants