Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(ui): adjust dialog backdrop to prevent scroll lock

Steven Enamakelb3ccacb5165e
diff --git a/app/src/components/ui/Dialog.tsx b/app/src/components/ui/Dialog.tsx
index c04f6f40ad..c0f9a6a7f3 100644
--- a/app/src/components/ui/Dialog.tsx
+++ b/app/src/components/ui/Dialog.tsx
@@ -52,11 +52,12 @@ export const DialogContent = ({
<DialogPrimitive.Content
data-slot="dialog-content"
// `animate-dialog-in`, NOT `animate-fade-up`. This element is centered by
- // the `-translate-*-1/2` pair below, and an entrance whose keyframes set
- // `transform` would replace that pair for the animation's duration --
- // the dialog would open offset toward the bottom-right and snap into
- // place when the animation ended. `dialogIn` carries the centering in
- // its own frames; see the keyframe comment in tailwind.config.js.
+ // the `-translate-*-1/2` pair below, which under Tailwind v4 compiles to
+ // the `translate` property. An entrance whose keyframes set `transform`
+ // composes with that pair instead of replacing it, so the dialog opens
+ // offset and snaps into place when the animation ends. `dialogIn`
+ // animates `translate` and carries the centering in its own frames; see
+ // the keyframe comment in `index.css`.
className={cn(
'fixed left-1/2 top-1/2 z-50 w-full max-w-md -translate-x-1/2 -translate-y-1/2',
'overflow-hidden rounded-2xl bg-surface shadow-large animate-dialog-in focus:outline-hidden',
diff --git a/app/src/index.css b/app/src/index.css
index ea6cbc28ce..9496a6d3af 100644
--- a/app/src/index.css
+++ b/app/src/index.css
@@ -314,14 +314,30 @@
transform: translateY(0);
}
}
+ /* Entrance for the centered dialog surfaces (`ui/Dialog`, `ui/AlertDialog`).
+ Animates the `translate` PROPERTY, not `transform`, and that distinction is
+ the whole point of this keyframe.
+
+ Those dialogs center with `-translate-x-1/2 -translate-y-1/2`. Under
+ Tailwind v3 those utilities compiled into `transform`, so a keyframe
+ setting `transform` *replaced* the centering for the animation's duration
+ and only had to carry the -50% pair itself. Under v4 they compile to
+ `translate: var(--tw-translate-x) var(--tw-translate-y)` instead — a
+ separate property that composes with `transform` rather than being
+ overridden by it. A `transform: translate(-50%, …)` keyframe therefore
+ *added* to the utility, so every modal opened at -100%/-100% (up and to
+ the left of center) and snapped into place when the animation ended.
+
+ Animating `translate` overrides the same property the utility sets and
+ lands on the identical value, so there is nothing left to snap. */
@keyframes dialogIn {
0% {
opacity: 0;
- transform: translate(-50%, calc(-50% + 10px));
+ translate: -50% calc(-50% + 10px);
}
100% {
opacity: 1;
- transform: translate(-50%, -50%);
+ translate: -50% -50%;
}
}
@keyframes slideIn {