Skip to content

Commit 78d2aef

Browse files
committed
Tighten supervisor dialog overlays
1 parent 5da2442 commit 78d2aef

6 files changed

Lines changed: 31 additions & 17 deletions

File tree

packages/web/src/components/ui/modal/index.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
:global(.modal-overlay) {
33
position: fixed;
44
inset: 0;
5-
z-index: 1000;
5+
z-index: var(--z-modal-backdrop);
66
display: flex;
77
align-items: center;
88
justify-content: center;

packages/web/src/components/ui/popover/index.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
margin-top: 0;
1212
overflow: auto;
1313
outline: none;
14-
z-index: var(--z-modal);
14+
z-index: var(--z-popover);
1515
padding: var(--sp-3);
1616
border: 1px solid var(--border);
1717
border-radius: var(--radius-lg);

packages/web/src/features/supervisor/components/objective-dialog.test.tsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ describe("ObjectiveDialog", () => {
179179
expect(screen.getByRole("textbox", { name: "Objective" })).toHaveClass("input", "textarea");
180180
});
181181

182-
it("renders the intro strip in the desktop wrapper for enable mode", () => {
182+
it("does not render the shared intro strip inside the desktop wrapper for enable mode", () => {
183183
const store = createStore();
184184
window.localStorage.setItem("ui.locale", JSON.stringify("en"));
185185
store.set(localeAtom, "en");
@@ -200,22 +200,12 @@ describe("ObjectiveDialog", () => {
200200

201201
const dialog = screen.getByRole("dialog");
202202
const header = dialog.querySelector(".dialog-header");
203-
const intro = dialog.querySelector(".supervisor-dialog-intro");
204-
const introIcon = dialog.querySelector(".supervisor-dialog-intro__icon");
205-
const introCopy = dialog.querySelector(".supervisor-dialog-intro__copy");
206203
const firstFormGroup = dialog.querySelector(".form-group");
207204

208205
expect(header).toBeTruthy();
209-
expect(intro).toBeTruthy();
210-
expect(introIcon).toBeTruthy();
211-
expect(introCopy).toBeTruthy();
212-
expect(intro?.querySelector(".supervisor-dialog-intro__icon")).toBe(introIcon);
213-
expect(intro?.querySelector(".supervisor-dialog-intro__copy")).toBe(introCopy);
214-
expect(header?.contains(intro as Node)).toBe(false);
215206
expect(firstFormGroup).toBeTruthy();
216-
expect(intro?.compareDocumentPosition(firstFormGroup as Node)).toBe(
217-
Node.DOCUMENT_POSITION_FOLLOWING
218-
);
207+
expect(dialog.querySelector(".supervisor-dialog-intro")).toBeNull();
208+
expect(header?.contains(firstFormGroup as Node)).toBe(false);
219209
});
220210

221211
it("renders disable confirmation mode", () => {

packages/web/src/features/supervisor/views/shared/objective-dialog.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ export function ObjectiveDialog({ workspaceId, sessionId }: ObjectiveDialogProps
6161
<ModalBody>
6262
<ObjectiveDialogContent
6363
mode={mode}
64-
showIntro
6564
draftObjective={dialog.draftObjective}
6665
draftEvaluatorProviderId={dialog.draftEvaluatorProviderId}
6766
draftEvaluatorModel={dialog.draftEvaluatorModel}

packages/web/src/styles/components.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3993,7 +3993,7 @@ body.is-resizing-panels * {
39933993
display: flex;
39943994
align-items: center;
39953995
justify-content: center;
3996-
z-index: 1000;
3996+
z-index: var(--z-modal-backdrop);
39973997
}
39983998

39993999
.modal-content {
@@ -10400,6 +10400,14 @@ textarea.input {
1040010400
overflow: auto;
1040110401
}
1040210402

10403+
.mobile-supervisor-sheet__detail .input,
10404+
.mobile-supervisor-sheet__detail .mobile-select-trigger,
10405+
.mobile-supervisor-sheet__detail .textarea {
10406+
font-size: var(--type-label-size);
10407+
line-height: var(--type-label-line-height);
10408+
font-weight: var(--type-label-weight);
10409+
}
10410+
1040310411
.mobile-supervisor-sheet__actions,
1040410412
.mobile-supervisor-sheet__footer {
1040510413
display: grid;

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ const buttonStyles = readFileSync(
5656
`${process.cwd()}/src/components/ui/button/index.module.css`,
5757
"utf8"
5858
);
59+
const popoverStyles = readFileSync(
60+
`${process.cwd()}/src/components/ui/popover/index.module.css`,
61+
"utf8"
62+
);
5963
const inputStyles = readFileSync(
6064
`${process.cwd()}/src/components/ui/input/index.module.css`,
6165
"utf8"
@@ -387,6 +391,13 @@ describe("components.css theme-sensitive surfaces", () => {
387391
);
388392
});
389393

394+
it("keeps desktop popovers above modal shells so picker overlays are not occluded", () => {
395+
expect(getLastRuleBlockFrom(modalStylesheet, ":global(.modal-overlay)")).toContain(
396+
"z-index: var(--z-modal-backdrop)"
397+
);
398+
expect(getLastRuleBlockFrom(popoverStyles, ".content")).toContain("z-index: var(--z-popover)");
399+
});
400+
390401
it("maps display and status primitives onto semantic typography roles", () => {
391402
expect(getLastRuleBlockFrom(tagStyles, ":where(.tag)")).toContain(
392403
"font-size: var(--type-kicker-size)"
@@ -1172,6 +1183,9 @@ describe("components.css theme-sensitive surfaces", () => {
11721183
/\s+/g,
11731184
" "
11741185
);
1186+
const supervisorDetailInputs = getLastGroupedRuleBlock(
1187+
/\.mobile-supervisor-sheet__detail \.input,\s*\n\s*\.mobile-supervisor-sheet__detail \.mobile-select-trigger,\s*\n\s*\.mobile-supervisor-sheet__detail \.textarea\s*\{([^}]*)\}/g
1188+
);
11751189
const supervisorFullscreenFooter = getLastRuleBlock(
11761190
".mobile-supervisor-sheet.mobile-sheet--fullscreen .mobile-sheet__footer"
11771191
).replace(/\s+/g, " ");
@@ -1190,6 +1204,9 @@ describe("components.css theme-sensitive surfaces", () => {
11901204
expect(supervisorRoot).not.toContain("box-shadow:");
11911205
expect(supervisorDetail).toContain("padding: var(--sp-3)");
11921206
expect(supervisorDetail).toContain("padding-bottom: var(--sp-4)");
1207+
expect(supervisorDetailInputs).toContain("font-size: var(--type-label-size)");
1208+
expect(supervisorDetailInputs).toContain("line-height: var(--type-label-line-height)");
1209+
expect(supervisorDetailInputs).toContain("font-weight: var(--type-label-weight)");
11931210
expect(supervisorDetail).not.toContain("border: 1px solid");
11941211
expect(supervisorDetail).not.toContain("border-radius:");
11951212
expect(supervisorDetail).not.toContain("box-shadow:");

0 commit comments

Comments
 (0)