Skip to content

fix(ui): Improve members notification badge loading experience#9187

Open
alexcarpenter wants to merge 2 commits into
mainfrom
carp/members-badge-loading
Open

fix(ui): Improve members notification badge loading experience#9187
alexcarpenter wants to merge 2 commits into
mainfrom
carp/members-badge-loading

Conversation

@alexcarpenter

@alexcarpenter alexcarpenter commented Jul 16, 2026

Copy link
Copy Markdown
Member

Description

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Summary by CodeRabbit

  • New Features

    • Added a reusable skeleton loading placeholder with a subtle shimmer effect.
    • Added support for customizing the skeleton’s appearance through theme styling.
    • Added loading states for notification count badges.
  • Bug Fixes

    • Organization Profile member tabs now reserve space for notification counts while loading, preventing layout shifts when counts appear.
    • Skeleton animations respect reduced-motion preferences.

@changeset-bot

changeset-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4a3f869

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

This PR includes changesets to release 3 packages
Name Type
@clerk/ui Minor
@clerk/chrome-extension Patch
@clerk/swingset Patch

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

@macroscopeapp

macroscopeapp Bot commented Jul 16, 2026

Copy link
Copy Markdown

Approvability

Verdict: Approved

UI-only change adding a Skeleton loading component to prevent layout shift in notification badges. Changes are purely presentational, self-contained to the UI package, with no backend or security implications.

You can customize Macroscope's approvability policy. Learn more.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jul 16, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9187

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9187

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9187

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9187

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9187

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9187

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9187

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9187

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9187

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9187

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9187

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9187

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9187

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9187

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9187

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9187

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9187

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9187

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9187

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9187

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9187

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9187

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9187

commit: 4a3f869

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-07-17T00:20:13.524Z

Summary

Metric Count
Packages analyzed 19
Packages with changes 1
🔴 Breaking changes 0
🟡 Non-breaking changes 1
🟢 Additions 0

🤖 This report was reviewed by claude-sonnet-4-6.


@clerk/ui

Current version: 1.25.5
Recommended bump: MINOR → 1.26.0

Subpath ./internal

🟡 Non-breaking Changes (1)

Modified: ElementsConfig
// ... 425 unchanged lines elided ...
    notificationBadge: WithOptions;
    buttonArrowIcon: WithOptions;
    spinner: WithOptions;
+   skeleton: WithOptions;
    apiKeys: WithOptions;
    apiKeysHeader: WithOptions;
    apiKeysSearchBox: WithOptions;
// ... 124 unchanged lines elided ...

Static analyzer: Breaking change in type alias ElementsConfig: Type changed: {button:import("@clerk/ui").~WithOptions<string>;input:import("@clerk/ui").~WithOptions;checkbox:import("@clerk/ui").~W…{button:import("@clerk/ui").~WithOptions<string>;input:import("@clerk/ui").~WithOptions;checkbox:import("@clerk/ui").~W…

🤖 AI review (reclassified as non-breaking) (85%): The before and after snippets are structurally nearly identical (both truncate with '...elided...' but show the same fields); the only visible difference is one additional line in the elided section ('476 lines' vs '475 lines'), indicating a new property was added. ElementsConfig is used only as an index type in the output type alias Elements, making it an output position; adding a new key to an output object type is non-breaking for consumers who only read it.


Report generated by Break Check

Last ran on 4a3f869.

@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jul 17, 2026 12:31am
swingset Ready Ready Preview, Comment Jul 17, 2026 12:31am

Request Review

@macroscopeapp
macroscopeapp Bot dismissed their stale review July 17, 2026 00:16

Dismissing prior approval to re-evaluate 4a3f869

@github-actions github-actions Bot added the ui label Jul 17, 2026
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a shimmer-enabled Skeleton component, exposes it through appearance and animation systems, and updates Organization Profile member tabs to render stable notification badge placeholders while counts load.

Changes

Skeleton Badge Loading

Layer / File(s) Summary
Skeleton component and styling
packages/ui/src/elements/Skeleton.tsx, packages/ui/src/styledSystem/animations.ts, packages/ui/src/customizables/elementDescriptors.ts, packages/ui/src/internal/appearance.ts
Adds a themed Skeleton placeholder with shimmer animation, reduced-motion handling, and a skeleton appearance descriptor.
Notification badge loading contract
packages/ui/src/common/NotificationCountBadge.tsx
Adds isLoading support to render a Skeleton during loading and preserve the existing notification badge otherwise.
Organization member tab integration
packages/ui/src/components/OrganizationProfile/OrganizationMembers.tsx, .changeset/skeleton-members-badge-loading.md
Always renders badges for available Members, Invitations, and Requests tabs, passing loading state and zero-count fallbacks; records the minor package release.
Estimated code review effort: 3 (Moderate) ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant OrganizationMembers
  participant NotificationCountBadge
  participant Skeleton
  participant NotificationBadge
  OrganizationMembers->>NotificationCountBadge: Pass tab count and loading state
  alt Count is loading
    NotificationCountBadge->>Skeleton: Render reserved placeholder
  else Count is available
    NotificationCountBadge->>NotificationBadge: Render formatted count
  end
Loading

Poem

A rabbit hops through loading light,
Shimmering badges sit just right.
Tabs hold their place while numbers grow,
Then counts appear in tidy rows.
Squeak—no shifting, smooth and bright!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main UI change: improving the members notification badge loading experience.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
packages/ui/src/elements/Skeleton.tsx (2)

20-20: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Declare the component’s return type.

Skeleton is exported without an explicit return type, contrary to the TypeScript API guideline.

Proposed fix
+import type { ReactElement } from 'react';
+
-export const Skeleton = (props: SkeletonProps) => {
+export const Skeleton = (props: SkeletonProps): ReactElement => {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui/src/elements/Skeleton.tsx` at line 20, Update the exported
Skeleton component declaration to include an explicit React return type, using
the project’s established typing convention for components while preserving its
existing props and rendering behavior.

Source: Coding guidelines


11-19: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Complete the generated-reference documentation for the Skeleton API.

  • packages/ui/src/elements/Skeleton.tsx#L11-L19: Add structured @param, @returns, and @example JSDoc if this component is exported from a public UI entry point.
  • packages/ui/src/internal/appearance.ts#L649-L649: Document the skeleton appearance option and have the Docs team review the generated /object/** output.

As per coding guidelines, “All public APIs must be documented with JSDoc.” As per path instructions, public JSDoc may render in generated Clerk Docs and “the Docs team may need to review the change.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui/src/elements/Skeleton.tsx` around lines 11 - 19, The public
Skeleton component lacks complete generated-reference documentation. In
packages/ui/src/elements/Skeleton.tsx lines 11-19, add structured JSDoc with
`@param`, `@returns`, and `@example` for the exported component, preserving the
documented block, content, and show behaviors. In
packages/ui/src/internal/appearance.ts line 649, document the skeleton
appearance option and have the Docs team review the generated /object/** output.

Sources: Coding guidelines, Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/ui/src/elements/Skeleton.tsx`:
- Line 20: Update the exported Skeleton component declaration to include an
explicit React return type, using the project’s established typing convention
for components while preserving its existing props and rendering behavior.
- Around line 11-19: The public Skeleton component lacks complete
generated-reference documentation. In packages/ui/src/elements/Skeleton.tsx
lines 11-19, add structured JSDoc with `@param`, `@returns`, and `@example` for the
exported component, preserving the documented block, content, and show
behaviors. In packages/ui/src/internal/appearance.ts line 649, document the
skeleton appearance option and have the Docs team review the generated
/object/** output.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Repository UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: e082ca53-b48b-43a5-bd35-d101ce339218

📥 Commits

Reviewing files that changed from the base of the PR and between b37ba0d and 4a3f869.

📒 Files selected for processing (7)
  • .changeset/skeleton-members-badge-loading.md
  • packages/ui/src/common/NotificationCountBadge.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationMembers.tsx
  • packages/ui/src/customizables/elementDescriptors.ts
  • packages/ui/src/elements/Skeleton.tsx
  • packages/ui/src/internal/appearance.ts
  • packages/ui/src/styledSystem/animations.ts

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant