fix+upstream: hooks-order crash, ConfirmDialog/PageHeader/skeletons, styled error boundary
Hoists hooks above early return (render-time Navigate); ports finance's ConfirmDialog/PageHeader/loading/states + APC error-copy mapper; removes window.confirm, dead appbar search, and seeded fake notifications; wires toasts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -111,6 +111,7 @@ import { TypingIndicator } from "@crema/chat-ui"
|
||||
import { CommandBar } from "@crema/aifirst-ui"
|
||||
|
||||
import { AppShell } from "~/components/layout/app-shell"
|
||||
import { ConfirmDialog } from "~/components/confirm-dialog"
|
||||
import { MessageBody } from "~/components/assistant/message-body"
|
||||
import { Button } from "~/components/ui/button"
|
||||
import {
|
||||
@@ -1956,20 +1957,32 @@ function ThreadsPicker({
|
||||
>
|
||||
<Pencil className="size-3.5" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
data-action={`assistant-thread-delete-${t.id}`}
|
||||
onClick={() => {
|
||||
<ConfirmDialog
|
||||
trigger={
|
||||
<button
|
||||
type="button"
|
||||
data-action={`assistant-thread-delete-${t.id}`}
|
||||
disabled={threads.length <= 1}
|
||||
className="rounded p-1 text-muted-foreground opacity-0 hover:bg-destructive/10 hover:text-destructive group-hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-30"
|
||||
title={
|
||||
threads.length <= 1
|
||||
? "Can't delete the last conversation"
|
||||
: "Delete"
|
||||
}
|
||||
aria-label="Delete"
|
||||
>
|
||||
<Trash2 className="size-3.5" />
|
||||
</button>
|
||||
}
|
||||
title="Delete conversation?"
|
||||
description={`"${t.title}" and its messages will be permanently removed.`}
|
||||
confirmLabel="Delete"
|
||||
destructive
|
||||
onConfirm={() => {
|
||||
if (threads.length <= 1) return
|
||||
if (window.confirm(`Delete "${t.title}"?`)) onDelete(t.id)
|
||||
onDelete(t.id)
|
||||
}}
|
||||
disabled={threads.length <= 1}
|
||||
className="rounded p-1 text-muted-foreground opacity-0 hover:bg-destructive/10 hover:text-destructive group-hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-30"
|
||||
title="Delete"
|
||||
aria-label="Delete"
|
||||
>
|
||||
<Trash2 className="size-3.5" />
|
||||
</button>
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user