Skip to content

Commit 2b67de5

Browse files
committed
fix: theme auth gate review scenes
1 parent 9d82b91 commit 2b67de5

5 files changed

Lines changed: 66 additions & 6 deletions

File tree

packages/web/src/styles/components.css

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2257,9 +2257,21 @@ body.is-resizing-panels * {
22572257
.auth-screen {
22582258
padding: var(--sp-8);
22592259
background:
2260-
radial-gradient(circle at top, rgba(120, 215, 178, 0.08), transparent 34%),
2261-
radial-gradient(circle at bottom right, rgba(108, 182, 255, 0.1), transparent 30%),
2262-
linear-gradient(180deg, rgba(17, 24, 31, 0.96), rgba(10, 16, 20, 0.99));
2260+
radial-gradient(
2261+
circle at top,
2262+
color-mix(in srgb, var(--accent-green) 12%, transparent),
2263+
transparent 34%
2264+
),
2265+
radial-gradient(
2266+
circle at bottom right,
2267+
color-mix(in srgb, var(--accent-blue) 14%, transparent),
2268+
transparent 30%
2269+
),
2270+
linear-gradient(
2271+
180deg,
2272+
color-mix(in srgb, var(--bg-page) 92%, var(--bg-surface) 8%),
2273+
var(--bg-page)
2274+
);
22632275
}
22642276

22652277
.auth-card-shell {
@@ -2268,9 +2280,13 @@ body.is-resizing-panels * {
22682280
text-align: left;
22692281
gap: var(--sp-4);
22702282
padding: var(--sp-10);
2271-
background: linear-gradient(180deg, rgba(17, 24, 31, 0.96), rgba(13, 20, 26, 0.94));
2272-
border-color: color-mix(in srgb, var(--border) 88%, rgba(108, 182, 255, 0.18));
2273-
box-shadow: 0 24px 72px rgba(0, 0, 0, 0.42);
2283+
background: linear-gradient(
2284+
180deg,
2285+
color-mix(in srgb, var(--bg-surface) 98%, white 2%),
2286+
color-mix(in srgb, var(--bg-surface) 88%, var(--bg-page) 12%)
2287+
);
2288+
border-color: color-mix(in srgb, var(--border) 88%, var(--accent-blue) 12%);
2289+
box-shadow: var(--shadow-xl);
22742290
}
22752291

22762292
.auth-card-shell .welcome-kicker,

packages/web/src/styles/components.theme.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,20 @@ describe("components.css theme-sensitive surfaces", () => {
187187
expect(bottomTerminalShell).not.toContain("rgba(17, 24, 31, 0.96)");
188188
});
189189

190+
it("keeps auth shells theme-aware instead of forcing dark gradients", () => {
191+
const authScreen = getLastRuleBlock(".auth-screen");
192+
const authCard = getLastRuleBlock(".auth-card-shell");
193+
194+
expect(authScreen).toContain("var(--bg-page)");
195+
expect(authScreen).toContain("var(--accent-green)");
196+
expect(authScreen).toContain("var(--accent-blue)");
197+
expect(authScreen).not.toContain("rgba(17, 24, 31, 0.96)");
198+
expect(authCard).toContain("var(--bg-surface)");
199+
expect(authCard).toContain("var(--accent-blue)");
200+
expect(authCard).toContain("var(--shadow-xl)");
201+
expect(authCard).not.toContain("rgba(13, 20, 26, 0.94)");
202+
});
203+
190204
it("keeps quick actions sized to its label instead of icon-button width", () => {
191205
const quickActions = getLastRuleBlock(".topbar-quick-actions");
192206

packages/web/src/ui-preview/catalog.test.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ describe("UI preview catalog", () => {
7474
"workspace-desktop",
7575
"workspace-mobile",
7676
"auth-preview",
77+
"session-gate",
7778
"not-found",
7879
])
7980
);
@@ -168,6 +169,13 @@ describe("UI preview catalog", () => {
168169
expect(document.querySelector(".workspace-resolving-card")).toBeTruthy();
169170
});
170171

172+
it("renders the session gate scene through the shared auth shell", async () => {
173+
renderScene("session-gate");
174+
175+
expect(await screen.findByRole("button", { name: /re-enter|/i })).toBeInTheDocument();
176+
expect(document.querySelector(".auth-card-shell")).toBeTruthy();
177+
});
178+
171179
it("renders the file-tree delete confirm scene with the shared danger dialog", async () => {
172180
renderScene("file-tree-delete-confirm");
173181

packages/web/src/ui-preview/scene-metadata.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,18 @@ export const UI_PREVIEW_SCENE_METADATA: UiPreviewSceneMetadata[] = [
145145
locales: ["zh", "en"],
146146
capture: { selector: ".auth-card-shell" },
147147
},
148+
{
149+
id: "session-gate",
150+
title: "Session Gate",
151+
category: "error",
152+
source: "real-route",
153+
description:
154+
"Session gate shell shown when activation is displaced and the app requires re-entry.",
155+
devices: ["desktop", "mobile"],
156+
themes: allThemeIds(),
157+
locales: ["zh", "en"],
158+
capture: { selector: ".auth-card-shell" },
159+
},
148160
{
149161
id: "not-found",
150162
title: "Not Found",

packages/web/src/ui-preview/scenes/page-scenes.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { FileNode, GitStatus, Session, Workspace } from "@coder-studio/core";
22
import { LoginPage } from "../../features/auth";
3+
import { SessionGatePage } from "../../features/auth/session-gate";
34
import { NotFoundPage } from "../../features/not-found";
45
import { SettingsPage } from "../../features/settings";
56
import { WelcomePage } from "../../features/welcome";
@@ -211,6 +212,15 @@ export function createPageScenes(): UiPreviewSceneDefinition[] {
211212
}),
212213
render: () => <LoginPage />,
213214
}),
215+
scene("session-gate", {
216+
router: () => ({ initialEntries: ["/session-gate"], path: "/session-gate" }),
217+
seed: (context) => ({
218+
...context,
219+
authEnabled: false,
220+
authenticated: false,
221+
}),
222+
render: () => <SessionGatePage />,
223+
}),
214224
scene("not-found", {
215225
router: () => ({ initialEntries: ["/preview-missing"], path: "*" }),
216226
seed: (context) => ({ ...context }),

0 commit comments

Comments
 (0)