Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

test(views): guard dialog sizes and full-screen layers against the iPhone safe area (MUL-9257) (#10596)

Jiayuan Zhangd74ccd834728
diff --git a/apps/desktop/src/renderer/src/components/daemon-panel.tsx b/apps/desktop/src/renderer/src/components/daemon-panel.tsx
index 55167b8410..e7ec0c7423 100644
--- a/apps/desktop/src/renderer/src/components/daemon-panel.tsx
+++ b/apps/desktop/src/renderer/src/components/daemon-panel.tsx
@@ -246,7 +246,7 @@ export function DaemonPanel({
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent
- className="flex h-[85vh] flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl"
+ className="flex h-[85%] flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl"
showCloseButton={false}
>
{/* Header */}
diff --git a/packages/views/agents/components/agent-advanced-settings.tsx b/packages/views/agents/components/agent-advanced-settings.tsx
index 9f1952242e..9749c5e298 100644
--- a/packages/views/agents/components/agent-advanced-settings.tsx
+++ b/packages/views/agents/components/agent-advanced-settings.tsx
@@ -193,7 +193,7 @@ export function AgentAdvancedSettings({
if (!open) request(null);
}}
>
- <DialogContent className="flex h-[min(85dvh,52rem)] flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl">
+ <DialogContent className="flex h-[min(85%,52rem)] flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl">
<DialogHeader className="shrink-0 gap-1 border-b px-5 py-4 pr-12">
<DialogTitle>{t(($) => $.detail.settings)}</DialogTitle>
<DialogDescription className="truncate">{agent.name}</DialogDescription>
diff --git a/packages/views/agents/components/agent-work-dialog.tsx b/packages/views/agents/components/agent-work-dialog.tsx
index b5e9a67988..2622dad084 100644
--- a/packages/views/agents/components/agent-work-dialog.tsx
+++ b/packages/views/agents/components/agent-work-dialog.tsx
@@ -25,7 +25,7 @@ export function AgentWorkDialog({
const { t } = useT("agents");
return (
<Dialog open={open} onOpenChange={onOpenChange}>
- <DialogContent className="flex h-[min(85dvh,52rem)] flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl">
+ <DialogContent className="flex h-[min(85%,52rem)] flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl">
<DialogHeader className="shrink-0 gap-1 border-b px-5 py-4 pr-12">
<DialogTitle>{t(($) => $.tabs.work)}</DialogTitle>
<DialogDescription className="truncate">{agent.name}</DialogDescription>
diff --git a/packages/views/agents/components/tabs/mcp-server-dialog.tsx b/packages/views/agents/components/tabs/mcp-server-dialog.tsx
index d2dc5bfdad..c94e7ada41 100644
--- a/packages/views/agents/components/tabs/mcp-server-dialog.tsx
+++ b/packages/views/agents/components/tabs/mcp-server-dialog.tsx
@@ -375,7 +375,7 @@ export function McpServerDialog({
return (
<Dialog open={open} onOpenChange={(next) => !saving && onOpenChange(next)}>
- <DialogContent className="flex max-h-[88vh] flex-col gap-0 overscroll-contain p-0 sm:max-w-2xl [&_[data-slot=dialog-close]]:top-5 [&_[data-slot=dialog-close]]:right-5">
+ <DialogContent className="flex max-h-[88%] flex-col gap-0 overscroll-contain p-0 sm:max-w-2xl [&_[data-slot=dialog-close]]:top-5 [&_[data-slot=dialog-close]]:right-5">
<DialogHeader className="shrink-0 border-b border-surface-border px-6 py-6 pr-14 sm:px-8 sm:pr-16">
<DialogTitle>
{replacementMode
diff --git a/packages/views/agents/components/tabs/skills-tab.tsx b/packages/views/agents/components/tabs/skills-tab.tsx
index 26affc2555..da382a50f5 100644
--- a/packages/views/agents/components/tabs/skills-tab.tsx
+++ b/packages/views/agents/components/tabs/skills-tab.tsx
@@ -435,7 +435,7 @@ function SkillDetailDialog({
return (
<Dialog open={selected !== null} onOpenChange={onOpenChange}>
- <DialogContent className="max-h-[80vh] overflow-y-auto sm:max-w-2xl">
+ <DialogContent className="max-h-[80%] overflow-y-auto sm:max-w-2xl">
<DialogHeader>
<div className="flex items-center gap-2 pr-8">
<DialogTitle>{title}</DialogTitle>
diff --git a/packages/views/autopilots/components/webhook-deliveries-section.tsx b/packages/views/autopilots/components/webhook-deliveries-section.tsx
index fdced29c6c..1df701f04c 100644
--- a/packages/views/autopilots/components/webhook-deliveries-section.tsx
+++ b/packages/views/autopilots/components/webhook-deliveries-section.tsx
@@ -252,8 +252,8 @@ function DeliveryDetailDialog({
{/* max-h + overflow-y-auto: webhook bodies + headers + response can
easily exceed viewport height. Without a cap the dialog grows past
the screen edge and the bottom (e.g. Replay button) becomes
- unreachable. 85vh leaves breathing room around the dialog. */}
- <DialogContent className="max-w-2xl max-h-[85vh] overflow-y-auto">
+ unreachable. 85% leaves breathing room around the dialog. */}
+ <DialogContent className="max-w-2xl max-h-[85%] overflow-y-auto">
<DialogTitle className="flex items-center gap-2">
<Webhook className="h-4 w-4 text-muted-foreground" />
{t(($) => $.deliveries.detail.title)}
diff --git a/packages/views/common/safe-area.test.ts b/packages/views/common/safe-area.test.ts
new file mode 100644
index 0000000000..bc4a5737cd
--- /dev/null
+++ b/packages/views/common/safe-area.test.ts
@@ -0,0 +1,180 @@
+// @vitest-environment node
+import { readFileSync, readdirSync, statSync } from "node:fs";
+import { join, relative } from "node:path";
+import ts from "typescript";
+import { describe, expect, it } from "vitest";
+
+/**
+ * The installed web app draws under the iPhone camera and home indicator
+ * (`viewport-fit=cover`), so keeping content out of those areas is on us, and
+ * a mistake only shows on a real phone. These read the source for the two
+ * ways a layer slips under them.
+ */
+
+const REPO = join(__dirname, "../../..");
+const WEB_ROOTS = ["packages/views", "packages/ui/components", "apps/web/app", "apps/web/components"];
+const DESKTOP_ROOTS = ["apps/desktop/src/renderer"];
+
+function sourceFiles(dir: string, out: string[] = []): string[] {
+ let entries: string[];
+ try {
+ entries = readdirSync(dir);
+ } catch {
+ return out;
+ }
+ for (const entry of entries) {
+ if (entry === "node_modules" || entry.startsWith(".")) continue;
+ const path = join(dir, entry);
+ if (statSync(path).isDirectory()) sourceFiles(path, out);
+ else if (/\.tsx$/.test(entry) && !/\.test\.tsx$/.test(entry)) out.push(path);
+ }
+ return out;
+}
+
+interface JsxTag {
+ file: string;
+ line: number;
+ name: string;
+ node: ts.JsxOpeningLikeElement;
+ /** Every string a prop's value can produce, following constants and helpers in scope. */
+ strings: (prop: string) => string;
+}
+
+function binds(name: ts.BindingName, text: string): boolean {
+ if (ts.isIdentifier(name)) return name.text === text;
+ return name.elements.some((element) => !ts.isOmittedExpression(element) && binds(element.name, text));
+}
+
+/** The initializer or body `reference` names, looked up through the scopes around it. */
+function declarationOf(reference: ts.Identifier): ts.Node | undefined {
+ for (let scope: ts.Node | undefined = reference.parent; scope; scope = scope.parent) {
+ if (ts.isFunctionLike(scope) && scope.parameters.some((parameter) => binds(parameter.name, reference.text))) return undefined;
+ if (!ts.isBlock(scope) && !ts.isSourceFile(scope)) continue;
+ for (const statement of scope.statements) {
+ if (ts.isFunctionDeclaration(statement) && statement.name?.text === reference.text) return statement.body;
+ if (!ts.isVariableStatement(statement)) continue;
+ const declaration = statement.declarationList.declarations.find((d) => binds(d.name, reference.text));
+ if (declaration) return ts.isIdentifier(declaration.name) ? declaration.initializer : undefined;
+ }
+ }
+ return undefined;
+}
+
+function stringsIn(root: ts.Node): string[] {
+ const out: string[] = [];
+ const seen = new Set<ts.Node>();
+ const visit = (node: ts.Node) => {
+ if (seen.has(node)) return;
+ seen.add(node);
+ if (ts.isStringLiteralLike(node) || ts.isTemplateHead(node) || ts.isTemplateMiddle(node) || ts.isTemplateTail(node)) {
+ out.push(node.text);
+ } else if (ts.isIdentifier(node) && !(ts.isPropertyAccessExpression(node.parent) && node.parent.name === node)) {
+ const declaration = declarationOf(node);
+ if (declaration) visit(declaration);
+ }
+ ts.forEachChild(node, visit);
+ };
+ visit(root);
+ return out;
+}
+
+function tagsIn(path: string, text: string): JsxTag[] {
+ const source = ts.createSourceFile(path, text, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);
+ const tags: JsxTag[] = [];
+ const walk = (node: ts.Node) => {
+ if (ts.isJsxOpeningElement(node) || ts.isJsxSelfClosingElement(node)) {
+ const attributes = node.attributes.properties.filter(ts.isJsxAttribute);
+ tags.push({
+ file: relative(REPO, path),
+ line: source.getLineAndCharacterOfPosition(node.getStart(source)).line + 1,
+ name: node.tagName.getText(source),
+ node,
+ strings: (prop) =>
+ attributes
+ .filter((attribute) => attribute.name.getText(source) === prop && attribute.initializer)
+ .flatMap((attribute) => stringsIn(attribute.initializer!))
+ .join(" "),
+ });
+ }
+ ts.forEachChild(node, walk);
+ };
+ walk(source);
+ return tags;
+}
+
+function jsxTags(roots: string[], mentions: RegExp): JsxTag[] {
+ return roots
+ .flatMap((root) => sourceFiles(join(REPO, root)))
+ .flatMap((path) => {
+ const text = readFileSync(path, "utf8");
+ return mentions.test(text) ? tagsIn(path, text) : [];
+ });
+}
+
+/** `100vw`, `85vh`, `90dvh`, `50svw`, `10vmin`… and Tailwind's `h-screen`, `max-h-dvh`, `w-svw`… */
+const VIEWPORT_UNIT =
+ /(?<![\w.])\d*\.?\d+(?:[dsl]?v[wh]|v(?:min|max|[ib]))(?![a-z])|(?<![\w-])(?:min-|max-)?(?:w|h|size)-(?:screen|[dsl]v[wh])(?![\w-])/gi;
+
+function dialogsSizedByScreen(tags: JsxTag[]): string[] {
+ return tags
+ .filter((tag) => tag.name === "DialogContent" || tag.name === "AlertDialogContent")
+ .flatMap((tag) => {
+ const units = [...`${tag.strings("className")} ${tag.strings("style")}`.matchAll(VIEWPORT_UNIT)].map((m) => m[0]);
+ return units.length ? [`${tag.file}:${tag.line} <${tag.name}> uses ${[...new Set(units)].join(", ")}`] : [];
+ });
+}
+
+function unpaddedFullScreenLayers(tags: JsxTag[]): string[] {
+ return tags
+ .filter((tag) => {
+ const classes = tag.strings("className");
+ if (!/(?<![\w-])fixed(?![\w-])/.test(classes) || !/(?<![\w-])inset-0(?![\w-])/.test(classes)) return false;
+ if (classes.includes("safe-area-inset")) return false;
+ // Backdrops and pointer shields draw nothing a camera could hide.
+ if (ts.isJsxSelfClosingElement(tag.node)) return false;
+ const element = tag.node.parent as ts.JsxElement;
+ return !element.children.every((child) => ts.isJsxText(child) && child.containsOnlyTriviaWhiteSpaces);
+ })
+ .map((tag) => `${tag.file}:${tag.line} <${tag.name}>`);
+}
+
+describe("safe area", () => {
+ it("sizes centred dialogs against the safe area, not the screen", () => {
+ expect(
+ dialogsSizedByScreen(jsxTags([...WEB_ROOTS, ...DESKTOP_ROOTS], /<(?:Alert)?DialogContent\b/)),
+ "Dialog and AlertDialog popups sit inside SafeAreaLayer (packages/ui/components/ui/dialog.tsx), which is the safe area " +
+ "of the screen. Size them with %, e.g. w-[calc(100%-2rem)] or max-h-[85%]: vw, vh, dvh and svh still measure the " +
+ "whole screen, so on an iPhone the dialog reaches under the camera or the home indicator.",
+ ).toEqual([]);
+ });
+
+ it("reads a dialog's classes from the constant in its own scope", () => {
+ const source = (dialogWidth: string) => `
+ function Menu() {
+ const classes = "w-[calc(100vw-2rem)]";
+ return <PopoverContent className={classes}>Menu</PopoverContent>;
+ }
+ function Editor({ wide }: { wide: boolean }) {
+ const classes = "${dialogWidth}";
+ return <DialogContent className={cn(classes, wide && size(classes))}>Editor</DialogContent>;
+ }
+ function size(classes: string) {
+ return classes;
+ }
+ `;
+ expect(dialogsSizedByScreen(tagsIn(join(REPO, "fixture.tsx"), source("w-[calc(100%-2rem)]")))).toEqual([]);
+ expect(dialogsSizedByScreen(tagsIn(join(REPO, "fixture.tsx"), source("w-[calc(100vw-2rem)]")))).toEqual([
+ "fixture.tsx:8 <DialogContent> uses 100vw",
+ ]);
+ });
+
+ it("pads full-screen layers that hold content by the safe-area insets", () => {
+ expect(
+ unpaddedFullScreenLayers(jsxTags(WEB_ROOTS, /\binset-0\b/)),
+ "A `fixed inset-0` layer with content covers the whole iPhone screen, camera and home indicator included. Pad it with " +
+ "pt-[env(safe-area-inset-top)] pr-[env(safe-area-inset-right)] pb-[env(safe-area-inset-bottom)] " +
+ "pl-[env(safe-area-inset-left)] (see attachment-preview-modal.tsx), or put a centred popup in a Dialog, " +
+ "whose SafeAreaLayer does this for you.",
+ ).toEqual([]);
+ });
+});
diff --git a/packages/views/issues/components/deliverables/deliverables-overview.tsx b/packages/views/issues/components/deliverables/deliverables-overview.tsx
index 279df2e815..9147ae41f8 100644
--- a/packages/views/issues/components/deliverables/deliverables-overview.tsx
+++ b/packages/views/issues/components/deliverables/deliverables-overview.tsx
@@ -112,7 +112,7 @@ export function DeliverablesOverview({
<DialogContent
showCloseButton={false}
style={NO_DRAG}
- className="dark top-0 left-0 flex h-dvh max-h-none w-screen max-w-none translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden rounded-none bg-black/95 p-0 text-foreground shadow-none ring-0 backdrop-blur-xl sm:max-w-none"
+ className="dark top-0 left-0 flex h-full max-h-none w-full max-w-none translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden rounded-none bg-black/95 p-0 text-foreground shadow-none ring-0 backdrop-blur-xl sm:max-w-none"
>
<OverviewBody
identifier={identifier}
diff --git a/packages/views/issues/components/source-context-viewer.test.tsx b/packages/views/issues/components/source-context-viewer.test.tsx
index 29c8c62c93..453692ae11 100644
--- a/packages/views/issues/components/source-context-viewer.test.tsx
+++ b/packages/views/issues/components/source-context-viewer.test.tsx
@@ -142,7 +142,7 @@ describe("SourceContextBadge", () => {
fireEvent.click(screen.getByRole("button", { name: "Context snapshot" }));
const dialog = screen.getByRole("dialog");
- expect(dialog).toHaveClass("h-[min(82dvh,56rem)]", "sm:max-w-4xl");
+ expect(dialog).toHaveClass("h-[min(82%,56rem)]", "sm:max-w-4xl");
expect(dialog).not.toHaveClass("h-[calc(100%-2rem)]", "sm:max-w-[calc(100%-2rem)]");
expect(screen.getByText("Source comment")).toHaveClass(
"rounded-xs",
@@ -609,7 +609,7 @@ describe("SourceContextBadge", () => {
expect(screen.getByText(author.expected)).toBeTruthy();
expect(screen.queryByRole("button", { name: "Go to source comment" }) !== null)
.toBe(display.openCurrent);
- expect(dialog).toHaveClass("h-[min(82dvh,56rem)]", "sm:max-w-4xl");
+ expect(dialog).toHaveClass("h-[min(82%,56rem)]", "sm:max-w-4xl");
},
);
});
diff --git a/packages/views/issues/components/source-context-viewer.tsx b/packages/views/issues/components/source-context-viewer.tsx
index 625ff8292c..5d879d9c89 100644
--- a/packages/views/issues/components/source-context-viewer.tsx
+++ b/packages/views/issues/components/source-context-viewer.tsx
@@ -212,7 +212,7 @@ export function SourceContextBadge({
"flex w-full max-w-[calc(100%-2rem)] flex-col gap-0 overflow-hidden p-0 transition-[height,max-width] motion-reduce:transition-none",
viewerExpanded
? "h-[calc(100%-2rem)] sm:max-w-[calc(100%-2rem)]"
- : "h-[min(82dvh,56rem)] sm:max-w-4xl",
+ : "h-[min(82%,56rem)] sm:max-w-4xl",
)}
>
<DialogHeader className="relative shrink-0 gap-1 border-b px-5 py-4 pr-20 sm:px-6">
diff --git a/packages/views/modals/create-issue-dialog.tsx b/packages/views/modals/create-issue-dialog.tsx
index e65ffddeb2..40b8ea246b 100644
--- a/packages/views/modals/create-issue-dialog.tsx
+++ b/packages/views/modals/create-issue-dialog.tsx
@@ -172,7 +172,7 @@ function CreateIssueDialogBody({
? sourceContextExpanded
? "!h-5/6 sm:!max-w-2xl"
: "!h-96 sm:!max-w-xl"
- : "!max-h-[80dvh] sm:!max-w-xl",
+ : "!max-h-[80%] sm:!max-w-xl",
)
: cn(
manualDialogContentClass(isExpanded),
diff --git a/packages/views/modals/create-squad.tsx b/packages/views/modals/create-squad.tsx
index 6dd633996a..6e483e64a1 100644
--- a/packages/views/modals/create-squad.tsx
+++ b/packages/views/modals/create-squad.tsx
@@ -142,7 +142,7 @@ export function CreateSquadModal({ onClose }: { onClose: () => void }) {
return (
<Dialog open onOpenChange={(v) => { if (!v) onClose(); }}>
- <DialogContent className="p-0 gap-0 flex flex-col overflow-hidden !top-1/2 !left-1/2 !-translate-x-1/2 !-translate-y-1/2 !w-full !max-w-2xl !h-[85vh]">
+ <DialogContent className="p-0 gap-0 flex flex-col overflow-hidden !top-1/2 !left-1/2 !-translate-x-1/2 !-translate-y-1/2 !w-full !max-w-2xl !h-[85%]">
<DialogHeader className="border-b px-5 py-3 space-y-0">
<DialogTitle className="text-title-sm font-semibold">
{t(($) => $.create_squad.title)}
diff --git a/packages/views/onboarding/steps/step-platform-fork.tsx b/packages/views/onboarding/steps/step-platform-fork.tsx
index 78e6e8d9bc..c51dce9609 100644
--- a/packages/views/onboarding/steps/step-platform-fork.tsx
+++ b/packages/views/onboarding/steps/step-platform-fork.tsx
@@ -310,7 +310,7 @@ function CliInstallDialog({
const { t } = useT("onboarding");
return (
<Dialog open={open} onOpenChange={(o) => (o ? null : onClose())}>
- <DialogContent className="flex max-h-[85vh] flex-col sm:max-w-[560px]">
+ <DialogContent className="flex max-h-[85%] flex-col sm:max-w-[560px]">
<DialogHeader>
<DialogTitle>{t(($) => $.step_platform.cli_dialog_title)}</DialogTitle>
</DialogHeader>
diff --git a/packages/views/projects/components/project-access.tsx b/packages/views/projects/components/project-access.tsx
index 484d62f6dc..bcff6b9d57 100644
--- a/packages/views/projects/components/project-access.tsx
+++ b/packages/views/projects/components/project-access.tsx
@@ -120,7 +120,7 @@ export function ProjectAccessControl({ project }: { project: Project }) {
return (
<Dialog open={open} onOpenChange={(value) => { if (!changeAccess.isPending) setOpen(value); }}>
<DialogTrigger render={<Button type="button" variant="ghost" size="sm" className="h-auto min-h-7 max-w-full justify-start px-0" aria-label={t(($) => $.access.label)}><Icon /><span className="truncate">{project.visibility === "private" ? t(($) => $.access.private) : t(($) => $.access.workspace)}</span></Button>} />
- <DialogContent className="flex max-h-[90dvh] flex-col sm:max-w-lg">
+ <DialogContent className="flex max-h-[90%] flex-col sm:max-w-lg">
<DialogHeader><DialogTitle>{t(($) => $.access.title, { title: project.title })}</DialogTitle><DialogDescription>{t(($) => $.access.description)}</DialogDescription></DialogHeader>
{open ? <ProjectAccessEditor project={project} onClose={() => setOpen(false)} changeAccess={changeAccess} /> : null}
</DialogContent>
diff --git a/packages/views/rich-content/rich-table-dialog.tsx b/packages/views/rich-content/rich-table-dialog.tsx
index c5693e03ed..ebdad8ab2b 100644
--- a/packages/views/rich-content/rich-table-dialog.tsx
+++ b/packages/views/rich-content/rich-table-dialog.tsx
@@ -163,7 +163,7 @@ export function RichTableDialog({ model, open, onOpenChange, getMarkdown }: Rich
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent
showCloseButton={false}
- className="flex h-[min(85dvh,56rem)] w-[min(72rem,calc(100%-4rem))] max-w-none flex-col gap-0 overflow-hidden p-0 sm:max-w-none"
+ className="flex h-[min(85%,56rem)] w-[min(72rem,calc(100%-4rem))] max-w-none flex-col gap-0 overflow-hidden p-0 sm:max-w-none"
>
<div className="flex shrink-0 items-center gap-2 border-b border-border py-2 pr-2 pl-4">
<DialogTitle className="mr-auto text-body font-medium">
diff --git a/packages/views/runtimes/components/cloud-runtime-dialog.tsx b/packages/views/runtimes/components/cloud-runtime-dialog.tsx
index f983161984..d08f23904f 100644
--- a/packages/views/runtimes/components/cloud-runtime-dialog.tsx
+++ b/packages/views/runtimes/components/cloud-runtime-dialog.tsx
@@ -94,7 +94,7 @@ export function CloudRuntimeDialog({ onClose }: { onClose: () => void }) {
return (
<Dialog open onOpenChange={(open) => !open && onClose()}>
- <DialogContent className="flex max-h-[88vh] flex-col gap-0 p-0 sm:max-w-3xl">
+ <DialogContent className="flex max-h-[88%] flex-col gap-0 p-0 sm:max-w-3xl">
<DialogHeader className="border-b px-6 py-5">
<DialogTitle className="flex items-center gap-2 text-title-sm">
<Cloud className="h-4 w-4 text-muted-foreground" />
diff --git a/packages/views/runtimes/components/connect-remote-dialog.tsx b/packages/views/runtimes/components/connect-remote-dialog.tsx
index 9ad74e6fe3..43c22f01d5 100644
--- a/packages/views/runtimes/components/connect-remote-dialog.tsx
+++ b/packages/views/runtimes/components/connect-remote-dialog.tsx
@@ -144,7 +144,7 @@ function WorkspaceConnectDialog({ wsId, currentUserId, onClose }: {
return (
<Dialog open onOpenChange={(v) => !v && onClose()}>
- <DialogContent className="flex max-h-[85vh] flex-col gap-0 p-0 sm:max-w-lg">
+ <DialogContent className="flex max-h-[85%] flex-col gap-0 p-0 sm:max-w-lg">
<AnimatePresence mode="wait" initial={false}>
<motion.div
key={step}
diff --git a/packages/views/runtimes/components/remote-runtime-dialog.tsx b/packages/views/runtimes/components/remote-runtime-dialog.tsx
index d170d4778a..7374ea7bb9 100644
--- a/packages/views/runtimes/components/remote-runtime-dialog.tsx
+++ b/packages/views/runtimes/components/remote-runtime-dialog.tsx
@@ -30,7 +30,7 @@ export function RemoteRuntimeDialog({
if (!open) onClose();
}}
>
- <DialogContent className="max-h-[85vh] overflow-y-auto sm:max-w-2xl">
+ <DialogContent className="max-h-[85%] overflow-y-auto sm:max-w-2xl">
<DialogHeader>
<DialogTitle>{t(($) => $.qoder.connect_title)}</DialogTitle>
<DialogDescription>
diff --git a/packages/views/runtimes/components/runtime-profiles-dialog.tsx b/packages/views/runtimes/components/runtime-profiles-dialog.tsx
index 092b1422d3..97b7436065 100644
--- a/packages/views/runtimes/components/runtime-profiles-dialog.tsx
+++ b/packages/views/runtimes/components/runtime-profiles-dialog.tsx
@@ -114,7 +114,7 @@ export function RuntimeProfilesDialog({
<Dialog open onOpenChange={(open) => !open && onClose()}>
<DialogContent
className={cn(
- "flex max-h-[88vh] flex-col gap-0 overscroll-contain p-0",
+ "flex max-h-[88%] flex-col gap-0 overscroll-contain p-0",
intent === "manage" ? "sm:max-w-3xl" : "sm:max-w-2xl",
)}
showCloseButton={false}
diff --git a/packages/views/settings/components/issue-statuses-tab.tsx b/packages/views/settings/components/issue-statuses-tab.tsx
index b29f6578da..64ecbfa320 100644
--- a/packages/views/settings/components/issue-statuses-tab.tsx
+++ b/packages/views/settings/components/issue-statuses-tab.tsx
@@ -272,7 +272,7 @@ export function IssueStatusesTab({
/>
<ArchiveStatusDialog open={archiveOpen && pendingArchive?.workspace_id === wsId} status={pendingArchive} onClose={() => setArchiveOpen(false)} onViewIssues={viewIssues} />
<Dialog open={inspectionOpen && inspection?.workspaceId === wsId} onOpenChange={setInspectionOpen} onOpenChangeComplete={(open) => !open && setInspection(null)}>
- <DialogContent className="flex h-[85dvh] flex-col overflow-hidden sm:max-w-6xl">
+ <DialogContent className="flex h-[85%] flex-col overflow-hidden sm:max-w-6xl">
{inspection?.workspaceId === wsId && <StatusIssueInspection key={`${wsId}:${inspection.status.key}`} status={inspection.status} onClose={() => setInspectionOpen(false)} />}
</DialogContent>
</Dialog>
diff --git a/packages/views/settings/components/mcp-tab.test.tsx b/packages/views/settings/components/mcp-tab.test.tsx
index e22e46540f..b550b519e0 100644
--- a/packages/views/settings/components/mcp-tab.test.tsx
+++ b/packages/views/settings/components/mcp-tab.test.tsx
@@ -276,7 +276,7 @@ describe("McpTab", () => {
);
const submit = screen.getByRole("button", { name: "Add" });
- expect(dialog).toHaveClass("flex", "max-h-[88vh]", "flex-col");
+ expect(dialog).toHaveClass("flex", "max-h-[88%]", "flex-col");
expect(scrollArea).toHaveClass("overflow-y-auto");
expect(scrollArea).not.toContainElement(footer);
expect(footer).toHaveClass("shrink-0", "border-t", "bg-muted/30");
diff --git a/packages/views/settings/components/properties-tab.tsx b/packages/views/settings/components/properties-tab.tsx
index 7de99d09f8..74e2c5ce2f 100644
--- a/packages/views/settings/components/properties-tab.tsx
+++ b/packages/views/settings/components/properties-tab.tsx
@@ -462,7 +462,7 @@ function PropertyEditorDialog({
{/* Options are unbounded, so the form is the part that has to give:
header and footer stay put and the fields scroll, keeping "Save
property" clickable no matter how many options are on the draft. */}
- <DialogContent className="flex max-h-[85dvh] flex-col sm:max-w-lg">
+ <DialogContent className="flex max-h-[85%] flex-col sm:max-w-lg">
<DialogHeader>
<DialogTitle>
{property
diff --git a/packages/views/settings/components/repositories-section.tsx b/packages/views/settings/components/repositories-section.tsx
index 9fc119fc28..c3c0b4195a 100644
--- a/packages/views/settings/components/repositories-section.tsx
+++ b/packages/views/settings/components/repositories-section.tsx
@@ -644,7 +644,7 @@ export function RepositoriesSection({ connection }: { connection: ReturnType<typ
if (!open && !saving) closeGitHubPicker();
}}
>
- <DialogContent className="flex max-h-[85vh] flex-col gap-0 p-0 sm:max-w-2xl">
+ <DialogContent className="flex max-h-[85%] flex-col gap-0 p-0 sm:max-w-2xl">
<DialogHeader className="border-b px-6 py-5">
<DialogTitle>
{t(($) => $.repositories.github_picker_title)}
diff --git a/packages/views/skills/components/create-skill-dialog.tsx b/packages/views/skills/components/create-skill-dialog.tsx
index 18b55cb7d9..3e7ede69b0 100644
--- a/packages/views/skills/components/create-skill-dialog.tsx
+++ b/packages/views/skills/components/create-skill-dialog.tsx
@@ -921,8 +921,8 @@ export function CreateSkillDialog({
className={cn(
"flex flex-col gap-0 overflow-hidden p-0",
wide
- ? "!h-[min(600px,85vh)] !max-w-2xl !w-full"
- : "!h-auto !max-h-[85vh] !max-w-md !w-full",
+ ? "!h-[min(600px,85%)] !max-w-2xl !w-full"
+ : "!h-auto !max-h-[85%] !max-w-md !w-full",
)}
>
{/* Header */}
diff --git a/packages/views/skills/components/skill-list-actions.tsx b/packages/views/skills/components/skill-list-actions.tsx
index bf38e90f7e..b202f547ce 100644
--- a/packages/views/skills/components/skill-list-actions.tsx
+++ b/packages/views/skills/components/skill-list-actions.tsx
@@ -313,7 +313,7 @@ export function AddToAgentDialog({
{/* Fixed-height dialog: header/chips/footer stay put, only the agent
list scrolls (flex-1 + min-h-0). One size up from the default
confirm dialogs — this is a working picker, not a prompt. */}
- <DialogContent className="flex h-[32rem] max-h-[85svh] max-w-lg flex-col">
+ <DialogContent className="flex h-[32rem] max-h-[85%] max-w-lg flex-col">
<DialogHeader>
<DialogTitle className="text-body">
{t(($) => $.actions.add_to_agent)}