Skip to content

Avoid TypeError in useAnnouncements - #5551

Merged
camertron merged 4 commits into
mainfrom
use_announcements_check_active_item_null
Jan 16, 2025
Merged

Avoid TypeError in useAnnouncements#5551
camertron merged 4 commits into
mainfrom
use_announcements_check_active_item_null

Conversation

@camertron

Copy link
Copy Markdown
Contributor

Closeshttps://github.com/github/primer/issues/4635

Changelog

New

Changed

  1. Fixes an issue in useAnnouncements.tsx causing a TypeError in production. The activeItem variable may be null.

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

- [ ] Added/updated tests
- [ ] Added/updated documentation
- [ ] Added/updated previews (Storybook)

@camertron
camertron requested a review from a team as a code ownerJanuary 15, 2025 22:42
@changeset-bot

changeset-botBot commented Jan 15, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 67e55f3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
NameType
@primer/reactPatch

Not sure what this means? Click here to learn what changesets are.

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

@camertroncamertron changed the title Avoid accessing properties of undefined in useAnnouncementsAvoid TypeError in useAnnouncementsJan 15, 2025
@github-actionsgithub-actionsBot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jan 15, 2025
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@github-actions

github-actionsBot commented Jan 15, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js104.19 KB (+0.02% 🔺)
packages/react/dist/browser.umd.js104.57 KB (+0.06% 🔺)

@github-actions
github-actionsBottemporarily deployed to storybook-preview-5551 January 15, 2025 22:46 Inactive

@francineluccafrancinelucca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@github-actionsgithub-actionsBot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jan 15, 2025
@primer-integration

Copy link
Copy Markdown

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/358253

@primer-integration

Copy link
Copy Markdown

🔴 golden-jobs completed with status failure.

@camertron
camertron added this pull request to the merge queueJan 16, 2025
Merged via the queue into main with commit c0360dbJan 16, 2025
@camertron
camertron deleted the use_announcements_check_active_item_null branch January 16, 2025 23:20
@primerprimerBot mentioned this pull request Jan 16, 2025
camertron added a commit that referenced this pull request Jan 21, 2025
github-merge-queueBot pushed a commit that referenced this pull request Jan 30, 2025
* Revert "Revert "Select panel loading states (#4929)" (#5136)"
This reverts commit f93eb9b.
* Use published primer/behaviors
* Revert snapshot change to TextInput
* Huh ok never mind
* Use role in test
* Prevent active descendant from resetting when items change
* Allow loading state to be managed by the user
* Encounter the loading state for the initial state announcement
* It's working
* Cleanup
* Fix linting issues
* Revert snapshots
* test(vrt): update snapshots
* Backport #5551 to this PR
* Fix auto-focus behavior
* Add test to ensure focus behavior
* Allow consumers to pass an inputRef; DRY up timeout cleanup; simplify nullish coercion
* DRY up announcement code; restore useAnnouncements hook for non-SelectPanel cases
* Fix types tests
* Remove testing ID
* Remove confusing componentManagesLoading control in async story
---------
Co-authored-by: Cameron Dutro <camertron@gmail.com>
Co-authored-by: francinelucca <francinelucca@users.noreply.github.com>
Co-authored-by: Marie Lucca <40550942+francinelucca@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: failingChanges in this PR cause breaking changes in gh/gh

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@camertron@francinelucca