@nuxtseo/pro-shell
v0.1.36
Published
Nuxt SEO Pro shell layer: the dashboard frame (layout, sidebar nav, Site switcher, user menu, page header) and its calls to action (setup offers, invite teammate, send feedback) over a route map and site adapters. Extends @nuxtseo/design-system.
Maintainers
Readme
Pro Shell
The dashboard frame and calls to action that nuxtseo.com, gscdump.com and Request Indexing share, published as the Nuxt layer @nuxtseo/pro-shell. It extends @nuxtseo/design-system. Decision: ADR-0166.
Scope
Owns:
- Setup offers: the "Finish setting up" frame (
ProShellSetupOffers) and the five offers every product shares: agent skill, MCP, first API request, Bing, and Add another Site (buildSharedSetupOffers). - Invite teammate: the dialog (
ProShellInviteDialog). - Send feedback: the drawer (
ProShellFeedbackDrawer) and its wire contract (shared/contracts/feedback.ts). - The Dashboard frame: the layout (
ProShellDashboardFrame), the sidebar header and command palette trigger, the sidebar nav drawn from a Nav manifest (ProShellSidebarNav,ProShellNavSection), the Site switcher (ProShellSiteSwitcherin the page header andProShellSidebarSiteSwitchbeside a Site sidebar header, sharinguseProShellSiteMenuandProShellSiteMenu), the user menu (ProShellUserMenu), the page header (ProShellPageHeader), and the mobile drawer trigger. - Onboarding: the Step registry (
pro-shell:onboarding:step), the resolver that picks the current step (resolveOnboarding), the flow (useProShellOnboardingFlow), and the frame and surface that draw it (ProShellOnboardingFrame,ProShellOnboardingSurface). - Small display parts:
ProShellAbilityGate,ProShellTeamAvatar,ProShellDangerZone. - The route map (
proShell.routes), the Nav manifest (proShell.nav), and the copy (proShell.copy) every part reads.
Leaves to the site:
- Data. Each offer's Setup completion, each Onboarding Step's Step state, the Site in view, the account. They come in through props, through the Nav source the site provides for the frame, and through the onboarding flow's context.
- Actions and decisions. The invitation, the feedback report, and each onboarding move leave through adapters the site passes:
invite,submit,navigateandfinish. Access comes from the site'saccessadapter. - The command palette list, billing banners, and the brand mark. The frame has a slot for each.
- Billing, auth, and any server code. The layer has none (ADR-0042, ADR-0166).
Not yet here: the command palette list (each site fills the #command-palette slot), and the delete confirm modal (it migrates to UiConfirmDialog first).
Rules
- No runtime services: no
useFetch,$fetch, Drizzle, Caller, billing, auth, oruseRuntimeConfig. A call to action that needs data takes a prop; one that changes data calls an adapter. - No Nuxt SEO brand assets. A setup offer's
Sitemark draws the site's own brand through the#site-markslot. - No hardcoded path. Every link resolves through the route map. A route the site leaves out hides the call to action that needs it.
- Components carry the
ProShellprefix. It is the layer's scope, and it never collides with a site's ownPro*orApp*components. - Every default string has a row in
COPY.md(Dashboard CTA assets).
Consuming pro-shell
Install the shell and the design system at the same version. They release together.
pnpm add @nuxtseo/pro-shell @nuxtseo/design-system
pnpm add -D typescript@^6// nuxt.config.ts
export default defineNuxtConfig({
// The shell extends the design system, so one entry brings both.
extends: ['@nuxtseo/pro-shell'],
})- Peers: everything the design system needs (its README lists them), plus
@nuxtseo/design-systemat the shell's own version. - Import components from
#components. The layer's auto-imports are off, as in the design system. Its composables carryProShellin their names, so a site that turns auto-imports on can use them from#importswithout a clash. - Import the pure modules by path:
@nuxtseo/pro-shell/shared/routes,shared/setup-offers,shared/invite,shared/feedback,shared/onboarding,shared/copy,shared/config, andshared/contracts. - A component with a shell component's name loses: the layer registers its components at priority 10. Change the shell through props, slots, and
app.config.
Route map
Each site maps the shell's logical routes to its own paths under proShell.routes in app.config.ts. A Site route holds the [site] token; the shell fills it with the Site reference, URI encoded. Wrap the key in defineProShellConfig to type-check it in a plain-object app.config.ts.
| Route | Kind | Used by |
| --- | --- | --- |
| dashboard | App | Brand link, Site switcher "All sites" |
| sites | App | Nav manifest and user menu items (Route, SiteRoute) |
| addSite | App | Add another Site offer |
| teamMembers | App | Nav manifest and user menu items (Route, SiteRoute) |
| developers | App | Agent skill, MCP (?setup=mcp) and API (?setup=api) offers |
| integrations | App | Nav manifest and user menu items (Route, SiteRoute), Onboarding Step links (Nuxt SEO's Web Analytics step) |
| bingIntegration | App | Bing offer across Sites |
| onboarding | App | Onboarding Step links into the first-run journey |
| searchConsole | App | Onboarding Step links to the Search Console properties page |
| siteOverview | Site | Site switcher links (the same page on another Site keeps its path under this route) |
| siteIndexing | Site | Nav manifest and user menu items (Route, SiteRoute) |
| siteSearchConsole | Site | Nav manifest and user menu items (Route, SiteRoute) |
| siteBingIndexing | Site | Bing offer on one Site |
useProShellRoute() resolves a route in setup. It returns null for a route the site leaves out.
const route = useProShellRoute()
route('developers', { query: { setup: 'mcp' } }) // '/app/developers?setup=mcp'
route('siteBingIndexing', { site: 'sc-domain:example.com' }) // '/app/sites/sc-domain%3Aexample.com/indexing/bing'
route('teamMembers') // null when the site maps nonegscdump.com
// app/app.config.ts
import { defineProShellConfig } from '../shared/config'
export default {
proShell: defineProShellConfig({
routes: {
dashboard: '/app',
sites: '/app/sites',
addSite: '/app/onboarding?step=connect-sites',
teamMembers: '/app/settings/members',
developers: '/app/developers',
integrations: '/app/integrations',
bingIntegration: '/app/integrations#bing',
siteOverview: '/app/sites/[site]',
siteIndexing: '/app/sites/[site]/indexing',
siteSearchConsole: '/app/sites/[site]/search-console',
siteBingIndexing: '/app/sites/[site]/indexing/bing',
},
}),
}Request Indexing
// app/app.config.ts
import { defineProShellConfig } from '../shared/config'
export default {
proShell: defineProShellConfig({
routes: {
dashboard: '/pro/dashboard',
sites: '/pro/dashboard/sites',
addSite: '/pro/dashboard/sites/connect',
teamMembers: '/pro/dashboard/team/members',
developers: '/pro/dashboard/developers',
integrations: '/pro/dashboard/integrations',
bingIntegration: '/pro/dashboard/integrations#bing',
siteOverview: '/pro/dashboard/sites/[site]',
siteIndexing: '/pro/dashboard/sites/[site]/indexing',
siteSearchConsole: '/pro/dashboard/sites/[site]/search-console',
siteBingIndexing: '/pro/dashboard/sites/[site]/indexing/bing',
},
}),
}nuxtseo.com sets its map in apps/pro/app/pro-shell.ts, with /pro/dashboard/sites/[site] Site routes and /pro/dashboard/overview as the dashboard.
Dashboard frame
The site renders the frame from its own dashboard layout, provides a Nav source above it, and fills the slots. Auth, session checks, and billing stay in the site's layout.
<!-- app/layouts/app.vue -->
<script setup lang="ts">
import { ProShellDashboardFrame, ProShellSidebarNav, ProShellUserMenu } from '#components'
import { provideProShellNavSource } from '../app/composables/useProShellNavSource'
import { useAppNavSource } from '../composables/useAppNavSource'
provideProShellNavSource(useAppNavSource())
</script>
<template>
<ProShellDashboardFrame>
<template #brand-mark>
<MyBrandMark />
</template>
<template #top-banners>
<MyBillingBanner />
</template>
<template #sidebar>
<ProShellSidebarNav />
</template>
<template #footer>
<ProShellUserMenu :items="userMenu" />
</template>
<template #mobile="{ closeNav }">
<ProShellSidebarNav @navigate="closeNav()" />
<ProShellUserMenu variant="drawer" :items="userMenu" @navigate="closeNav()" />
</template>
<template #command-palette>
<ProShellCommandPalette nav-commands site-commands />
</template>
<slot />
</ProShellDashboardFrame>
</template>| Slot | What goes in |
| --- | --- |
| #brand-mark | The site's logo mark. The layer ships none. |
| #brand | Replaces the whole sidebar header. |
| #top-bar-extras | Beside the sidebar header. |
| #sidebar, #footer, #mobile | The sidebar body, its foot, and the drawer body ({ closeNav }). |
| #top-banners | Full width notices above the content, such as billing banners. |
| #command-palette | ProShellCommandPalette (Command palette below). It mounts on the first open from the trigger or Cmd+K. With no slot, no trigger renders. |
| default, #bottom | The page, and a strip under it. |
Inside pages, ProShellPageHeader draws the title row with the drawer trigger, #crumb (put ProShellSiteSwitcher there), #actions, and #tabs. Its feedback menu opens the Nav source's openFeedback.
A site whose pages draw no ProShellPageHeader sets mobile-nav="frame". The frame then draws the phone drawer trigger in a bar under #top-banners, with the #mobile-nav slot beside it:
<ProShellDashboardFrame mobile-nav="frame">
<template #mobile-nav>
<ProShellSiteSwitcher />
</template>
</ProShellDashboardFrame>The sidebar's gap between blocks reads the --pro-shell-nav-gap token (default 1.25rem). Tighten it from the site's CSS, per breakpoint if needed:
.dashboard-theme { --pro-shell-nav-gap: 0.75rem; }
@media (width >= 64rem) { .dashboard-theme { --pro-shell-nav-gap: 1.25rem; } }collapseStorageKey names a cookie. The server reads it, so a collapsed section stays closed on a full load.
A Site route resolves its [site] token with encodeProShellSiteRef: : and @ stay raw, as Vue Router writes a path, and every other reserved character is escaped. The switcher's same-page check compares decoded segments, so a sc-domain: Site keeps the page on a switch. ProShellSite.description draws a second line under a Site's name in the switcher, such as an id that tells two Sites with one name apart.
The design system ships sm:text-title beside .text-title, so a crumb drawn text-sm sm:text-title reaches title size from sm.
Site switch and Site pages
A switch keeps the page in view inside the next Site. proShell.siteSwitch decides how much stays:
| Policy | Keeps | Use |
| --- | --- | --- |
| { _tag: 'SamePath' } (default) | The whole path under the Site, its query and hash | nuxtseo.com, Request Indexing |
| { _tag: 'SamePage' } | The deepest Site page the path sits in, no query. A detail below it, such as one keyword, belongs to the Site being left | gscdump.com |
proShell.sitePages lists the pages every Site has, as paths under siteOverview ('' is the overview). SamePage reads it, and so does the command palette.
ProShellSite.selection names a Site when its ref alone does not: gscdump's { siteId } for two Sites that share one Search Console label. Every switch drops the Site being left's selection keys and adds the next Site's, and the switcher marks a Site current by id. Every Site route link in the sidebar and the palette carries the current Site's selection. A site that needed resolve-destination only for these two rules can drop it:
export default {
proShell: defineProShellConfig({
siteSwitch: { _tag: 'SamePage' },
sitePages: [
{ id: 'search-console', label: 'Search Console', path: 'search-console' },
{ id: 'queries', label: 'Search Console: Queries', path: 'search-console/queries' },
{ id: 'indexing', label: 'Indexing', path: 'indexing' },
],
}),
}
// In the Nav source: { id: site.id, ref: site.label, selection: { siteId: site.id }, … }Command palette
ProShellCommandPalette draws the palette frame, binds the frame's open state, and searches label, suffix and keywords. Put it in the frame's #command-palette slot.
Each group shows its own best matches, up to 12 rows; the Sites group grows to one row per Site. A group with many matches, such as the Site pages of every Site, never hides a match in another group.
| Prop | What it adds |
| --- | --- |
| nav-commands | The Navigation group: the Nav manifest (prop manifest, else proShell.nav.manifest) resolved as the sidebar resolves it. A section row reads {section}: {item}. A disabled row drops out, and a row keeps its prefetch |
| site-commands | The Sites group, per listed Site from the Nav source: a switch named by the Site, which goes where the Site switcher goes, then one command per Site page ({site}: {page}) |
| site-rows | The Sites group's rows. { _tag: 'PagesOnSearch' } (the default) lists one switch per Site, and the Site page rows join once the person types. { _tag: 'SwitchOnly' } never adds them. The Sites group shows up to one row per Site, or 12 rows when there are fewer Sites |
| groups | The site's own ProShellCommandGroups. A command links with to or acts with onSelect; site: { host, emphasis } draws the Site favicon; searchOnly hides it until the person types |
| group-order | Where groups sit: { _tag: 'ShellGroupsFirst' } (the default) or { _tag: 'SiteGroupsFirst' }, such as a Navigation group of the site's own above the Sites group. With SiteGroupsFirst the order holds while the person types; with ShellGroupsFirst a typed search ranks groups by their best match |
| v-model:search-term | The typed text, for a group that follows it, such as an Ask AI handoff |
nuxtseo.com passes only groups: its commands are its own. Copy: proShell.copy.commandPalette.
Sidebar modes
ProShellSidebarModes wraps the sidebar body and switches it between whole panes, such as Browse and Agents. Each ProShellSidebarMode owns path prefixes (paths); the first mode is current on every other path. With two or more modes it draws their links; a mode link keeps the phone drawer open. The first mode draws the default slot, any other mode #mode="{ mode }". back: { label, to } replaces the links while the first mode is current, such as a way out of one Site.
<ProShellSidebarModes :modes="[{ id: 'browse', label: 'Browse', to: '/app' }, { id: 'ai', label: 'Agents', to: '/app/developers', paths: ['/app/developers'] }]">
<ProShellSidebarNav />
<template #mode>
<MyAgentLinks />
</template>
</ProShellSidebarModes>Copy: proShell.copy.sidebarModes (the two nav landmarks).
Fleet Sites list
ProShellFleetSites is the Sites list on the root dashboard. The site passes rows ranked in its own order; the list pages them (page-size, default 7), links its heading to the sites route, and draws loading and failure through UiWidgetState (loading, error, retain-content-on-error, @retry). A ProShellFleetSiteRow has a name, a favicon host, a link, a run (spark: None, Reading, or Read with data and tone) and a default status (a dot and a label; urgent tints the label). #identity="{ row }" replaces the name and #status="{ row }" the status; both get the row as passed, so a row may carry the site's own fields. Copy: proShell.copy.fleetSites.
Nav source
One adapter feeds the frame. The site maps its own rows once; the shell reads values and calls functions, and never fetches. An ability or feature gate the source cannot answer refuses.
interface ProShellNavSource {
sites: Ref<readonly ProShellSite[] | null> // null while loading
groups: Ref<readonly ProShellSiteGroup[]>
currentSite: Ref<ProShellSite | null>
routeSiteRef?: Ref<string | null> // the Site reference in the URL, when it differs from currentSite.ref
user: Ref<{ name: string | null, avatarUrl: string | null } | null>
access?: (ability: string, teamId: string | null) => { _tag: 'Allowed' } | { _tag: 'Denied', reason: string }
hasFeature?: (feature: string) => boolean
openFeedback?: (context?: { intent?: FeedbackIntent }) => void
}
interface ProShellSite {
id: string
ref: string // what the Site routes read
name: string
url: string | null
groupId: string | null
order?: number
listing: 'active' | 'inactive' | 'hidden'
statusLabel: string | null
emphasis: 'full' | 'basic'
preview?: boolean
}gscdump.com: Sites are keyed by Site URL, there are no groups, and every role may read.
// app/composables/useAppNavSource.ts
import type { ProShellNavSource } from '../shared/nav-source'
import { ACCESS_ALLOWED, accessDenied } from '../shared/access'
export function useAppNavSource(): ProShellNavSource {
const { sites, currentSite } = useAppSites()
const { session, can } = useAppSession()
const feedback = useAppFeedback()
const toShell = (site: AppSite) => ({
id: site.id,
ref: site.siteUrl,
name: site.displayName ?? site.siteUrl,
url: site.siteUrl,
groupId: null,
listing: site.archived ? 'inactive' : 'active',
statusLabel: site.archived ? 'Archived' : null,
emphasis: 'full',
}) as const
return {
sites: computed(() => sites.value?.map(toShell) ?? null),
groups: computed(() => []),
currentSite: computed(() => currentSite.value ? toShell(currentSite.value) : null),
user: computed(() => session.value ? { name: session.value.name, avatarUrl: session.value.avatar } : null),
access: (ability, teamId) => can(ability, teamId) ? ACCESS_ALLOWED : accessDenied('Ask a team admin for access.'),
hasFeature: feature => feature !== 'bing' || session.value?.bingBeta === true,
openFeedback: context => feedback.open(context),
}
}Request Indexing: Sites are keyed by id under /pro/dashboard/sites/[site], and the Caller's Team id is a number, so the adapter stringifies it.
export function useProNavSource(): ProShellNavSource {
const { sites, site } = useProSites()
const { user, caller } = useProSession()
return {
sites: computed(() => sites.value?.map(s => ({ id: String(s.id), ref: String(s.id), name: s.domain, url: s.url, groupId: null, listing: 'active', statusLabel: null, emphasis: 'full' })) ?? null),
groups: computed(() => []),
currentSite: computed(() => site.value ? { id: String(site.value.id), ref: String(site.value.id), name: site.value.domain, url: site.value.url, groupId: null, listing: 'active', statusLabel: null, emphasis: 'full' } : null),
user: computed(() => user.value ? { name: user.value.name, avatarUrl: user.value.avatarUrl } : null),
access: ability => caller.value?.role === 'owner' || ability === 'read' ? ACCESS_ALLOWED : accessDenied('Only the team owner can do this.'),
openFeedback: () => { feedbackOpen.value = true },
}
}Nav manifest
The sidebar is data. Each item links through a route map key (Route), a Site route key filled with the current Site (SiteRoute), or a path the site resolved itself (Path). A missing route or a refused gate hides the item, and a section with no items left hides. Every UiNavLink field except to passes through (badge, setup, stability, active).
type ProShellNavTarget
= | { _tag: 'Route', name: ProShellAppRoute, query?: Record<string, string> }
| { _tag: 'SiteRoute', name: ProShellSiteRoute, query?: Record<string, string> }
| { _tag: 'Path', to: string }
interface ProShellNavManifest {
pinnedLabel?: string
pinned: ProShellNavItem[] // { id, label, icon?, target, gate?: { feature?, ability? }, ...UiNavLink }
sections?: { id: string, label: string, items: ProShellNavItem[] }[]
railLabel?: string
rail?: ProShellNavItem[]
}gscdump.com
// app/app.config.ts
export default {
proShell: defineProShellConfig({
routes: { /* as above */ },
nav: {
collapseStorageKey: 'gscdump-nav-sections',
manifest: {
pinned: [
{ id: 'overview', label: 'Overview', icon: 'home', target: { _tag: 'SiteRoute', name: 'siteOverview' } },
],
sections: [{
id: 'search',
label: 'Search',
items: [
{ id: 'gsc', label: 'Search Console', icon: 'google', target: { _tag: 'SiteRoute', name: 'siteSearchConsole' } },
{ id: 'indexing', label: 'Indexing', icon: 'database', target: { _tag: 'SiteRoute', name: 'siteIndexing' } },
{ id: 'bing', label: 'Bing', icon: 'bing', target: { _tag: 'SiteRoute', name: 'siteBingIndexing' }, gate: { feature: 'bing' } },
],
}],
rail: [
{ id: 'members', label: 'Teammates', icon: 'users', target: { _tag: 'Route', name: 'teamMembers' }, gate: { ability: 'manage-members' } },
{ id: 'developers', label: 'Developers', icon: 'terminal', target: { _tag: 'Route', name: 'developers' } },
],
},
},
}),
}Request Indexing
export default {
proShell: defineProShellConfig({
routes: { /* as above */ },
nav: {
manifest: {
pinned: [
{ id: 'overview', label: 'Overview', icon: 'home', target: { _tag: 'SiteRoute', name: 'siteOverview' } },
{ id: 'indexing', label: 'Request indexing', icon: 'send', target: { _tag: 'SiteRoute', name: 'siteIndexing' } },
],
rail: [
{ id: 'sites', label: 'Sites', icon: 'globe', target: { _tag: 'Route', name: 'sites' } },
{ id: 'integrations', label: 'Integrations', icon: 'plug', target: { _tag: 'Route', name: 'integrations' } },
],
},
},
}),
}A manifest that changes with the page, such as one built from a feature registry, passes to <ProShellSidebarNav :manifest> instead. pathNavItems and pathNavSections turn links a site already resolved into items; nuxtseo.com does this with its pro-features registry. #header draws a block above the pinned rows, and #middle sits between the sections and the rail.
User menu
The site passes groups of items. An item links by to, by route map key (action: { _tag: 'Route', name }), or opens the feedback drawer through the Nav source (action: { _tag: 'Feedback', intent? }, labelled "Send feedback" unless the item names itself). team draws a Team avatar and active a check, for workspace rows. A personal Team's avatar draws its name's initials over the swatch. external: true makes a to link load the page fully, for a route the server handles, such as sign out. The sidebar avatar reads the account name as its alt, so it draws initials when there is no picture. A workspace switch that leaves the page binds v-model:switch-open and pending-workspace-label, and answers confirmSwitch and cancelSwitch.
const userMenu = [
[{ label: 'Workspace', type: 'label' }, { label: 'Teammates', icon: 'users', action: { _tag: 'Route', name: 'teamMembers' } }],
[{ label: 'Account', icon: 'user', to: '/app/settings/account' }],
[{ icon: 'megaphone', action: { _tag: 'Feedback' } }, { label: 'Sign out', icon: 'log-out', onSelect: signOut }],
]Ability gate
<ProShellAbilityGate ability="manage-sites"> draws its slot when the access adapter allows. A refusal disables the slot behind a tooltip with the adapter's reason, or hides it with mode="hide". Pass access as a prop, or let it read the Nav source's. With neither, it refuses.
Setup offers
The site builds the offers, the frame selects and draws them. buildSharedSetupOffers returns the shared five, each linked through the route map. The site passes each offer's Setup completion (pending, reconnect, complete, unknown, or unavailable) from its own data. A key it leaves out shows no card. The frame shows pending and reconnect offers only, at most four, lowest priority first. A dismissed offer hides; a reconnect offer ignores dismissal.
<script setup lang="ts">
import { readProShellConfig, useProShellCopy } from '../app/composables/useProShellCopy'
import { useProShellSetupDismissals } from '../app/composables/useProShellSetupDismissals'
import { buildSharedSetupOffers, SETUP_COMPLETE, SETUP_PENDING } from '../shared/setup-offers'
const { dismissedKeys, dismiss } = useProShellSetupDismissals()
const routes = readProShellConfig().routes ?? {}
const copy = useProShellCopy().setupOffers
const offers = computed(() => [
...myOwnOffers.value,
...buildSharedSetupOffers({
routes,
copy,
site: null,
completion: {
'skill': agentAccess.value.cli ? SETUP_COMPLETE : SETUP_PENDING,
'mcp': agentAccess.value.mcp ? SETUP_COMPLETE : SETUP_PENDING,
'api': agentAccess.value.api ? SETUP_COMPLETE : SETUP_PENDING,
'bing': bingCompletion.value,
'another-site': siteCount.value === 1 ? SETUP_PENDING : SETUP_COMPLETE,
},
}),
])
</script>
<template>
<ProShellSetupOffers :offers="offers" :dismissed="dismissedKeys" :loading="!ready" @dismiss="dismiss">
<template #site-mark>
<MyBrandIcon />
</template>
</ProShellSetupOffers>
</template>- A site's own offer is a
SetupOffer; give it aprioritybetween the shared ones (1 skill, 3 Bing, 4 MCP, 11 API, 13 Add another Site). - An offer whose action starts in place, such as an OAuth redirect, takes
action: { _tag: 'Run', pending }; the frame emitsrunwith the offer. proShell.setupOffers.hideleaves shared offers out on a site.proShell.setupOffers.dismissCookienames the cookie that remembers dismissals per browser.
Invite teammate
The dialog collects an email and an access level and calls the site's invite adapter. The adapter returns an InviteResult and never throws for an expected refusal. On Sent or Resent the dialog closes; every result shows a toast. inviteResultToast gives a site's own resend action the same toast.
type InviteResult
= | { _tag: 'Sent' }
| { _tag: 'Resent' }
| { _tag: 'Failed', message: string | null }
type InviteAdapter<Role extends string> = (email: string, role: Role) => Promise<InviteResult><ProShellInviteDialog
v-model:open="inviteOpen"
:invite="invite"
:roles="[{ value: 'viewer', label: 'Viewer' }, { value: 'editor', label: 'Editor' }]"
default-role="editor"
/>Pass schema for your own form validation, and fill #role="{ role, setRole }" for your own access picker. While the user has a role picked, its description shows under the default picker.
Send feedback
The site owns when the drawer opens (v-model:open), where it opened from (context), and the account. The drawer builds a FeedbackSubmitInput and calls the site's submit adapter. The site posts it to its own handler and validates it there with feedbackSubmitSchema from @nuxtseo/pro-shell/shared/contracts.
type FeedbackSubmitResult
= | { _tag: 'Sent' }
| { _tag: 'Failed', message: string | null }
type FeedbackSubmitAdapter = (input: FeedbackSubmitInput) => Promise<FeedbackSubmitResult>
type FeedbackHistoryResult
= | { _tag: 'Loaded', items: readonly FeedbackHistoryItem[], hasMore: boolean }
| { _tag: 'Failed', message: string | null }
type FeedbackHistoryAdapter = () => Promise<FeedbackHistoryResult><ProShellFeedbackDrawer
v-model:open="feedbackOpen"
:context="{ path: route.path, intent: 'bug' }"
:account="{ email: user.email, id: user.id }"
:submit="submit"
:load-history="loadHistory"
:collect-client-errors="recentErrors"
/>Pass load-history to show the Share / History tabs inside the drawer, listing the signed-in account's past submissions and their public resolution status and note. Omit it to show only the form. The #footer="{ replyAddress }" slot sits under the Send button, for a line about who reads the report.
Onboarding
A site registers its Onboarding Steps; the shell picks the current one, counts progress, and moves Next, Back and Skip. The current step lives in ?step=, so a reload, an OAuth round trip or a Checkout return lands on the same step. The shell stores nothing: a bare URL resumes from the Step states.
flowchart LR
P[site plugin] -- pro-shell:onboarding:step --> R[Step registry]
R --> F[useProShellOnboardingFlow]
C[site context] --> F
Q["?step="] <--> F
F --> X[resolveOnboarding]
F --> W[ProShellOnboardingFrame]
F -- navigate, finish --> S[site adapters]A step (ProShellOnboardingStep in shared/onboarding.ts):
| Field | Meaning |
| --- | --- |
| id | The ?step= value. Never changes. |
| flow | The flow it belongs to, such as first-run or dashboard-card. |
| order | Lower comes first. |
| titleKey | Key under proShell.copy.onboarding.steps: label (the rail), title, description, cta. |
| state(ctx) | Its Step state, from the site's data. |
| skip(ctx) | Optional. True offers Skip. Unset never does. |
| revisit | Optional, default true. False closes a finished step, such as sign-in. |
| component | Optional. Drawn in the frame. Without it, the page fills #step-<id>. |
| nav | frame (default) draws Back, Skip and Next. step leaves them to the step, which calls the slot's controls. |
| link | Optional { route, query } through the Route map, for a call to action outside the frame. |
Step states:
type OnboardingStepState
= | { _tag: 'Pending' } // the user owes it; the flow resumes at the first one
| { _tag: 'Complete' }
| { _tag: 'Optional' } // an offer; the flow passes it
| { _tag: 'Unknown' } // the site's read has not landed; nothing moves
| { _tag: 'NotApplicable' } // leaves the flow and the railResolution (resolveOnboarding, pure): with no ?step=, the current step is the first Pending one, and the flow reads Finished when none is. With a ?step=, the policy decides. Honour (the default) shows the step as asked. Hold keeps it between the first step the user may still open and the resume step, and the flow writes the held step back into the URL. A request for a closed step (Complete with revisit: false) differs by policy: Honour treats it as no request and resumes, and Hold treats it as a link back and holds at the first open step after it. So under Hold, ?step=sign-in while signed in stops at the step after sign-in, never past the resume step. While any state is Unknown, only a step the URL names shows; otherwise the flow reads Waiting. Next and Skip go to the following step, or call finish on the last one. Back opens the nearest earlier step that is not closed.
Register steps in a plugin. Augment the context with your own signals:
// app/plugins/onboarding-steps.ts
import type { Plugin } from '#app'
import { defineProShellOnboardingSteps } from '../app/composables/useProShellOnboarding'
import { STEP_COMPLETE, STEP_NOT_APPLICABLE, STEP_PENDING } from '../shared/onboarding'
declare module '@nuxtseo/pro-shell/shared/onboarding' {
interface ProShellOnboardingContext { grantBroken: boolean, siteCount: number }
}
// Annotated: the plugin types read the hooks it augments.
const plugin: Plugin = defineNuxtPlugin({
name: 'my-site:onboarding-steps',
setup: defineProShellOnboardingSteps([
{ id: 'connect-google', flow: 'first-run', order: 10, titleKey: 'connect-google', component: ConnectGoogleStep, state: ctx => ctx.grantBroken ? STEP_PENDING : STEP_NOT_APPLICABLE },
{ id: 'connect-sites', flow: 'first-run', order: 20, titleKey: 'connect-sites', component: ConnectSitesStep, skip: () => true, state: ctx => ctx.siteCount > 0 ? STEP_COMPLETE : STEP_PENDING },
]),
})
export default pluginDraw the flow on the page:
<script setup lang="ts">
const flow = useProShellOnboardingFlow({
steps: useProShellOnboardingSteps('first-run'),
context: signals, // a computed, or null while it loads
policy: REQUEST_HOLD, // optional
finish: () => completeOnboarding(), // a Shell adapter
})
</script>
<template>
<ProShellOnboardingSurface :show-exit="finishedBefore">
<template #brand>
<MyLogo />
</template>
<ProShellOnboardingFrame :flow="flow">
<template #after="{ step }">
<MyExitReason :step="step.id" />
</template>
</ProShellOnboardingFrame>
</ProShellOnboardingSurface>
</template>ProShellOnboardingSurfacewrapsUiWizardShell. Its slots are#brand(the site's mark; unset draws none),#account,#extras(between the mark and the frame) and the default slot.exit-toturns the exit into a link (exit-externalfor a full page load); unset, the exit emitsexit.ProShellOnboardingFrametakes theflow,surface(plainorcard),aside(reserve the side column),complete,progress, andnext-disabledandnext-loadingfor the frame's Next. Its slots are#step-<id>and#after(both with{ step, controls }),#aside,#waitingand#finished.- A step component gets
step(its copy, state and link) andcontrols(next,back,skip,go,select,finish). navigate(id)is the move adapter. The default writes?step=withrouter.replaceand keeps every other query key. Pass your own when the URL carries more state.state: { _tag: 'none' }keeps no URL state, for a surface such as a dashboard card that always shows the resume step.provideProShellOnboardingSteps(steps)in a parent's setup handsstepsto everyuseProShellOnboardingStepsbelow it, in place of the Step registry. A component test or a preview uses it and needs no stub.- Frame copy is under
proShell.copy.onboarding:progressLabel,next,finish,skip,waiting.
nuxtseo.com runs two flows. The dashboard-card flow is four plugins (subscribe, add-site, connect-gsc, connect-analytics); useOnboardingFlow in layers/saas builds their context and ProOnboardingCard draws the resume step. The first-run flow is FIRST_RUN_JOURNEY_STEPS in layers/saas/shared/onboarding-flow.ts; the page apps/pro/app/pages/pro/dashboard/teams/create.vue fills each #step-<id> slot and moves through its own goStep adapter, and the dashboard gate resumes from the same list.
Adopting on gscdump.com
gscdump's wizard gate maps onto one first-run flow under Hold, the policy chooseOnboardingStep implements today.
| gscdump today | Registry |
| --- | --- |
| ONBOARDING_STEPS in layers/pro-saas/shared/onboarding-flow.ts | Four steps, order 10 to 40 |
| sign-in | state: Complete when signed in, else Pending; revisit: false |
| connect-google, listed only while it applies | state: Pending when accountNextAction asks for Google, else NotApplicable |
| connect-sites | state: Complete once hasSites, else Pending; nav: 'step': its Skip finishes setup today, so the step calls controls.finish() for Skip and controls.next() for Continue |
| sync, terminal | state: Pending; Next calls finish |
| resolveOnboardingStep (resume and minimum) | REQUEST_HOLD |
| OnboardingAccount Pending and Failed | context null or Unknown states: the frame's #waiting; keep the Unavailable alert in #finished or the page |
| OnboardingConnectService (useOnboardingConnectService) | Unchanged. It stays the site's write seam; the step components inject it. finish becomes the flow's finish adapter |
| layers/pro-saas/app/layouts/onboarding.vue | ProShellOnboardingSurface with #brand <UiLogo /> and :show-exit="canExit" |
| decideOnboardingGate, app-onboarding.global.ts | Unchanged. The gate holds the user in the flow; the flow resolves the step |
- Register the four steps in a plugin in
layers/pro-saas/app/plugins/onboarding-steps.ts, withProShellOnboardingContextaugmented by{ loggedIn, accountNextAction, hasSites }. - Move each
<section>oflayers/pro-gsc/app/pages/app/onboarding.vueinto a step component beside the existingAppOnboarding*components, such asAppOnboardingStepSync.vue. Each readsuseOnboardingConnectService()and callscontrols. - In the page, build the context from
readOnboardingAccount(null whilePending), calluseProShellOnboardingFlow({ steps: useProShellOnboardingSteps('first-run'), context, policy: REQUEST_HOLD, finish: service.finish }), and drawProShellOnboardingFrame. DeletechooseOnboardingStep,resolveOnboardingStep,resolveOnboardingMinimumStep,visibleStepsand the?step=watcher. - Replace
layers/pro-saas/app/layouts/onboarding.vuewithProShellOnboardingSurface. - Move the step labels and headings into
proShell.copy.onboarding.stepsand the gscdump COPY.md. - Keep
resolveOnboardingResumeSteponly if the gate needs it, re-expressed over the registered steps, as nuxtseo's is.
The one visible change: a bare URL whose resume step is the first visible step stays bare instead of gaining ?step=.
Adopting on Request Indexing
Request Indexing hardcodes its dashboard step as a prop (ProOverviewOnboardingCard step="connect-site" and step="connect-search-console" in layers/pro-saas/app/pages/pro/dashboard/index.vue) and its wizard steps as a list (ONBOARDING_STEPS in layers/pro-saas/shared/onboarding.ts). Both map onto flows.
| Request Indexing today | Registry |
| --- | --- |
| ProOverviewOnboardingCard step="connect-site" | dashboard-card step connect-site: Pending while no Site, link: { route: 'addSite' } |
| step="connect-search-console" | dashboard-card step connect-search-console: Pending while Search Console is not connected and a Site exists, else Complete |
| connect, sites, sync wizard steps | first-run steps, order 10 to 30, REQUEST_HONOUR |
| resolveOnboardingResumeStep (hasSites outranks Google) | connect: Optional (ADR-0035) or Complete; sites: Pending until hasSites; sync: Pending |
| resolveOnboardingNav | connect with nav: 'step': it draws only Skip until connected, then only Continue |
| canSkipOnboardingSites | sites skip: ctx => !ctx.hasSites && ctx.connectBlocked |
| canAdvanceOnboardingStep | sites draws its own Next (nav: 'step') disabled until hasSites |
| ProOnboardingAnswers | Stays the site's own card in the sync step. UiOnboardingAnswers cannot draw it yet |
- Register both flows in
layers/pro-saas/app/plugins/onboarding-steps.ts, with the context augmented by{ gsc, hasSites, connectBlocked }. - In
layers/pro-saas/app/pages/pro/dashboard/index.vue, calluseProShellOnboardingFlow({ steps: useProShellOnboardingSteps('dashboard-card'), context, state: { _tag: 'none' } })and passflow.current.value?.idand itshrefto the card. Then makeProOverviewOnboardingCard(layers/pro-gsc/app/components/overview/) readstep.copyinstead of its two hardcoded branches. - In
layers/pro-saas/app/pages/pro/dashboard/onboarding.vue, replacestep,goStep,back,nextand the?step=watcher with the flow, and fill#step-connect,#step-sitesand#step-sync.finishis the flow'sfinishadapter;skipSitesstays the sites step's own action. - Replace the
pro-onboardinglayout's wizard chrome withProShellOnboardingSurfaceand the site's mark in#brand. - Delete
onboardingStepIndex,resolveOnboardingNavandcanAdvanceOnboardingStepfromlayers/pro-saas/shared/onboarding.ts. Keep the gate (resolveOnboardingGate), re-expressing its resume step over the registered steps. - Move
ONBOARDING_STEP_LABELSand the card copy intoproShell.copy.onboarding.stepsand the Request Indexing COPY.md.
Copy
Every string has a default in PRO_SHELL_COPY (shared/copy.ts), and COPY.md owns each one. Reword any key under proShell.copy in app.config.ts; unset keys keep the defaults. Placeholders in braces, such as {replyAddress}, are filled by the component.
export default {
proShell: defineProShellConfig({
copy: {
setupOffers: { skill: { body: 'Let your coding agent read your Search Console data.' } },
feedback: { sentDescription: 'Thanks. We reply to {replyAddress}.' },
},
}),
}Releasing
@nuxtseo/pro-shell releases with @nuxtseo/design-system and @nuxtseo/pro-indexing on the ui-v* tag, at the same version. Its peer range on the design system is ^<version>, and pnpm release:ui:check refuses anything else. The steps are in the design system README (Releasing): set the three versions, check, pack all three, smoke with the three tarballs, tag.
