Skip to content

fix(mcp-ui): shared project card for create-project and create-branch - #578

Merged
charislam merged 20 commits into
mainfrom
feat/project-card-views
Nov 20, 2026
Merged

charislam merged 20 commits into
mainfrom
feat/project-card-views

Conversation

@SaxonF

@SaxonF SaxonF commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Stacked on #573. Redesigns the create_project and create_branch views as one shared project card.

What changed

  • One card for both views. ProjectCard shows breadcrumbs (organization, and for a branch its project), the name, a status badge, the ref and region, and an Open in dashboard action. Connection details sit below once it is ready.
  • The badge names the current step ("Creating", "Checking health", "Running migrations", …) instead of a step list, then reads "Active" or "Failed". A failure says which step it failed on.
  • Retry. When status checks keep failing or the 10-minute timeout passes, a retry icon appears beside the badge and resumes polling. usePoll gains a restartKey for this.
  • Loading state. Before the tool result arrives, the card keeps its layout, filling in what the call's arguments say and showing skeletons for the rest.
  • Shared logic. useCreationStatus owns polling, Retry, the badge and note for each state, and the screen reader announcements. Each view supplies how to read its status and how a status maps to a step. ProgressView and StepStatus are removed.
  • Colours go through Studio's semantic tokens (--foreground, --border, --card, …). A bridge in the base layer maps the host's MCP Apps colour variables onto them, and pnpm lint:css fails on a host colour read anywhere else.
  • Two mock scenarios for the new states: create-project:health-checks and create-project:polling-down.

Why

  • The card matches the project card in the other Supabase surfaces, and still reads correctly when a conversation is reopened long after creation finished, where a list of completed steps does not.
  • Hosts disagree about what each MCP Apps colour variable means (Claude's --color-border-primary is a strong line, Codex's is a control outline). Mapping them once onto Studio's tokens keeps the views consistent across hosts and lets the components move into Studio unchanged. The table of choices is in the bridge's comment in styles.css.

Verification

  • pnpm --filter @supabase/mcp-ui test: 64 tests pass, including new view tests for both cards (steps, failure, Retry, timeout, loading skeletons, breadcrumbs).
  • pnpm --filter @supabase/mcp-ui build (typecheck and lint:css) passes.
  • Checked both views in MCP Inspector against the mock API (pnpm dev:mock): each steps through to Active and loads its connection details; the branch card shows "Organization / Project" above the branch name.

🤖 Generated with Claude Code

@SaxonF
SaxonF requested a review from a team as a code owner November 19, 2026 05:02
Comment thread packages/mcp-ui/scripts/check-css.mjs Resolved

@Rodriguespn Rodriguespn 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.

Approving from team-ai side to unblock you. Waiting on @charislam feedback on the design. The failing "Check Management API Types" job isn't from this PR: the upstream API spec changed. #579 fixes it, so it'll go green once that's merged and the stack is rebased on main.

@charislam
charislam deleted the branch feat/create-project-tools November 19, 2026 21:11
@charislam charislam closed this Nov 19, 2026
@charislam charislam reopened this Nov 19, 2026
@Rodriguespn Rodriguespn changed the title feat(mcp-ui): shared project card for create-project and create-branch fix(mcp-ui): shared project card for create-project and create-branch Nov 20, 2026
SaxonF and others added 18 commits November 20, 2026 12:23
`create-project:health-checks` passes through ACTIVE_UNHEALTHY so the
"Checking health" step is visible. `create-project:polling-down` fails the
first three polls so the view stops checking and offers Retry.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Both views now render the same `ProjectCard`, after the project card in the
other Supabase surfaces: breadcrumbs (organization, then for a branch its
project), name, a status badge that names the current step, the ref and
region, and an Open in dashboard action. Connection details stay below once
it is ready.

`useCreationStatus` holds what the views share: polling, Retry once checking
has stopped, the badge and note for each state, and the screen reader
announcements. Each view supplies how to read its status and how a status
maps to a step. This replaces `ProgressView` and `StepStatus`, which are
removed along with their styles.

Colours now go through Studio's semantic tokens, prefixed `--sb-color-`
(`--sb-color-foreground`, `--sb-color-border`, …). A bridge in `base` maps
the host's MCP Apps colour variables onto them, picking for each token the
variable that means the same thing in Claude, Codex and Inspector, so the
components can move into Studio unchanged. `pnpm lint:css` fails on a host
colour read outside the bridge, or a `--sb-color-*` token declared outside
`base`.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
- Add optional `resultMeta` on `Tool` in `@supabase/mcp-utils`, merged onto `tools/call` results without changing `onToolCall` data.
- Attach the server's normalised `dashboardUrl` (defaulting to `DEFAULT_DASHBOARD_URL`) to MCP Apps tool results via `supabase.com/dashboardUrl`.
- Read `dashboardUrl` from result `_meta` in `useMcpView` (falling back to prod for older servers) and thread it through `CreateProject`, `CreateBranch`, and `ReadyActions`.
`useLookup` kept the latest `load` in a ref, updated by an effect after
every render, so the fetch effect could call it without re-running when it
changed. `useEffectEvent` does this directly. It is stable from React 19.2,
so the React ranges now start there; the installed versions already match.

`useMachine` keeps its ref: `run` is called from `send`, which event
handlers call, and an effect event may only be called from effects.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each view rendered a `<div className="<name>-view">` so view-specific CSS
could nest under it. Views now ship only their own CSS, so a `view.css`
already applies to that view alone and needs no wrapper to scope it. The
views render `ProjectCard` directly.

The `view` layer, `view.css` and the `--sb-view-<view>-*` namespace stay: a
view that needs its own CSS chooses its own selectors, within the layer's
cap of one class. SKILL.md and the README now say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The lint recognised host colours only by their `--color-` prefix, so a
misspelt name in the bridge (`var(--color-text-primay, …)`) passed, and
every host silently got the fallback. It now loads the names a host may
send from ext-apps' schema (`McpUiStyleVariableKey`) and fails on a host
colour read, or a host variable fallback declared in `base.css`, whose name
isn't one of them.

Suggested by Pedro in review of #578.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rver

A server scoped to the parent project has no `get_project`, so the lookup
failed on every create-branch view, and each failure counted as a tool
error in the hosted metrics. The view already knows when the server is
scoped, so it no longer asks; the card shows no breadcrumbs, as before.

Adds tests for the lookups failing: no breadcrumbs when the parent project
can't be read, only the project when its organization can't, and no
organization for a new project when it can't be read.

Suggested by Pedro in review of #578.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Checking stopped only at done or failed, so a status that won't move on by
itself (a paused project, say) was read every 5 seconds until the 10 minute
timeout, with no spinner on its badge to say the view was still checking.
Such a status now settles checking too, so the spinner and the polling
agree.

Suggested by Pedro in review of #578.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…op round

At most one read is ever in flight: following schedules the next read only
after a result, checking stops only on a result, and Retry does a single
read. A result therefore always belongs to the current state, so the round
counter could never tell results apart.

Events are now start, read, readFailed and retry, and read/readFailed mean
what the state says (following, or the read Retry started). The two read
effects become one, and the effect runner has a single path from a result
or error to its event.
…fect

The checking machine described its reads as effects for a generic runner to
schedule, cancel and replay. A reducer and one effect do the same with less:
the reducer returns only the next state, the pending delay is part of the
following state, and a single effect keyed on the state reads after that
delay. Its cleanup clears the timer and drops a result that arrives after
the state has moved on or the view is gone.

That leaves ConnectionDetails as the only user of useMachine, and its
effects need no cleanup, so useMachine returns to its simpler form and the
tests for its cleanup machinery go with it. Tests that ran several polls in
one advance now step one interval at a time, since each read is scheduled
after the previous result has rendered.
Choosing the badge, note and announcement was mixed in with the checking
machine, and used a cast and a non-null assertion to get at the progress
and data that only exist once the tool call is ready.

describeCreation is now a pure function that switches on the tool call's
status first, so in the ready case the data and its progress are always
there. useCreationStatus runs the checking and composes it with the
announcements. The cases that were covered only through the views now also
have direct unit tests.
canPollInitial and read always went together: the status can be read exactly
when the view has a way to read it. Leaving read out now means it can't be
read: checking never starts, there is no Retry, and a status that is still
changing gets the note to ask the assistant to check.

Each view's per-status constants (noun, step labels, progress, the tool to
check with) are one config exported from its status.ts and passed as a
single prop.
Both views repeated the same string-argument helper and the checks for
whether the host can call tools or open links.

useMcpView now returns canCallTools, inputText(key) and openLink(url).
openLink is undefined when the host can't open links, so there is no
separate flag to keep in step with it. Studio links stay with the views,
since each view decides which dashboard page it links to: ConnectionDetails
takes the project's URL from the view instead of building it from the
dashboard URL (it no longer exports studioUrl). It takes the view with the
project ref instead of the app and link capability separately, and the
card's name fallback is one cardName helper.
The badge tone union was written out in four places; Badge now exports Tone
and the others use it, narrowed where danger isn't possible.

useCreationStatus returns the ProjectCard props it owns (badge, note, retry,
loading) as card, so views spread it instead of pulling out isLoading and
passing it back. isLoading stays available for the details and name.
… flags

Every tool call checked canCallTools and then asserted app!, and
ConnectionDetails took a second flag, canReachProject, for whether calls
for its project were allowed.

useMcpView now returns callTool, undefined when the host can't proxy tool
calls, in place of canCallTools. Views pass it (or, on a server scoped to
the branch's parent, nothing) to useCreationStatus's read, their lookups
and ConnectionDetails, so the flags and non-null assertions go.
mcpViewHelpers is no longer exported: the view tests mock callTool on the
view directly.
progress returned indexes into the config's labels, which describeCreation
looked up with non-null assertions. The first label could never be
returned: it only made labels.length the step total.

A step now carries its label and its place (step of total), and a failure
names the step it failed during. Each status.ts builds them with a small
helper, and CreationConfig loses labels. The badge, note and announcement
text are unchanged.
shared/project-status.ts had one caller, which overrode its tone for
changing statuses, and its failure and ACTIVE_* labels were never reached:
progress handles those statuses first.

create-project/status.ts now reads one table of the statuses that do reach
the fallthrough, each with its Studio label and whether it moves on by
itself; any other status keeps the derived label and warning tone. The
results are unchanged.
Each view worked out its details and name for the loading, ready and
failed cases (CreateProject with a three-level ternary) and passed
isLoading back to the card that already had it.

ProjectCard now applies one rule: a detail or name without a value is a
skeleton while loading, and after that a detail is left out and the name
falls back to "New <noun>". Views pass flat details and the created or
requested name, cardName goes, and useCreationStatus hands the card its
noun and no longer returns a separate isLoading.
@charislam
charislam force-pushed the feat/project-card-views branch from 469c763 to 7afce44 Compare November 20, 2026 19:10
@charislam
charislam changed the base branch from feat/create-project-tools to main November 20, 2026 19:11
@charislam
charislam merged commit efe189f into main Nov 20, 2026
6 checks passed
@supabase-releaser supabase-releaser Bot mentioned this pull request Nov 20, 2026
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 44809496095

Coverage increased (+0.005%) to 98.146%

Details

  • Coverage increased (+0.005%) from the base build.
  • Patch coverage: 18 of 18 lines across 4 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 6340
Covered Lines: 6245
Line Coverage: 98.5%
Relevant Branches: 1373
Covered Branches: 1325
Branch Coverage: 96.5%
Branches in Coverage %: Yes
Coverage Strength: 294.35 hits per line

💛 - Coveralls

barryroodt pushed a commit that referenced this pull request Nov 26, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>mcp-utils: 0.11.1</summary>

##
[0.11.1](mcp-utils-v0.11.0...mcp-utils-v0.11.1)
(2026-11-26)


### Bug Fixes

* **mcp-ui:** shared project card for create-project and create-branch
([#578](#578))
([efe189f](efe189f))
</details>

<details><summary>mcp-server-supabase: 0.20.0</summary>

##
[0.20.0](mcp-server-supabase-v0.19.0...mcp-server-supabase-v0.20.0)
(2026-11-26)


### Features

* **debugging:** add project issues DEBUG-311
([#546](#546))
([01f8021](01f8021))
* **mcp-server-supabase:** add optional schemas parameter to
generate_typescript_types
([#592](#592))
([7532f53](7532f53))


### Bug Fixes

* **debugging:** link docs once per issue in get_issues
([#610](#610))
([74801d8](74801d8))
* **mcp-server-supabase:** detect import maps uploaded with a ./ prefix
([#591](#591))
([6b8f4dc](6b8f4dc))
* **mcp-server-supabase:** keep a declined or cancelled SQL confirmation
final ([#581](#581))
([03afe8e](03afe8e))
* **mcp-server-supabase:** match Studio's notebook row_limit and clarify
skip and blank-input messages
([#593](#593))
([ad07f1b](ad07f1b))
* **mcp-server-supabase:** skip cost confirmation for $0 projects on
clients without forms
([#608](#608))
([50cfc37](50cfc37))
* **mcp-server-supabase:** stop reusing a removed import map on edge
function redeploy ([#588](#588))
([56093a6](56093a6))
* **mcp-ui:** shared project card for create-project and create-branch
([#578](#578))
([efe189f](efe189f))
* **mcp:** confirm UPDATEs without WHERE that follow a comment and set a
dollar-quoted value ([#612](#612))
([468907a](468907a))
* **mcp:** confirm UPDATEs without WHERE that use inheritance syntax
([#565](#565))
([687b3ee](687b3ee))
* **mcp:** confirm UPDATEs without WHERE when a column name ends in
where ([#557](#557))
([57fa34b](57fa34b))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: supabase-releaser[bot] <223506987+supabase-releaser[bot]@users.noreply.github.com>
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.

4 participants