feat(ui): unify overlay animations and trim tooltip delays
Use base-ui's transition-status pattern (data-starting-style / data-ending-style) for Dialog, DropdownMenu, Select, Tooltip and Popover so open/close animate consistently at 150ms ease-out without flicker. Wrap dialog popups in a centered flex container so the scale animation no longer fights with translate-based positioning, and switch PendingChangesBar to a real Popover so it actually animates closed. Convert ScheduledTaskEditorDialog from raw Radix to the shared Dialog wrapper, give ScheduledTasksDialog a stable min-height to prevent layout shift mid-animation, and reset NewWorktreeDialog form state on open instead of close so fields don't empty during the close transition. Drop tooltip delay from 700ms to 300ms globally and remove all per-component overrides except the model/variant/agent selectors in the chat input (600ms).
This commit is contained in:
@@ -435,7 +435,7 @@ export function BranchPickerDialog({ open, onOpenChange, project }: BranchPicker
|
||||
|
||||
{!isEditing && !isConfirming ? (
|
||||
<div className="flex items-center gap-1 flex-shrink-0">
|
||||
<Tooltip delayDuration={700}>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<button
|
||||
type="button"
|
||||
@@ -456,7 +456,7 @@ export function BranchPickerDialog({ open, onOpenChange, project }: BranchPicker
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
|
||||
<Tooltip delayDuration={700}>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<button
|
||||
type="button"
|
||||
@@ -473,7 +473,7 @@ export function BranchPickerDialog({ open, onOpenChange, project }: BranchPicker
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
|
||||
<Tooltip delayDuration={700}>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -657,46 +657,39 @@ export function NewWorktreeDialog({
|
||||
void loadDefaultSourceBranch();
|
||||
}, [branches, projectDirectory, newBranchState.sourceBranch]);
|
||||
|
||||
// Reset state when dialog opens/closes
|
||||
// Reset state on each open. Resetting on close would empty the form during
|
||||
// the close animation, causing visible flicker.
|
||||
React.useEffect(() => {
|
||||
if (!open) {
|
||||
setMode('new-branch');
|
||||
setNewBranchState({
|
||||
branchName: '',
|
||||
worktreeName: '',
|
||||
isSyncingWorktreeName: true,
|
||||
sourceBranch: '',
|
||||
linkedIssue: null,
|
||||
linkedPr: null,
|
||||
includePrDiff: false,
|
||||
});
|
||||
setExistingBranchState({
|
||||
selectedBranch: '',
|
||||
worktreeName: '',
|
||||
});
|
||||
setExistingBranchDropdownOpen(false);
|
||||
setSourceBranchDropdownOpen(false);
|
||||
setExistingBranchPickerOpen(false);
|
||||
setSourceBranchPickerOpen(false);
|
||||
setExistingBranchQuery('');
|
||||
setSourceBranchQuery('');
|
||||
setValidation({
|
||||
isValidating: false,
|
||||
branchError: null,
|
||||
worktreeError: null,
|
||||
touched: false,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Generate unique slug when dialog opens
|
||||
if (!open) return;
|
||||
|
||||
setMode('new-branch');
|
||||
setExistingBranchState({
|
||||
selectedBranch: '',
|
||||
worktreeName: '',
|
||||
});
|
||||
setExistingBranchDropdownOpen(false);
|
||||
setSourceBranchDropdownOpen(false);
|
||||
setExistingBranchPickerOpen(false);
|
||||
setSourceBranchPickerOpen(false);
|
||||
setExistingBranchQuery('');
|
||||
setSourceBranchQuery('');
|
||||
setValidation({
|
||||
isValidating: false,
|
||||
branchError: null,
|
||||
worktreeError: null,
|
||||
touched: false,
|
||||
});
|
||||
|
||||
const uniqueSlug = generateUniqueSlug();
|
||||
setNewBranchState(prev => ({
|
||||
...prev,
|
||||
setNewBranchState({
|
||||
branchName: uniqueSlug,
|
||||
worktreeName: uniqueSlug,
|
||||
isSyncingWorktreeName: true,
|
||||
}));
|
||||
sourceBranch: '',
|
||||
linkedIssue: null,
|
||||
linkedPr: null,
|
||||
includePrDiff: false,
|
||||
});
|
||||
}, [open, generateUniqueSlug]);
|
||||
|
||||
// Sync worktree name with branch name for new-branch mode
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
||||
import { Dialog, DialogContent, DialogTitle, DialogDescription } from '@/components/ui/dialog';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { ScrollShadow } from '@/components/ui/ScrollShadow';
|
||||
import { Input } from '@/components/ui/input';
|
||||
@@ -1456,7 +1456,7 @@ export function ScheduledTaskEditorDialog(props: {
|
||||
}
|
||||
|
||||
return (
|
||||
<DialogPrimitive.Root
|
||||
<Dialog
|
||||
open={open}
|
||||
onOpenChange={(next) => {
|
||||
if (!next && hasOpenFloatingMenu()) {
|
||||
@@ -1465,55 +1465,35 @@ export function ScheduledTaskEditorDialog(props: {
|
||||
onOpenChange(next);
|
||||
}}
|
||||
>
|
||||
<DialogPrimitive.Portal>
|
||||
<DialogPrimitive.Overlay className="fixed inset-0 z-50 bg-black/50 dark:bg-black/75" />
|
||||
<DialogPrimitive.Content
|
||||
aria-describedby={descriptionId}
|
||||
className={cn(
|
||||
'fixed z-50 top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%]',
|
||||
'w-[90vw] max-w-[720px] h-[680px] max-h-[85vh]',
|
||||
'flex flex-col rounded-xl border shadow-none overflow-hidden',
|
||||
'bg-background'
|
||||
)}
|
||||
<DialogContent
|
||||
aria-describedby={descriptionId}
|
||||
className="!max-w-[720px] w-[90vw] h-[680px] max-h-[85vh] gap-0 p-0 overflow-hidden"
|
||||
>
|
||||
<DialogDescription id={descriptionId} className="sr-only">
|
||||
{description}
|
||||
</DialogDescription>
|
||||
|
||||
<header className="shrink-0 px-4 sm:px-6 pt-5 pb-3">
|
||||
<div className="mx-auto w-full max-w-2xl">
|
||||
<DialogTitle className="typography-ui-label font-medium text-foreground">
|
||||
{title}
|
||||
</DialogTitle>
|
||||
<p className="typography-meta mt-0.5 text-muted-foreground">{description}</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<ScrollShadow
|
||||
className="flex-1 min-h-0 overflow-auto [scrollbar-gutter:stable_both-edges]"
|
||||
size={64}
|
||||
hideTopShadow
|
||||
>
|
||||
<div className="absolute right-0.5 top-0.5 z-50">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => onOpenChange(false)}
|
||||
aria-label={t('sessions.scheduledTasks.editor.actions.closeAria')}
|
||||
className="inline-flex h-7 w-7 items-center justify-center rounded-md p-0.5 text-muted-foreground hover:bg-interactive-hover/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
|
||||
>
|
||||
<RiCloseLine className="h-5 w-5" />
|
||||
</button>
|
||||
</div>
|
||||
<DialogPrimitive.Description id={descriptionId} className="sr-only">
|
||||
{description}
|
||||
</DialogPrimitive.Description>
|
||||
<div className="mx-auto w-full max-w-2xl px-4 sm:px-6 pb-5">{formBody}</div>
|
||||
</ScrollShadow>
|
||||
|
||||
<header className="shrink-0 px-4 sm:px-6 pt-5 pb-3">
|
||||
<div className="mx-auto w-full max-w-2xl">
|
||||
<DialogPrimitive.Title className="typography-ui-label font-medium text-foreground">
|
||||
{title}
|
||||
</DialogPrimitive.Title>
|
||||
<p className="typography-meta mt-0.5 text-muted-foreground">
|
||||
{description}
|
||||
</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<ScrollShadow className="flex-1 min-h-0 overflow-auto [scrollbar-gutter:stable_both-edges]" size={64} hideTopShadow>
|
||||
<div className="mx-auto w-full max-w-2xl px-4 sm:px-6 pb-5">
|
||||
{formBody}
|
||||
</div>
|
||||
</ScrollShadow>
|
||||
|
||||
<div className="shrink-0 px-4 sm:px-6 py-3">
|
||||
<div className="mx-auto w-full max-w-2xl">
|
||||
{footerRow}
|
||||
</div>
|
||||
</div>
|
||||
</DialogPrimitive.Content>
|
||||
</DialogPrimitive.Portal>
|
||||
</DialogPrimitive.Root>
|
||||
<div className="shrink-0 px-4 sm:px-6 py-3">
|
||||
<div className="mx-auto w-full max-w-2xl">{footerRow}</div>
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -192,7 +192,9 @@ export function ScheduledTasksDialog() {
|
||||
|
||||
const [selectedProjectID, setSelectedProjectID] = React.useState<string>('');
|
||||
const [tasks, setTasks] = React.useState<ScheduledTask[]>([]);
|
||||
const [loading, setLoading] = React.useState(false);
|
||||
// Start in loading state so the first frame after open shows the spinner,
|
||||
// not an empty/select-project flash before the fetch effect runs.
|
||||
const [loading, setLoading] = React.useState(true);
|
||||
const [editorOpen, setEditorOpen] = React.useState(false);
|
||||
const [editorTask, setEditorTask] = React.useState<ScheduledTask | null>(null);
|
||||
const [mutatingTaskID, setMutatingTaskID] = React.useState<string | null>(null);
|
||||
@@ -276,6 +278,7 @@ export function ScheduledTasksDialog() {
|
||||
void reloadTasks(preferredProjectID);
|
||||
} else {
|
||||
setTasks([]);
|
||||
setLoading(false);
|
||||
}
|
||||
}, [open, activeProject, projects, reloadTasks]);
|
||||
|
||||
@@ -427,6 +430,7 @@ export function ScheduledTasksDialog() {
|
||||
projectSelector
|
||||
)}
|
||||
|
||||
<div className="min-h-[280px]">
|
||||
{loading ? (
|
||||
<div className="flex items-center gap-2 typography-meta text-muted-foreground">
|
||||
<RiLoader4Line className="h-4 w-4 animate-spin" /> {t('sessions.scheduledTasks.dialog.loading')}
|
||||
@@ -579,6 +583,7 @@ export function ScheduledTasksDialog() {
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ export const SortableProjectItem: React.FC<SortableProjectItemProps> = ({
|
||||
style={{ backgroundColor: isDesktopShell && isStuck ? 'transparent' : undefined }}
|
||||
>
|
||||
<div className="relative flex items-center gap-1 px-0.5 py-0.5" {...attributes}>
|
||||
<Tooltip delayDuration={1500}>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
Reference in New Issue
Block a user