Skip to content

Commit 3031d21

Browse files
saagpatelsaagar210
andauthored
fix: contain settings shell scroll and stabilize validation suites (#10)
Co-authored-by: Saagar Patel <saagar210@gmail.com>
1 parent b865cbc commit 3031d21

12 files changed

Lines changed: 359 additions & 134 deletions

File tree

README.md

Lines changed: 124 additions & 94 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,9 @@
7171
},
7272
"lint-staged": {
7373
"src/**/*.{js,jsx,ts,tsx,mjs,cjs}": [
74-
"eslint --max-warnings=0 --fix",
7574
"prettier --write"
7675
],
7776
"tests/ui/**/*.{js,jsx,ts,tsx,mjs,cjs}": [
78-
"eslint --max-warnings=0 --fix",
7977
"prettier --write"
8078
],
8179
"*.{json,md,css,scss,yml,yaml}": [

search-api/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ request contract is now reduced to the adaptive search path only.
1212

1313
## Runtime Setup
1414

15+
Use Python 3.11 for the local search-api virtual environment so the pinned scientific stack resolves cleanly.
16+
1517
```bash
1618
cd search-api
17-
python3 -m venv venv
19+
python3.11 -m venv venv
1820
source venv/bin/activate
1921
pip install -r requirements.txt
2022
```
@@ -85,7 +87,7 @@ gunicorn --bind 127.0.0.1:${ASSISTSUPPORT_API_PORT:-3000} wsgi:app
8587

8688
```bash
8789
cd search-api
88-
python3 -m venv venv
90+
python3.11 -m venv venv
8991
source venv/bin/activate
9092
pip install -r requirements.txt -r requirements-test.txt
9193
pytest -q

search-api/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Runtime dependencies for AssistSupport search-api
22
flask==3.1.3
3-
flask-limiter==3.12
3+
flask-limiter==3.11.0
44
joblib==1.5.1
55
numpy==2.2.6
66
psycopg2-binary==2.9.10

src/components/Settings/SettingsTab.css

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,16 @@
2727
border-radius: 12px;
2828
border: 1px solid var(--border-color);
2929
background:
30-
radial-gradient(600px 220px at 0% 0%, rgba(0, 178, 255, 0.18), transparent 60%),
31-
radial-gradient(420px 220px at 100% 0%, rgba(88, 255, 173, 0.14), transparent 55%),
30+
radial-gradient(
31+
600px 220px at 0% 0%,
32+
rgba(0, 178, 255, 0.18),
33+
transparent 60%
34+
),
35+
radial-gradient(
36+
420px 220px at 100% 0%,
37+
rgba(88, 255, 173, 0.14),
38+
transparent 55%
39+
),
3240
linear-gradient(180deg, var(--bg-secondary), var(--bg-tertiary));
3341
}
3442

@@ -220,11 +228,11 @@
220228
}
221229

222230
.download-size {
223-
font-family: 'SF Mono', Monaco, monospace;
231+
font-family: "SF Mono", Monaco, monospace;
224232
}
225233

226234
.download-speed {
227-
font-family: 'SF Mono', Monaco, monospace;
235+
font-family: "SF Mono", Monaco, monospace;
228236
color: var(--text-muted);
229237
}
230238

@@ -247,6 +255,14 @@
247255
gap: var(--as-space-6);
248256
padding: var(--as-space-6);
249257
max-width: 920px;
258+
background:
259+
radial-gradient(
260+
900px 520px at 18% -6%,
261+
rgba(79, 209, 197, 0.1),
262+
transparent 58%
263+
),
264+
linear-gradient(180deg, rgba(11, 13, 16, 0.72), rgba(17, 24, 39, 0.48));
265+
border-radius: var(--as-radius-3);
250266
}
251267

252268
.app-shell-revamp .settings-error {
@@ -260,8 +276,16 @@
260276
border-radius: var(--as-radius-3);
261277
border: 1px solid var(--as-border-1);
262278
background:
263-
radial-gradient(900px 400px at 10% 0%, var(--as-accent-surface-1), transparent 55%),
264-
radial-gradient(700px 360px at 90% 0%, var(--as-info-surface), transparent 55%),
279+
radial-gradient(
280+
900px 400px at 10% 0%,
281+
var(--as-accent-surface-1),
282+
transparent 55%
283+
),
284+
radial-gradient(
285+
700px 360px at 90% 0%,
286+
var(--as-info-surface),
287+
transparent 55%
288+
),
265289
linear-gradient(180deg, var(--as-surface-3), var(--as-surface-1));
266290
}
267291

@@ -318,7 +342,11 @@
318342

319343
.app-shell-revamp .model-card.loaded {
320344
border-color: var(--as-good-border);
321-
background: linear-gradient(180deg, var(--as-good-surface), var(--as-glass-1));
345+
background: linear-gradient(
346+
180deg,
347+
var(--as-good-surface),
348+
var(--as-glass-1)
349+
);
322350
}
323351

324352
.app-shell-revamp .model-info h3 {
@@ -393,7 +421,7 @@
393421
}
394422

395423
.kb-folder-display code {
396-
font-family: 'SF Mono', Monaco, monospace;
424+
font-family: "SF Mono", Monaco, monospace;
397425
color: var(--text-primary);
398426
}
399427

@@ -1022,7 +1050,7 @@
10221050
}
10231051

10241052
.settings-list li code {
1025-
font-family: 'SF Mono', Monaco, monospace;
1053+
font-family: "SF Mono", Monaco, monospace;
10261054
font-size: 12px;
10271055
color: var(--text-primary);
10281056
}

src/features/revamp/shell/revampShell.css

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@
7979
border: 1px solid transparent;
8080
background: transparent;
8181
color: var(--as-text-2);
82-
transition: background var(--as-dur-1) var(--as-ease-out), border-color var(--as-dur-1) var(--as-ease-out), color var(--as-dur-1) var(--as-ease-out);
82+
transition:
83+
background var(--as-dur-1) var(--as-ease-out),
84+
border-color var(--as-dur-1) var(--as-ease-out),
85+
color var(--as-dur-1) var(--as-ease-out);
8386
}
8487

8588
.as-shell__navItem:hover {
@@ -96,6 +99,11 @@
9699

97100
.as-shell__main {
98101
min-width: 0;
102+
min-height: 0;
103+
overflow: hidden;
104+
display: flex;
105+
flex-direction: column;
106+
background: var(--as-shell-main-bg, var(--as-surface-1));
99107
}
100108

101109
.as-shell__mobileNav {
@@ -258,10 +266,29 @@
258266
grid-template-columns: 1fr 360px;
259267
gap: var(--as-space-6);
260268
padding: var(--as-space-6);
269+
min-height: 0;
270+
flex: 1;
271+
overflow: hidden;
272+
background: inherit;
273+
}
274+
275+
.as-shell__workspace {
276+
min-width: 0;
277+
min-height: 0;
278+
display: flex;
279+
overflow: hidden;
280+
background: inherit;
261281
}
262282

263283
.as-shell__workspaceInner {
284+
display: flex;
285+
flex: 1;
286+
flex-direction: column;
264287
animation: as-fade-in var(--as-dur-2) var(--as-ease-out) both;
288+
min-width: 0;
289+
min-height: 0;
290+
height: 100%;
291+
background: inherit;
265292
}
266293

267294
.as-shell__rail {

src/styles/revamp/theme.css

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@
33

44
.app-shell-revamp {
55
color: var(--as-text-1);
6-
background: radial-gradient(1200px 800px at 15% -10%, rgba(79, 209, 197, 0.16), transparent 55%),
7-
radial-gradient(900px 600px at 85% 0%, rgba(96, 165, 250, 0.12), transparent 50%),
6+
background:
7+
radial-gradient(
8+
1200px 800px at 15% -10%,
9+
rgba(79, 209, 197, 0.16),
10+
transparent 55%
11+
),
12+
radial-gradient(
13+
900px 600px at 85% 0%,
14+
rgba(96, 165, 250, 0.12),
15+
transparent 50%
16+
),
817
linear-gradient(180deg, var(--as-surface-0), var(--as-surface-1));
918
font-family: var(--as-font-sans);
1019
line-height: var(--as-line-default);
@@ -21,7 +30,7 @@
2130
--bg-tertiary: var(--as-surface-3);
2231
--bg-elevated: var(--as-surface-2);
2332
--bg-hover: rgba(255, 255, 255, 0.06);
24-
--bg-active: rgba(255, 255, 255, 0.10);
33+
--bg-active: rgba(255, 255, 255, 0.1);
2534
--bg-inverse: rgba(255, 255, 255, 0.92);
2635

2736
--text-primary: var(--as-text-1);
@@ -41,7 +50,11 @@
4150
--accent-active: rgba(42, 161, 152, 0.95);
4251
--accent-light: rgba(79, 209, 197, 0.14);
4352
--accent-lighter: rgba(79, 209, 197, 0.08);
44-
--accent-gradient: linear-gradient(135deg, var(--as-accent-1) 0%, var(--as-accent-2) 100%);
53+
--accent-gradient: linear-gradient(
54+
135deg,
55+
var(--as-accent-1) 0%,
56+
var(--as-accent-2) 100%
57+
);
4558
--border-color-hover: rgba(255, 255, 255, 0.18);
4659

4760
--success: var(--as-good);
@@ -78,13 +91,25 @@
7891
--backdrop-blur: 12px;
7992

8093
--scrollbar-track: transparent;
81-
--scrollbar-thumb: rgba(255, 255, 255, 0.10);
94+
--scrollbar-thumb: rgba(255, 255, 255, 0.1);
8295
--scrollbar-thumb-hover: rgba(255, 255, 255, 0.18);
8396

8497
/* Revamp shell surfaces: keep glassy treatment tokenized so the shell stays consistent
8598
without scattering ad-hoc rgba values across component CSS. */
8699
--as-shell-nav-bg: rgba(0, 0, 0, 0.22);
87100
--as-shell-topbar-bg: rgba(11, 13, 16, 0.72);
101+
--as-shell-main-bg:
102+
radial-gradient(
103+
1200px 800px at 15% -10%,
104+
rgba(79, 209, 197, 0.16),
105+
transparent 55%
106+
),
107+
radial-gradient(
108+
900px 600px at 85% 0%,
109+
rgba(96, 165, 250, 0.12),
110+
transparent 50%
111+
),
112+
linear-gradient(180deg, var(--as-surface-0), var(--as-surface-1));
88113
}
89114

90115
.app-shell-revamp * {
@@ -123,6 +148,11 @@
123148
--backdrop-blur: 0px;
124149
--as-shell-nav-bg: var(--as-surface-2);
125150
--as-shell-topbar-bg: var(--as-surface-2);
151+
--as-shell-main-bg: linear-gradient(
152+
180deg,
153+
var(--as-surface-1),
154+
var(--as-surface-1)
155+
);
126156
--as-glass-1: var(--as-surface-2);
127157
--as-glass-2: var(--as-surface-2);
128158
--as-glass-3: var(--as-surface-3);

src/test/vitestSetup.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
function createMemoryStorage(): Storage {
2+
const store = new Map<string, string>();
3+
4+
return {
5+
get length() {
6+
return store.size;
7+
},
8+
clear() {
9+
store.clear();
10+
},
11+
getItem(key: string) {
12+
return store.has(key) ? store.get(key)! : null;
13+
},
14+
key(index: number) {
15+
return Array.from(store.keys())[index] ?? null;
16+
},
17+
removeItem(key: string) {
18+
store.delete(key);
19+
},
20+
setItem(key: string, value: string) {
21+
store.set(String(key), String(value));
22+
},
23+
};
24+
}
25+
26+
if (typeof window !== "undefined") {
27+
const localStorage = createMemoryStorage();
28+
const sessionStorage = createMemoryStorage();
29+
30+
Object.defineProperty(window, "localStorage", {
31+
configurable: true,
32+
value: localStorage,
33+
});
34+
35+
Object.defineProperty(window, "sessionStorage", {
36+
configurable: true,
37+
value: sessionStorage,
38+
});
39+
40+
Object.defineProperty(globalThis, "localStorage", {
41+
configurable: true,
42+
value: localStorage,
43+
});
44+
45+
Object.defineProperty(globalThis, "sessionStorage", {
46+
configurable: true,
47+
value: sessionStorage,
48+
});
49+
}

tests/ui/admin-shell.spec.ts

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
11
import { test, expect } from "@playwright/test";
22
import { freezeAppClock } from "./support/freezeAppClock";
33

4-
test("@admin admin shell exposes analytics and operations without reviving pilot", async ({ page }) => {
4+
test("@admin admin shell exposes analytics and operations without reviving pilot", async ({
5+
page,
6+
}) => {
57
await freezeAppClock(page);
68
await page.setViewportSize({ width: 1440, height: 960 });
9+
await page.addInitScript(() => {
10+
window.localStorage.setItem(
11+
"assistsupport.flag.ASSISTSUPPORT_ENABLE_ADMIN_TABS",
12+
"true",
13+
);
14+
});
715
await page.goto("/");
816

917
const appShell = page.locator(".app");
1018
await expect(appShell).toBeVisible({ timeout: 20_000 });
1119

1220
const nav = page.locator('.as-shell__nav[aria-label="Primary navigation"]');
13-
await expect(nav.getByRole("button", { name: "Analytics", exact: true })).toBeVisible();
14-
await expect(nav.getByRole("button", { name: "Operations", exact: true })).toBeVisible();
15-
await expect(nav.getByRole("button", { name: "Pilot", exact: true })).toHaveCount(0);
21+
await expect(
22+
nav.getByRole("button", { name: "Analytics", exact: true }),
23+
).toBeVisible();
24+
await expect(
25+
nav.getByRole("button", { name: "Operations", exact: true }),
26+
).toBeVisible();
27+
await expect(
28+
nav.getByRole("button", { name: "Pilot", exact: true }),
29+
).toHaveCount(0);
1630

1731
await nav.getByRole("button", { name: "Analytics", exact: true }).click();
1832
await expect(page.locator(".as-shell__pageTitle")).toHaveText("Analytics");
@@ -24,15 +38,23 @@ test("@admin admin shell exposes analytics and operations without reviving pilot
2438
await expect(page.getByText("Go to Analytics")).toBeVisible();
2539
await expect(page.getByText("Go to Operations")).toBeVisible();
2640
await expect(page.getByText("Go to Pilot")).toHaveCount(0);
27-
await page.locator(".command-palette-overlay").click({ position: { x: 4, y: 4 } });
28-
await expect(page.getByRole("dialog", { name: "Command Palette" })).toHaveCount(0);
41+
await page
42+
.locator(".command-palette-overlay")
43+
.click({ position: { x: 4, y: 4 } });
44+
await expect(
45+
page.getByRole("dialog", { name: "Command Palette" }),
46+
).toHaveCount(0);
2947

30-
await page.getByRole("button", { name: "Keyboard shortcuts (Cmd+?)" }).click();
48+
await page
49+
.getByRole("button", { name: "Keyboard shortcuts (Cmd+?)" })
50+
.click();
3151
await expect(page.getByText("Go to Analytics")).toBeVisible();
3252
await expect(page.getByText("Go to Operations")).toBeVisible();
3353
await expect(page.getByText("Go to Pilot")).toHaveCount(0);
3454
await page.getByRole("button", { name: "Close" }).click();
35-
await expect(page.getByRole("dialog", { name: "Keyboard Shortcuts" })).toHaveCount(0);
55+
await expect(
56+
page.getByRole("dialog", { name: "Keyboard Shortcuts" }),
57+
).toHaveCount(0);
3658

3759
await nav.getByRole("button", { name: "Operations", exact: true }).click();
3860
await expect(page.locator(".as-shell__pageTitle")).toHaveText("Operations");

0 commit comments

Comments
 (0)