Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WB-1780: Refactor combobox to use Announcer [WIP] #2390

Draft
wants to merge 60 commits into
base: announcer-pt1
Choose a base branch
from

Conversation

jandrade
Copy link
Member

Summary:

Experimenting with the new announcer component to see if it can be used to
announce all the necessary information for the combobox.

Issue: https://khanacademy.atlassian.net/browse/WB-1780

Test plan:

Enable Voice Over.

Navigate to the Combobox docs and interact with the combobox to see if the
announcer announces the necessary information.

Why didn't Prettier do this automatically? I do not know...
1. Keeps announce from being called too frequently. We can play with the timeout duration.
2. Makes the returned IDREF more reliable in a browser.
1. Keeps announce from being called too frequently. We can play with the timeout duration.
2. Makes the returned IDREF more reliable in a browser.
1. Return first result and debounce subsequent calls within the debounceThreshold
2. Remove removalDelay parameter to simplify API
3. Put debounce utility into a separate file and add tests
@jandrade jandrade self-assigned this Dec 11, 2024
Copy link

changeset-bot bot commented Dec 11, 2024

⚠️ No Changeset found

Latest commit: 7fc7a6e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Dec 11, 2024

Size Change: -1.33 kB (-1.34%)

Total Size: 98 kB

Filename Size Change
packages/wonder-blocks-accordion/dist/es/index.js 3.77 kB -13 B (-0.34%)
packages/wonder-blocks-core/dist/es/index.js 2.88 kB -603 B (-17.34%) 👏
packages/wonder-blocks-dropdown/dist/es/index.js 18.7 kB -480 B (-2.5%)
packages/wonder-blocks-form/dist/es/index.js 6.2 kB -83 B (-1.32%)
packages/wonder-blocks-modal/dist/es/index.js 5.42 kB -10 B (-0.18%)
packages/wonder-blocks-popover/dist/es/index.js 4.85 kB -14 B (-0.29%)
packages/wonder-blocks-search-field/dist/es/index.js 1.36 kB -18 B (-1.3%)
packages/wonder-blocks-switch/dist/es/index.js 1.92 kB -21 B (-1.08%)
packages/wonder-blocks-tooltip/dist/es/index.js 6.99 kB -91 B (-1.28%)
ℹ️ View Unchanged
Filename Size
packages/wonder-blocks-announcer/dist/es/index.js 1.99 kB
packages/wonder-blocks-banner/dist/es/index.js 1.53 kB
packages/wonder-blocks-birthday-picker/dist/es/index.js 1.77 kB
packages/wonder-blocks-breadcrumbs/dist/es/index.js 887 B
packages/wonder-blocks-button/dist/es/index.js 4.04 kB
packages/wonder-blocks-cell/dist/es/index.js 2.01 kB
packages/wonder-blocks-clickable/dist/es/index.js 3.06 kB
packages/wonder-blocks-data/dist/es/index.js 6.24 kB
packages/wonder-blocks-grid/dist/es/index.js 1.36 kB
packages/wonder-blocks-icon-button/dist/es/index.js 2.95 kB
packages/wonder-blocks-icon/dist/es/index.js 871 B
packages/wonder-blocks-labeled-field/dist/es/index.js 72 B
packages/wonder-blocks-layout/dist/es/index.js 1.82 kB
packages/wonder-blocks-link/dist/es/index.js 2.28 kB
packages/wonder-blocks-pill/dist/es/index.js 1.65 kB
packages/wonder-blocks-progress-spinner/dist/es/index.js 1.52 kB
packages/wonder-blocks-testing-core/dist/es/index.js 3.74 kB
packages/wonder-blocks-testing/dist/es/index.js 1.07 kB
packages/wonder-blocks-theming/dist/es/index.js 693 B
packages/wonder-blocks-timing/dist/es/index.js 1.8 kB
packages/wonder-blocks-tokens/dist/es/index.js 2.36 kB
packages/wonder-blocks-toolbar/dist/es/index.js 905 B
packages/wonder-blocks-typography/dist/es/index.js 1.23 kB

compressed-size-action

marcysutton and others added 6 commits December 12, 2024 11:51
Debounce wasn't actually limiting execution in the wait period. Now it does, and the debounce duration is still configurable when calling announceMessage!
I was trying to avoid having to import the Announcer in this test to keep things isolated, but it's so specific to the Announcer that I decided it didn't matter that much. Specifying the Announcer instance for the scope instead of generic thisArg logic simplified things quite a bit as well.
jandrade and others added 16 commits December 12, 2024 18:15
## Summary:
This is the first step in removing our custom ID utilities in favour of using the `useId` hook from React's API. This PR is not going to be merged/released on its own. Another PR will be coming to add an `Id` component that wraps `useId` so that there's an easier path for consumers to migrate.

The difficult bit is moving from the provider architecture that gives an ID factory, to the `useId`/`Id` approach. However, long term, it should simplify things greatly.

### Upgrade note:
Upgrading to this will cause deprecation notices in consuming code. If a lint rule is set up to block deprecated usage (which it probably is), then those errors will have to be suppressed. A find/replace may help in some circumstances, but this may also be a manual process. The alternative, of course, is to actually modify stuff to the new approach.

Issue: WB-1812

## Test plan:
`yarn test`
`yarn lint`

Author: somewhatabstract

Reviewers: jandrade

Required Reviewers:

Approved By: jandrade

Checks: ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ⏭️  Chromatic - Skip on Release PR (changesets), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ gerald, ⏭️  dependabot

Pull Request URL: #2388
## Summary:
This adds a simple CaaF (children-as-a-function) component to generate unique IDs as a stand-in for the `useId` hook. This is useful for cases where one needs to generate unique IDs for a component, but cannot use the hook without a larger refactor.

Issue: WB-1812

## Test plan:
`yarn test`
`yarn start:storybook` to check for the added docs
`yarn typecheck`

Author: somewhatabstract

Reviewers: jeresig

Required Reviewers:

Approved By: jeresig

Checks: ⌛ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ⌛ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ⌛ gerald, ⏭️  dependabot

Pull Request URL: #2389
## Summary:
This is the last piece in the first batch of work. This migrates all Wonder Blocks components off our old ID providers and onto the new `Id` component.

There are also some documentation tweaks to make the deprecation clearer in our stories, since that's some primary documentation for folks.

With this PR, we can cut a release and then begin updating consumer repos accordingly. First, to include this update, then to migrate them off the old ways and onto the new.

### Release process:
Once this small stack of PRs are landed and released, the following PRs need to be updated with that release, then landed/deployed:

- Perseus: Khan/perseus#2007
- Webapp
  - Khan/webapp#28105
  - Khan/webapp#28127


Issue: WB-1812

## Test plan:
`yarn test`
`yarn typecheck`
`yarn start:storybook`

Author: somewhatabstract

Reviewers: jandrade, somewhatabstract

Required Reviewers:

Approved By: jandrade

Checks: ⌛ Lint / Lint (ubuntu-latest, 20.x), ⌛ Check build sizes (ubuntu-latest, 20.x), ⌛ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ⌛ Publish npm snapshot (ubuntu-latest, 20.x), ⌛ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ⏭️  Chromatic - Skip on Release PR (changesets), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ gerald, ⏭️  dependabot

Pull Request URL: #2391
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
## Summary:

The `changesets` tooling supports a configuration option that causes `yarn changeset` to automatically add and commit the created file ([docs](https://github.com/changesets/changesets/blob/main/docs/config-file-options.md#commit-boolean-or-module-path-as-a-string-or-a-tuple-like-modulepath-string-options-any)).  

NOTE: If there are existing changes in your local repo, these changes _will not_ be included in the commit (so it's safe to run `yarn changeset` no matter the state of your repo).

There are PRs in other Khan Academy repos that use the Changesets tooling. We'll only land this if there's consensus across these other repos too:

  * Khan/wonder-stuff#1097
  * #2394 (this PR)
  * Khan/perseus#2008

Issue: "none"

## Test plan:

`yarn changeset` 
Fill in the details 
Once complete, run `git log` and you will see that the changeset entry you created has been added and committed to git - all that's left is to create the PR!

Author: jeremywiebe

Reviewers: jandrade, somewhatabstract

Required Reviewers:

Approved By: jandrade

Checks: ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ⏭️  Chromatic - Skip on Release PR (changesets), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ gerald, ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ gerald, ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ⏭️  Publish npm snapshot, ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ⏭️  Chromatic - Skip on Release PR (changesets), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ gerald, ⌛ undefined

Pull Request URL: #2394
## Summary:
This deletes the components and hooks that we had for generating hydration-safe identifiers. We are now using the built-in `useId` hook internally, and expect our consumers to do the same (or the `Id` component we provide for more complex cases).

This should not be released until the following PRs are merged and deployed to webapp:
 - Khan/webapp#28161
 - Khan/webapp#28156

Issue: WB-1812

## Test plan:
`yarn test`
`yarn typecheck`

Author: somewhatabstract

Reviewers: beaesguerra

Required Reviewers:

Approved By: beaesguerra

Checks: ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ⏭️  Chromatic - Skip on Release PR (changesets), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ gerald, ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ⏭️  Chromatic - Skip on Release PR (changesets), ⏹️  [cancelled] Chromatic - Get results on regular PRs, ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ gerald, ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Check build sizes (ubuntu-latest, 20.x), ⏹️  [cancelled] Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ⏭️  Chromatic - Skip on Release PR (changesets), ⌛ undefined

Pull Request URL: #2398
Releases:
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]

[skip ci]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…ace (#2405)

## Summary:

Adds `width: 100%` to `legend` element to allow expanding it to fill the
available space.

Note that this applies to both `RadioGroup` and `CheckboxGroup`.

Issue: XXX-XXXX

## Test plan:

Navigate to `/?path=/docs/packages-form-radiogroup--docs#custom%20label`.

Verify that the legend element is now full-bleed.

Author: jandrade

Reviewers: beaesguerra

Required Reviewers:

Approved By: beaesguerra

Checks: ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ⏭️  Chromatic - Skip on Release PR (changesets), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ gerald, ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ⏭️  dependabot

Pull Request URL: #2405
* RELEASING: Releasing 4 package(s)

Releases:
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]

[skip ci]

* Trigger empty commit

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Juan Andrade <[email protected]>
…urbosnap (#2408)

## Summary:

While investigating the performance of Chromatic/Turbosnap, I found that
chromatic was disabling Turbosnap of the storybook stories in a lot of builds
because apparently we were making changing changes in files inside the
`.storybook` folder. This is not the case as those builds didn't include changes
in such files, but this made me realize that we could optimize the performance
of Turbosnap by moving the reusable components from the `.storybook` folder to
the `__docs__` folder.

Issue: XXX-XXXX

## Test plan:

Verify that Storybook still works as expected and check the Chromatic build to
see if Turbosnap is enabled for the stories that were previously disabled.

Author: jandrade

Reviewers: beaesguerra

Required Reviewers:

Approved By: beaesguerra

Checks: ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ⏭️  Chromatic - Skip on Release PR (changesets), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ gerald, ⏭️  dependabot, ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x)

Pull Request URL: #2408
…2409)

## Summary:

I recently updated our Changesets config to auto-commit the `.md` file when using `yarn changset` to describe a set of changes. This broke our releases as the default behaviour is that Changesets adds `[skip ci]` to the commit created when running `yarn changesets version`. No CI on that PR/commit, meant that none of our release Github Actions ran!

So this PR fixes the config so that Changesets no longer adds `[skip ci]` to any commits, but still auto-commits them. 

Issue: "none"

## Test plan:

Land this PR
Merge `main` into an open Version Packages PR
Land that PR and ensure the release goes out

Author: jeremywiebe

Reviewers: jandrade

Required Reviewers:

Approved By: jandrade

Checks: ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ gerald, ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ⏭️  Publish npm snapshot, ⏭️  Chromatic - Skip on Release PR (changesets), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ⏭️  dependabot, ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ gerald

Pull Request URL: #2409
## Summary:

This PR is meant to bump the version of the form package to test changesets.

We are seeing if a change being applied in #2409 will fix the issue we are
seeing with changesets not being triggering PR checks at all.

This is causing that packages are not being published to NPM.

Issue: XXX-XXXX

## Test plan:

Land this PR and see if the changesets checks are triggered once the Release PR
is created.

Author: jandrade

Reviewers: beaesguerra, jeremywiebe

Required Reviewers:

Approved By: beaesguerra

Checks: ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ⏭️  Chromatic - Skip on Release PR (changesets), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ gerald, ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ⏭️  Chromatic - Skip on Release PR (changesets), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ gerald, ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ⏭️  dependabot

Pull Request URL: #2410
* RELEASING: Releasing 4 package(s)

Releases:
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]
  @khanacademy/[email protected]

* Trigger empty commit

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Juan Andrade <[email protected]>
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.

5 participants