The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 14:30 UTC
fix(web): pairing, connect, error, and Clerk sign-in surfaces match the app's dialog style (#25281)
maria committed
Oct 27, 2026 at 22:33 UTC
1cf14a498fa27712a305097012c6f8f920a6da33
11 files changed
+64
-155
apps/web/src/components/SidebarStageBackdrop.tsx
+1
-1
@@ -60,7 +60,7 @@ export function SidebarStageBackdrop({ variant }: { variant: SidebarStageBackdro
60
);
61
}
62
63
-export function StageBackdropArt({ variant }: { variant: SidebarStageBackdropVariant }) {
63
+function StageBackdropArt({ variant }: { variant: SidebarStageBackdropVariant }) {
64
return variant === "nightly" ? <NightlySkyArt /> : <DevBlueprintArt />;
65
}
66
apps/web/src/components/auth/AuthSurfaceShell.tsx
deleted
-37
@@ -1,37 +0,0 @@
1
-import type { ReactNode } from "react";
2
-
3
-import { APP_DISPLAY_NAME, APP_STAGE_LABEL } from "../../branding";
4
-import { resolveSidebarStageBackdropVariant, StageBackdropArt } from "../SidebarStageBackdrop";
5
-import { StandalonePage } from "../ui/standalone-page";
6
-
7
-export function AuthSurfaceShell({ children }: { readonly children: ReactNode }) {
8
- const stageVariant = resolveSidebarStageBackdropVariant(APP_STAGE_LABEL);
9
-
10
- return (
11
- <StandalonePage
12
- tone="brand"
13
- masthead={
14
- <header className="relative h-24 overflow-hidden bg-[linear-gradient(135deg,#1e61de,#17348e)] text-white">
15
- {stageVariant ? (
16
- <div className="absolute inset-0" aria-hidden>
17
- <StageBackdropArt variant={stageVariant} />
18
- </div>
19
- ) : (
20
- <div
21
- aria-hidden
22
- className="absolute inset-0 bg-[radial-gradient(circle_at_75%_25%,rgba(136,204,255,0.5),transparent_38%),linear-gradient(135deg,#2468df,#172f82)]"
23
- />
24
- )}
25
- <div className="absolute inset-0 bg-[linear-gradient(to_bottom,transparent_20%,rgba(7,18,55,0.46)_100%)]" />
26
- <div className="relative h-full p-5 sm:p-6">
27
- <p className="text-3xs font-semibold tracking-widest text-white/80 uppercase">
28
- {APP_DISPLAY_NAME}
29
- </p>
30
- </div>
31
- </header>
32
- }
33
- >
34
- {children}
35
- </StandalonePage>
36
- );
37
-}
apps/web/src/components/auth/ConnectAgentSurface.tsx
+8
-14
@@ -22,7 +22,7 @@ import { Button } from "../ui/button";
22
import { Input } from "../ui/input";
23
import { RadioGroup } from "../ui/radio-group";
24
import { Spinner } from "../ui/spinner";
25
-import { AuthSurfaceShell } from "./AuthSurfaceShell";
25
+import { StandalonePage, StandalonePageHeader } from "../ui/standalone-page";
26
27
export const accessConfig: Record<
28
AuthMcpClientAccess,
@@ -138,24 +138,24 @@ export function ConnectAgentSurface() {
138
139
if (loaded.status === "loading") {
140
return (
141
- <AuthSurfaceShell>
141
+ <StandalonePage>
142
<ConnectAgentHeading
143
title="Checking the sign-in request"
144
description="One moment while this environment verifies the agent's request."
145
/>
146
<Spinner className="mt-6" size="lg" tone="muted" />
147
- </AuthSurfaceShell>
147
+ </StandalonePage>
148
);
149
}
150
151
if (loaded.status === "invalid") {
152
return (
153
- <AuthSurfaceShell>
153
+ <StandalonePage>
154
<ConnectAgentHeading title="This sign-in cannot continue" description={loaded.message} />
155
<p className="mt-4 text-sm text-muted-foreground">
156
Close this page and start the sign-in again from your agent.
157
</p>
158
- </AuthSurfaceShell>
158
+ </StandalonePage>
159
);
160
}
161
@@ -164,7 +164,7 @@ export function ConnectAgentSurface() {
164
const canApprove = pending === null && (oneClick || pairingCode.trim().length > 0);
165
166
return (
167
- <AuthSurfaceShell>
167
+ <StandalonePage>
168
<ConnectAgentHeading
169
title={`Connect ${details.clientName}`}
170
description={
@@ -259,7 +259,7 @@ export function ConnectAgentSurface() {
259
</Button>
260
</div>
261
</form>
262
- </AuthSurfaceShell>
262
+ </StandalonePage>
263
);
264
}
265
@@ -270,13 +270,7 @@ function ConnectAgentHeading({
270
readonly title: string;
271
readonly description: ReactNode;
272
}) {
273
- return (
274
- <>
275
- <p className="text-3xs font-semibold tracking-widest text-primary uppercase">Agent sign-in</p>
276
- <h1 className="mt-2 text-2xl font-semibold tracking-tight sm:text-3xl">{title}</h1>
277
- <p className="mt-2 text-sm leading-relaxed text-muted-foreground">{description}</p>
278
- </>
279
- );
273
+ return <StandalonePageHeader context="Agent sign-in" title={title} description={description} />;
274
}
275
276
function AccessOption({
apps/web/src/components/auth/PairingRouteSurface.tsx
+3
-7
@@ -3,7 +3,6 @@ import type { AuthSessionState } from "@t3tools/contracts";
3
import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
4
import React, { startTransition, useEffect, useEffectEvent, useRef, useState } from "react";
5
6
-import { APP_DISPLAY_NAME } from "../../branding";
6
import { connectPairing } from "../../connection/onboarding";
7
import {
8
peekPairingTokenFromUrl,
@@ -18,9 +17,8 @@ import { useAtomCommand } from "../../state/use-atom-command";
17
18
export function PairingPendingSurface() {
19
return (
21
- <StandalonePage tone="pairing">
20
+ <StandalonePage>
21
<StandalonePageHeader
23
- eyebrow={APP_DISPLAY_NAME}
22
title="Pairing with this environment"
23
description="Validating the pairing link and preparing your session."
24
/>
@@ -84,9 +82,8 @@ export function PairingRouteSurface({
82
}, [autoPairToken]);
83
84
return (
87
- <StandalonePage tone="pairing">
85
+ <StandalonePage>
86
<StandalonePageHeader
89
- eyebrow={APP_DISPLAY_NAME}
87
title="Pair with this environment"
88
description={describeAuthGate(auth.bootstrapMethods)}
89
/>
@@ -208,9 +205,8 @@ export function HostedPairingRouteSurface() {
205
}, []);
206
207
return (
211
- <StandalonePage tone="pairing">
208
+ <StandalonePage>
209
<StandalonePageHeader
213
- eyebrow={APP_DISPLAY_NAME}
210
title={
211
status === "paired"
212
? "Backend paired"
apps/web/src/components/clerk/clerkAppearance.ts
+20
@@ -1,7 +1,17 @@
1
import type { ClerkProviderProps } from "@clerk/react";
2
3
+// Scoped to auth flows: UserProfile reuses formButtonPrimary for destructive confirmations.
4
+const authFlowElements = {
5
+ formButtonPrimary:
6
+ "border-primary bg-primary bg-none text-primary-foreground shadow-xs shadow-primary/24 hover:bg-primary/90 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",
7
+};
8
+
9
export const clerkAppearance = {
10
+ // index.css orders this layer below components and utilities so the element classes below win.
11
+ cssLayerName: "clerk",
12
+ options: { shimmer: false },
13
variables: {
14
+ borderRadius: "0.5rem",
15
// Clerk reuses its primary color for filled buttons and bare links.
16
colorPrimary: "var(--update-foreground)",
17
colorPrimaryForeground: "var(--card)",
@@ -19,10 +29,20 @@ export const clerkAppearance = {
29
colorRing: "var(--ring)",
30
},
31
elements: {
32
+ modalBackdrop: "dialog-backdrop",
33
+ cardBox: "dialog-glass rounded-2xl border",
34
+ card: "border-0 bg-transparent shadow-none",
35
+ footer: "bg-transparent bg-none",
36
+ header: "items-start text-start",
37
+ headerTitle: "text-xl font-semibold",
38
+ headerSubtitle: "text-sm text-muted-foreground",
39
+ buttonArrowIcon: "hidden",
40
formFieldErrorText: { color: "var(--error-foreground)" },
41
formFieldWarningText: { color: "var(--warning-foreground)" },
42
formFieldSuccessText: { color: "var(--success-foreground)" },
43
otpCodeFieldErrorText: { color: "var(--error-foreground)" },
44
otpCodeFieldSuccessText: { color: "var(--success-foreground)" },
45
},
46
+ signIn: { elements: authFlowElements },
47
+ signUp: { elements: authFlowElements },
48
} satisfies NonNullable<ClerkProviderProps["appearance"]>;
apps/web/src/components/cloud/ConnectCliAuthSurface.tsx
+9
-29
@@ -7,32 +7,12 @@ import {
7
connectCliSignInRedirectUrl,
8
} from "../../cloud/connectCliAuth";
9
import { isElectron } from "../../env";
10
-import { AuthSurfaceShell } from "../auth/AuthSurfaceShell";
10
+import { StandalonePage, StandalonePageHeader } from "../ui/standalone-page";
11
import { resolveClerkSignInProps } from "../clerk/authRedirect";
12
import { Button } from "../ui/button";
13
14
-function ConnectCliAuthMessage({
15
- eyebrow,
16
- title,
17
- description,
18
-}: {
19
- readonly eyebrow?: string;
20
- readonly title: string;
21
- readonly description: string;
22
-}) {
23
- return (
24
- <>
25
- {eyebrow ? (
26
- <p className="text-3xs font-semibold tracking-widest text-primary uppercase">{eyebrow}</p>
27
- ) : null}
28
- <h1 className="mt-2 text-2xl font-semibold tracking-tight sm:text-3xl">{title}</h1>
29
- <p className="mt-2 text-sm leading-relaxed text-muted-foreground">{description}</p>
30
- </>
31
- );
32
-}
33
-
14
const invalidLinkMessage = {
35
- eyebrow: "Authorization request",
15
+ context: "Authorization request",
16
title: "This connect link is incomplete",
17
description:
18
"The link is missing its authorization request. Re-run `t3 connect` in your terminal and open the freshly printed URL.",
@@ -79,16 +59,16 @@ export function ConnectCliAuthorizeSurface() {
59
60
if (!request) {
61
return (
82
- <AuthSurfaceShell>
83
- <ConnectCliAuthMessage {...invalidLinkMessage} />
84
- </AuthSurfaceShell>
62
+ <StandalonePage>
63
+ <StandalonePageHeader {...invalidLinkMessage} />
64
+ </StandalonePage>
65
);
66
}
67
68
return (
89
- <AuthSurfaceShell>
90
- <ConnectCliAuthMessage
91
- eyebrow="Browser authorization"
69
+ <StandalonePage>
70
+ <StandalonePageHeader
71
+ context="Browser authorization"
72
title="Connecting your terminal"
73
description={
74
isSignedIn
@@ -103,6 +83,6 @@ export function ConnectCliAuthorizeSurface() {
83
</Button>
84
</div>
85
) : null}
106
- </AuthSurfaceShell>
86
+ </StandalonePage>
87
);
88
}
apps/web/src/components/promptLinks/HostedPromptLinkLanding.tsx
+4
-9
@@ -9,7 +9,7 @@ import { useLocation } from "@tanstack/react-router";
9
import * as Schema from "effect/Schema";
10
import { type ReactNode, useEffect, useRef, useState } from "react";
11
12
-import { APP_DISPLAY_NAME, DESKTOP_DOWNLOAD_URL } from "~/branding";
12
+import { DESKTOP_DOWNLOAD_URL } from "~/branding";
13
import { useLocalStorage } from "~/hooks/useLocalStorage";
14
import { isHostedStaticApp } from "~/hostedPairing";
15
import { useEnvironments } from "~/state/environments";
@@ -112,21 +112,16 @@ function HostedPromptLinkLanding({
112
113
if (!summary.ok) {
114
return (
115
- <StandalonePage tone="error">
116
- <StandalonePageHeader
117
- eyebrow={APP_DISPLAY_NAME}
118
- title="Could not open the link"
119
- description={summary.error}
120
- />
115
+ <StandalonePage>
116
+ <StandalonePageHeader title="Could not open the link" description={summary.error} />
117
</StandalonePage>
118
);
119
}
120
121
const { prompt, details } = summary.value;
122
return (
127
- <StandalonePage tone="brand">
123
+ <StandalonePage>
124
<StandalonePageHeader
129
- eyebrow={APP_DISPLAY_NAME}
125
title="Open this prompt"
126
description="It opens as a draft. Nothing runs until you press Send."
127
/>
apps/web/src/components/ui/standalone-page.tsx
+15
-47
@@ -1,68 +1,36 @@
1
import type { ReactNode } from "react";
2
3
-const backdropClassNames = {
4
- pairing:
5
- "absolute inset-x-0 top-0 h-44 bg-[radial-gradient(44rem_16rem_at_top,color-mix(in_srgb,var(--color-emerald-500)_14%,transparent),transparent)]",
6
- error:
7
- "absolute inset-x-0 top-0 h-44 bg-[radial-gradient(44rem_16rem_at_top,color-mix(in_srgb,var(--color-red-500)_16%,transparent),transparent)]",
8
- brand:
9
- "absolute inset-x-0 top-0 h-72 bg-[radial-gradient(48rem_20rem_at_top,color-mix(in_srgb,var(--color-blue-500)_12%,transparent),transparent)]",
10
-};
3
+import { T3Wordmark } from "../T3Wordmark";
4
12
-export function StandalonePage({
13
- tone,
14
- masthead,
15
- children,
16
-}: {
17
- readonly tone: keyof typeof backdropClassNames;
18
- readonly masthead?: ReactNode;
19
- readonly children: ReactNode;
20
-}) {
5
+export function StandalonePage({ children }: { readonly children: ReactNode }) {
6
return (
7
// The page owns scrolling because root cannot scroll; safe centering keeps oversized cards top-aligned.
23
- <div className="relative h-full overflow-hidden bg-background text-foreground">
24
- <div className="pointer-events-none absolute inset-0 opacity-80" aria-hidden>
25
- <div className={backdropClassNames[tone]} />
26
- {tone === "pairing" ? (
27
- <div className="absolute inset-y-0 left-0 w-72 bg-[radial-gradient(28rem_18rem_at_left,color-mix(in_srgb,var(--color-sky-500)_10%,transparent),transparent)]" />
28
- ) : null}
29
- <div
30
- className={
31
- tone === "brand"
32
- ? "absolute inset-0 bg-[linear-gradient(145deg,color-mix(in_srgb,var(--background)_94%,var(--color-black))_0%,var(--background)_62%)]"
33
- : "absolute inset-0 bg-[linear-gradient(145deg,color-mix(in_srgb,var(--background)_90%,var(--color-black))_0%,var(--background)_55%)]"
34
- }
35
- />
36
- </div>
37
-
38
- <div className="relative flex h-full items-center-safe justify-center overflow-y-auto scrollbar-gutter-both px-4 py-10 sm:px-6">
39
- <section
40
- className={`relative w-full max-w-xl rounded-2xl border border-border/80 shadow-2xl shadow-black/20 backdrop-blur-md ${tone === "brand" ? "overflow-hidden bg-card/94" : "bg-card/90"}`}
41
- >
42
- {masthead}
43
- <div className="p-6 sm:p-8">{children}</div>
44
- </section>
45
- </div>
8
+ <div className="flex h-full items-center-safe justify-center overflow-y-auto scrollbar-gutter-both bg-background px-4 py-10 text-foreground sm:px-6">
9
+ <section className="dialog-glass w-full max-w-xl rounded-2xl border p-6">{children}</section>
10
</div>
11
);
12
}
13
14
export function StandalonePageHeader({
51
- eyebrow,
15
+ context,
16
title,
17
description,
18
}: {
55
- readonly eyebrow: ReactNode;
19
+ readonly context?: ReactNode;
20
readonly title: ReactNode;
21
readonly description: ReactNode;
22
}) {
23
return (
24
<>
61
- <p className="text-[11px] font-semibold tracking-[0.18em] text-muted-foreground uppercase">
62
- {eyebrow}
63
- </p>
64
- <h1 className="mt-3 text-2xl font-semibold tracking-tight sm:text-3xl">{title}</h1>
65
- <p className="mt-2 text-sm leading-relaxed text-muted-foreground">{description}</p>
25
+ <div className="flex items-baseline justify-between gap-3 text-muted-foreground">
26
+ <span className="flex items-baseline gap-1.5" role="img" aria-label="T3 Code">
27
+ <T3Wordmark className="h-3 w-auto shrink-0 text-foreground" aria-hidden />
28
+ <span className="text-lg font-medium tracking-tight">Code</span>
29
+ </span>
30
+ {context ? <span className="text-sm">{context}</span> : null}
31
+ </div>
32
+ <h1 className="mt-6 text-xl leading-tight font-semibold">{title}</h1>
33
+ <p className="mt-2 text-sm text-muted-foreground">{description}</p>
34
</>
35
);
36
}
apps/web/src/index.css
+2
@@ -1,3 +1,5 @@
1
+/* Clerk injects its component styles into the clerk layer (clerkAppearance.cssLayerName). */
2
+@layer theme, base, clerk, components, utilities;
3
@import "tailwindcss";
4
5
@custom-variant dark (&:is(.dark, .dark *));
apps/web/src/routes/__root.tsx
+2
-6
@@ -226,12 +226,8 @@ function RootRouteErrorView({ error }: ErrorComponentProps) {
226
const report = errorReport(error, pathname);
227
228
return (
229
- <StandalonePage tone="error">
230
- <StandalonePageHeader
231
- eyebrow={APP_DISPLAY_NAME}
232
- title="Something went wrong."
233
- description={message}
234
- />
229
+ <StandalonePage>
230
+ <StandalonePageHeader title="Something went wrong." description={message} />
231
232
<div className="mt-5 flex flex-wrap gap-2">
233
<Button size="sm" onClick={() => void router.invalidate()}>
vite.config.ts
-5
@@ -575,11 +575,6 @@ export default defineConfig({
575
"t3code/no-manual-memo": "error",
576
},
577
},
578
- {
579
- // The sign-in masthead is T3 brand artwork: fixed gradients, not theme surfaces.
580
- files: ["apps/web/src/components/auth/AuthSurfaceShell.tsx"],
581
- rules: { "shadcn/no-arbitrary-values": "off" },
582
- },
578
{
579
// ESNext types allow APIs absent from Hermes; restrict shared client code, exempting Node tests.
580
files: [