Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(studio): move CLI login to connect interstitial#45814

Open
dnywh wants to merge 1 commit into
dnywh/fix/organisation-invite-state-utilsfrom
dnywh/feat/cli-login-interstitial
Open

feat(studio): move CLI login to connect interstitial#45814
dnywh wants to merge 1 commit into
dnywh/fix/organisation-invite-state-utilsfrom
dnywh/feat/cli-login-interstitial

Conversation

@dnywh
Copy link
Copy Markdown
Contributor

@dnywh dnywh commented May 12, 2026

What kind of change does this PR introduce?

Feature / UI refactor

What is the current behaviour?

The CLI browser login route still uses the older API authorisation layout and redirects missing or failed sign-in session states to generic 404/500 pages.

What is the new behaviour?

Moves /cli/login onto the shared connect interstitial layout as the next small stacked slice after the organisation invite work.

This keeps the real CLI login contract intact while updating the surface:

  • creates the CLI login session from session_id, public_key, and optional token_name
  • redirects to the generated device_code
  • renders missing-parameter and session-creation failures in-card instead of redirecting away
  • keeps the 8-character verification code selectable and copyable as a single string
  • uses a full-width primary Copy code action

This also adds the small shared interstitial helpers needed by this surface and adjusts CopyButton so the copied check icon inherits the primary button colour instead of turning green.

This also removes the CLI version admonition:

Browser login flow requires Supabase CLI version 1.219.0 and above.

I checked with our stats and the CLI team. The vast majority of users are on a newer version.

Before After
Authorize API access  Supabase-D1E3CF26-BD59-4BB2-B457-B552EE47E3DA Authorize CLI  Supabase-C9977F21-88B8-441B-8A2C-09A9515935B0
Supabase-F42FBEAF-F74D-4920-8A51-7C25004F66D5 Authorize CLI  Supabase-8159A1B1-2594-4183-AC35-FEF1EFD4EA37
Supabase-2506E468-9F42-44B9-A5B7-BC4D3777F552 Authorize CLI  Supabase-A0EE1239-A345-427C-9CF7-997037A8FC0E
Authorize API access  Supabase-A7B84CA6-D230-4C3E-9227-DE21CE35375C Authorize CLI  Supabase-F55E26B2-609B-449C-9C64-08AA90AE3D1E

Testing instructions

Use the Vercel preview URL for this PR once it is available. The examples below use <preview-origin> as a placeholder, for example https://studio-git-dnywh-feat-cli-login-interstitial-supabase.vercel.app.

You need to be signed in to Studio to see these states because /cli/login is still behind withAuth.

Ready state:

  • Open <preview-origin>/cli/login?device_code=ABCD1234
  • Check the page title is Authorize CLI | Supabase
  • Check the card title is Authorize Supabase CLI
  • Check the code fills the width, uses the normal sans font, and can be selected
  • Drag-select the code and copy it; the clipboard should contain ABCD1234, not one character per line
  • Click Copy code; the button should show the usual copied success state without a green check icon on the primary button

Missing parameters state:

  • Open <preview-origin>/cli/login
  • Check the card says Missing sign-in parameters and names the missing session_id and public_key parameters
  • Open <preview-origin>/cli/login?session_id=session-test
  • Check it still stays in-card and names the missing public_key parameter instead of redirecting to /404

Creation error state:

  • Open <preview-origin>/cli/login?session_id=not-real&public_key=not-real&token_name=local-dev
  • Check it stays in-card with Unable to create CLI sign-in instead of redirecting to /500
  • The exact error detail can vary by environment; the important bit is that the failure is shown inside the interstitial card

Loading state:

  • This is transient because there are no production mocks in this slice
  • To inspect it manually, throttle the browser network before opening a session-creation URL such as <preview-origin>/cli/login?session_id=not-real&public_key=not-real

Real CLI flow:

  • Run the browser login flow from Supabase CLI as usual
  • When the CLI opens a Studio URL, keep the path and query string but replace the origin with the PR preview origin
  • The page should create the login session and then route to /cli/login?device_code=<8 character code>
  • Enter that 8-character code back in the CLI prompt

Summary by CodeRabbit

Release Notes

  • New Features

    • Added LogoPair component for displaying paired logos or content with visual separator.
    • Redesigned CLI login screen with improved state management and clearer error messaging.
  • Improvements

    • Enhanced copy button styling consistency across different contexts.
  • Tests

    • Added comprehensive test coverage for copy button behavior and CLI login workflow.

Review Change Stack

@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

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

Project Deployment Actions Updated (UTC)
studio-self-hosted Ready Ready Preview, Comment May 12, 2026 5:20am
studio-staging Ready Ready Preview, Comment May 12, 2026 5:20am
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored May 12, 2026 5:20am
design-system Skipped Skipped May 12, 2026 5:20am
docs Skipped Skipped May 12, 2026 5:20am
ui-library Skipped Skipped May 12, 2026 5:20am
zone-www-dot-com Skipped Skipped May 12, 2026 5:20am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • develop

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: e084b381-eb97-480e-ab4b-c13c2e2dcadd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dnywh/feat/cli-login-interstitial

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@supabase
Copy link
Copy Markdown

supabase Bot commented May 12, 2026

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@dnywh dnywh changed the title Move CLI login to connect interstitial feat(studio): move CLI login to connect interstitial May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

🎭 Playwright Test Results

passed  207 passed
skipped  5 skipped

Details

stats  212 tests across 23 suites
duration  4 minutes, 52 seconds
commit  861eb32

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@dnywh dnywh force-pushed the dnywh/feat/cli-login-interstitial branch from ec69f0b to 861eb32 Compare May 12, 2026 05:16
Comment on lines +92 to +99
export const LogoPair = ({ left, right }: { left: ReactNode; right: ReactNode }) => (
<div className="flex items-center justify-center gap-2.5">
{left}
<ArrowRightLeft className="size-4 text-foreground-muted" />
{right}
</div>
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reusable for future connection surfaces, like the app authorization step.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

General changes. The green check/tick was not legible on a green button.

After
Image

@dnywh dnywh marked this pull request as ready for review May 12, 2026 05:30
@dnywh dnywh requested a review from a team as a code owner May 12, 2026 05:30
Comment on lines +132 to 148
const withInterstitial = ({
title,
description,
children,
}: {
title: ReactNode
description?: ReactNode
children: ReactNode
}) => (
<InterstitialLayout
logo={<LogoPair left={<CliLogo />} right={<SupabaseLogo />} />}
title={title}
description={description}
>
<div className="px-6 pb-6">{children}</div>
</InterstitialLayout>
)
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.

nit but I don't really get the point of having a function to render this layout. Why not simply wrap each return in the component directly?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It’s abstracted because there are ~4 states to render. Can just repeat <InterstitialLayout> if that’s preferred?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  • loading
  • missing params
  • error
  • ready with verification code

Copy link
Copy Markdown
Contributor

@djhi djhi May 12, 2026

Choose a reason for hiding this comment

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

I mean, JSX is already an abstraction over simple functions, we probably don't need another one. Besides, it only saves you 7 lines. If you don't want to repeat the div inside InterstitialLayout, you should probably introduce a new component instead of a function. That would be better for React rerenders too

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.

2 participants