Skip to content

Conversation

@razvancir96
Copy link
Contributor

Description

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

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 2023-04-06 at 18 11 22

Size M:
Screenshot 2023-04-06 at 18 11 37

Size L:
Screenshot 2023-04-06 at 18 11 50

Size XL:
Screenshot 2023-04-06 at 18 12 01

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.

--spectrum-progress-circle-thickness: var(
--spectrum-progress-circle-thickness-small
);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I pick some other variables? Or make my own ones? More context: the picker has 4 dimensions: s/m/l/xl and the loading spinner has 3 dimensions: s/m/l, and do not match together. So I had to adapt its dimensions. Also, should we validate with design those dimensions?

Copy link
Contributor

Choose a reason for hiding this comment

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

@pfulton is there any token support for these variation?

Copy link
Contributor

Choose a reason for hiding this comment

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

From a selector standpoint, we can use :host([size="s"]) sp-progress-circle instead of needing to add a dynamic class to this element.


expect(el.loading).to.be.true;
await expect(el).to.be.accessible();
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I copied the pattern from the invalid property, but I feel like some more tests should be added. Are there any guidelines about writing tests?

Copy link
Contributor

Choose a reason for hiding this comment

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

Two things we'll want to test for:

  • is the listbox disabled when loading: load, apply loading, try to click, see that open === false and the Menu Items cannot be clicked with sendMouse
  • is the final "loading" label applied to the accessibility tree: load, apply loading, get an accessibility snapshot, ensure there is a node with the expected label

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! One additional question about testing: is there any command to run only the tests from one file? I tried some combinations, but failed 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

yarn test:watch:focus picker

--spectrum-progress-circle-thickness: var(
--spectrum-progress-circle-thickness-small
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@pfulton is there any token support for these variation?

--spectrum-progress-circle-thickness: var(
--spectrum-progress-circle-thickness-small
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

From a selector standpoint, we can use :host([size="s"]) sp-progress-circle instead of needing to add a dynamic class to this element.


expect(el.loading).to.be.true;
await expect(el).to.be.accessible();
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Two things we'll want to test for:

  • is the listbox disabled when loading: load, apply loading, try to click, see that open === false and the Menu Items cannot be clicked with sendMouse
  • is the final "loading" label applied to the accessibility tree: load, apply loading, get an accessibility snapshot, ensure there is a node with the expected label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants