Files
openchamber/packages/ui/src/components/views/git/AIHighlightsBox.tsx
T
Bohdan Triapitsyn 63da6e6292 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).
2026-04-30 22:41:33 +03:00

56 lines
1.6 KiB
TypeScript

import React from 'react';
import { RiArrowDownLine } from '@remixicon/react';
import { Button } from '@/components/ui/button';
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
import { useI18n } from '@/lib/i18n';
interface AIHighlightsBoxProps {
highlights: string[];
onInsert: (highlights: string[]) => void;
}
export const AIHighlightsBox: React.FC<AIHighlightsBoxProps> = ({
highlights,
onInsert,
}) => {
const { t } = useI18n();
if (highlights.length === 0) {
return null;
}
const handleInsert = () => {
onInsert(highlights);
};
return (
<div className="space-y-2 rounded-xl border border-border/60 bg-transparent px-3 py-2">
<div className="flex items-center justify-between gap-2">
<p className="typography-micro text-muted-foreground">{t('gitView.commit.aiHighlights.title')}</p>
<Tooltip>
<TooltipTrigger asChild>
<Button
variant="ghost"
size="icon"
className="size-6"
onClick={handleInsert}
aria-label={t('gitView.commit.aiHighlights.insertAria')}
>
<RiArrowDownLine className="size-4" />
</Button>
</TooltipTrigger>
<TooltipContent sideOffset={8}>
{t('gitView.commit.aiHighlights.insertTooltip')}
</TooltipContent>
</Tooltip>
</div>
<ul className="space-y-1">
{highlights.map((highlight, index) => (
<li key={`${highlight}-${index}`} className="typography-meta text-foreground">
{highlight}
</li>
))}
</ul>
</div>
);
};