Skip to content

fix(mosaic): render the profile page title on the server - #10085

Open
maxyinger wants to merge 3 commits into
mainfrom
profile-page-title-ssr
Open

maxyinger wants to merge 3 commits into
mainfrom
profile-page-title-ssr

Conversation

@maxyinger

@maxyinger maxyinger commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Description

The profile's page title (Profile.Content's heading, naming the selected page) was empty in server-rendered HTML and only appeared once the client hydrated. Profile.Nav handed its items to the title through context state set in a layout effect, so the first render, and the SSR output with it, had no label.

Profile.Content now takes the selected page's name as a required pageTitle prop and renders it as the page title, so the heading has its label on the first render and the server emits it. Profile.Nav still renders its items as the tablist and the compact select's options.

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:

🤖 Generated with Claude Code

The page title took its label from state that `Profile.Nav` set in a layout
effect, so server-rendered HTML carried an empty heading until hydration.
`Profile.Root` now reads the nav's children from its own children during
render, so the title is in the first render and the SSR output.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Oct 6, 2026 8:52pm UTC
swingset Ready Ready Preview Oct 6, 2026 8:52pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 23ddacb

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

This PR includes changesets to release 0 packages

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

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

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository YAML (base), Organization UI (inherited)
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: 3744e317-f106-4fed-9006-27f4a4d08caf
📥 Commits

Reviewing files that changed from the base of the PR and between 05fc85a and 23ddacb.

📒 Files selected for processing (10)
  • .changeset/profile-page-title-ssr.md
  • packages/mosaic/src/components/panel/panel.test.tsx
  • packages/mosaic/src/components/profile/profile.ssr.test.tsx
  • packages/mosaic/src/components/profile/profile.test.tsx
  • packages/mosaic/src/components/profile/profile.tsx
  • packages/mosaic/src/features/organization-profile/organization-profile.view.tsx
  • packages/mosaic/src/features/user-profile/user-profile.view.tsx
  • packages/swingset/src/stories/action-bar.stories.tsx
  • packages/swingset/src/stories/profile.component.mdx
  • packages/swingset/src/stories/profile.component.stories.tsx
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 6 reviews per hour.


📝 Walkthrough

Walkthrough

Profile.Content now requires a pageTitle prop and renders that value as the page heading. User and organization profile views resolve the active entry, fall back to the first entry when needed, and pass its custom or localized title. Tests and examples now provide page titles, and a server-rendering test checks the selected security title.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 23dda

The profile heading change is ready to merge after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 8 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: rendering the profile page title on the server.
Description check ✅ Passed The description explains the server-rendering issue and the change to require and render the pageTitle prop.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 8 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@pkg-pr-new

pkg-pr-new Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

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

@clerk/electron-passkeys

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

@clerk/eslint-plugin

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

@clerk/expo

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

@clerk/expo-biometrics

npm i https://pkg.pr.new/@clerk/expo-biometrics@10085

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@10085

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/mosaic

npm i https://pkg.pr.new/@clerk/mosaic@10085

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 23ddacb

Comment on lines +279 to +296
function navItemsOf(children: React.ReactNode): React.ReactNode {
for (const child of React.Children.toArray(children)) {
if (!React.isValidElement<{ children?: React.ReactNode }>(child)) {
continue;
}
if (child.type === Nav) {
return child.props.children;
}
if (child.type === React.Fragment) {
const items = navItemsOf(child.props.children);
if (items !== null) {
return items;
}
}
}
return null;
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

could we remove the need for computing this with just a little more data orchestration?

`Profile.Content` takes the selected page's name as `pageTitle` instead of
`Profile.Root` walking its children for the nav items.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

2 active deployments
Preview – swingset — 23ddacb3 Deployed Oct 6, 2026 by vercel[bot]
Preview – clerk-js-sandbox — 23ddacb3 Deployed Oct 6, 2026 by vercel[bot]
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.

3 participants