fix: title generation + ai sdk upgrade (#1392)

This commit is contained in:
josh 2026-01-15 16:06:42 +00:00 committed by GitHub
parent f19d3d4071
commit 9d5d8a3ea7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 1422 additions and 2360 deletions

View file

@ -154,8 +154,7 @@ export function PromptInputProvider({
(FileUIPart & { id: string })[]
>([]);
const fileInputRef = useRef<HTMLInputElement | null>(null);
// biome-ignore lint/suspicious/noEmptyBlockStatements: noop initializer
const openRef = useRef<() => void>(() => {});
const openRef = useRef<() => void>(() => undefined);
const add = useCallback((files: File[] | FileList) => {
const incoming = Array.from(files);
@ -309,18 +308,18 @@ export function PromptInputAttachment({
{...props}
>
<div className="relative size-5 shrink-0">
<div className="absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded bg-background transition-opacity group-hover:opacity-0">
<div className="flex overflow-hidden absolute inset-0 justify-center items-center rounded transition-opacity size-5 bg-background group-hover:opacity-0">
{isImage ? (
/* biome-ignore lint/performance/noImgElement: dynamic user uploads */
<img
alt={filename || "attachment"}
className="size-5 object-cover"
className="object-cover size-5"
height={20}
src={data.url}
width={20}
/>
) : (
<div className="flex size-5 items-center justify-center text-muted-foreground">
<div className="flex justify-center items-center size-5 text-muted-foreground">
<PaperclipIcon className="size-3" />
</div>
)}
@ -343,14 +342,14 @@ export function PromptInputAttachment({
<span className="flex-1 truncate">{attachmentLabel}</span>
</div>
</HoverCardTrigger>
<PromptInputHoverCardContent className="w-auto p-2">
<div className="w-auto space-y-3">
<PromptInputHoverCardContent className="p-2 w-auto">
<div className="space-y-3 w-auto">
{isImage && (
<div className="flex max-h-96 w-96 items-center justify-center overflow-hidden rounded-md border">
<div className="flex overflow-hidden justify-center items-center w-96 max-h-96 rounded-md border">
{/* biome-ignore lint/performance/noImgElement: dynamic user uploads */}
<img
alt={filename || "attachment preview"}
className="max-h-full max-w-full object-contain"
className="object-contain max-w-full max-h-full"
height={384}
src={data.url}
width={448}
@ -359,11 +358,11 @@ export function PromptInputAttachment({
)}
<div className="flex items-center gap-2.5">
<div className="min-w-0 flex-1 space-y-1 px-0.5">
<h4 className="truncate font-semibold text-sm leading-none">
<h4 className="text-sm font-semibold leading-none truncate">
{filename || (isImage ? "Image" : "Attachment")}
</h4>
{data.mediaType && (
<p className="truncate font-mono text-muted-foreground text-xs">
<p className="font-mono text-xs truncate text-muted-foreground">
{data.mediaType}
</p>
)}
@ -395,7 +394,7 @@ export function PromptInputAttachments({
return (
<div
className={cn("flex w-full flex-wrap items-center gap-2 p-3", className)}
className={cn("flex flex-wrap gap-2 items-center p-3 w-full", className)}
{...props}
>
{attachments.files.map((file) => (
@ -913,7 +912,7 @@ export const PromptInputTextarea = ({
return (
<InputGroupTextarea
className={cn("field-sizing-content max-h-48 min-h-16", className)}
className={cn("max-h-48 field-sizing-content min-h-16", className)}
name="message"
onCompositionEnd={() => setIsComposing(false)}
onCompositionStart={() => setIsComposing(true)}
@ -937,7 +936,7 @@ export const PromptInputHeader = ({
}: PromptInputHeaderProps) => (
<InputGroupAddon
align="block-end"
className={cn("order-first flex-wrap gap-1", className)}
className={cn("flex-wrap order-first gap-1", className)}
{...props}
/>
);
@ -953,7 +952,7 @@ export const PromptInputFooter = ({
}: PromptInputFooterProps) => (
<InputGroupAddon
align="block-end"
className={cn("justify-between gap-1", className)}
className={cn("gap-1 justify-between", className)}
{...props}
/>
);
@ -964,7 +963,7 @@ export const PromptInputTools = ({
className,
...props
}: PromptInputToolsProps) => (
<div className={cn("flex items-center gap-1", className)} {...props} />
<div className={cn("flex gap-1 items-center", className)} {...props} />
);
export type PromptInputButtonProps = ComponentProps<typeof InputGroupButton>;
@ -1046,7 +1045,7 @@ export const PromptInputSubmit = ({
let Icon = <CornerDownLeftIcon className="size-4" />;
if (status === "submitted") {
Icon = <Loader2Icon className="size-4 animate-spin" />;
Icon = <Loader2Icon className="animate-spin size-4" />;
} else if (status === "streaming") {
Icon = <SquareIcon className="size-4" />;
} else if (status === "error") {
@ -1111,7 +1110,6 @@ interface SpeechRecognitionErrorEvent extends Event {
}
declare global {
// biome-ignore lint/nursery/useConsistentTypeDefinitions: global augmentation requires interface
interface Window {
SpeechRecognition: {
new (): SpeechRecognition;
@ -1244,7 +1242,7 @@ export const PromptInputSelectTrigger = ({
}: PromptInputSelectTriggerProps) => (
<SelectTrigger
className={cn(
"border-none bg-transparent font-medium text-muted-foreground shadow-none transition-colors",
"font-medium bg-transparent border-none shadow-none transition-colors text-muted-foreground",
"hover:bg-accent hover:text-foreground aria-expanded:bg-accent aria-expanded:text-foreground",
className
)}
@ -1332,7 +1330,7 @@ export const PromptInputTabLabel = ({
}: PromptInputTabLabelProps) => (
<h3
className={cn(
"mb-2 px-3 font-medium text-muted-foreground text-xs",
"px-3 mb-2 text-xs font-medium text-muted-foreground",
className
)}
{...props}
@ -1356,7 +1354,7 @@ export const PromptInputTabItem = ({
}: PromptInputTabItemProps) => (
<div
className={cn(
"flex items-center gap-2 px-3 py-2 text-xs hover:bg-accent",
"flex gap-2 items-center px-3 py-2 text-xs hover:bg-accent",
className
)}
{...props}