Skip to content

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

fix(assistant-ui): handle missing image in dialog component

Steven Enamakel2573375b6dfd
diff --git a/app/src/components/assistant-ui/elements/image.tsx b/app/src/components/assistant-ui/elements/image.tsx
index 690b79f00a..26947793cf 100644
--- a/app/src/components/assistant-ui/elements/image.tsx
+++ b/app/src/components/assistant-ui/elements/image.tsx
@@ -337,13 +337,14 @@ function RegenerateButton({ onRegenerate }: { onRegenerate: () => void | Promise
}
function ImageActions({ part, onRegenerate, className }: ImageActionsProps) {
+ const { t } = useT();
return (
<div data-slot="image-actions" className={cn('flex items-center gap-1 p-1', className)}>
<button
type="button"
onClick={() => downloadImagePart(part)}
data-slot="image-download"
- aria-label="Download image"
+ aria-label={t('elements.image.downloadAria', 'Download image')}
className="hover:bg-muted inline-flex size-7 items-center justify-center rounded">
<DownloadIcon className="size-4" />
</button>
@@ -353,7 +354,7 @@ function ImageActions({ part, onRegenerate, className }: ImageActionsProps) {
copyImagePart(part).catch(() => {});
}}
data-slot="image-copy"
- aria-label="Copy image"
+ aria-label={t('share.copyImage', 'Copy image')}
className="hover:bg-muted inline-flex size-7 items-center justify-center rounded">
<CopyIcon className="size-4" />
</button>
diff --git a/app/src/components/assistant-ui/ui/dialog.tsx b/app/src/components/assistant-ui/ui/dialog.tsx
index 1eea454567..cd95c92e1c 100644
--- a/app/src/components/assistant-ui/ui/dialog.tsx
+++ b/app/src/components/assistant-ui/ui/dialog.tsx
@@ -1,5 +1,6 @@
import { cn } from '@/components/assistant-ui/lib/utils';
import { Button } from '@/components/assistant-ui/ui/button';
+import { useT } from '@/lib/i18n/I18nContext';
import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
import { XIcon } from 'lucide-react';