Files
boocode/apps/web/src/components/AttachmentPreviewModal.tsx
indifferentketchup c35ec65fc4 batch4: chats-in-sessions, force-send, /compact, right-rail file browser
Session 1:N Chat data model with backfill. Workspace switches to client-side
multi-tab pane management. Right-rail file browser with float-over viewer and
click-drag line selection replaces FileBrowserPane. Adds /compact streaming
summarizer (respects compact markers in context builder), force-send (cancels
in-flight, persists partial as 'cancelled', awaits cancellation completion via
deferred Promise + 5s timeout), message queue, stop generation, chat
auto-rename, session archive/unarchive with Closed Sessions section on repo
landing page. CHECK constraints on sessions.status, messages.role,
messages.status with KEEP IN SYNC comments tying to MESSAGE_ROLES /
MESSAGE_STATUSES const arrays. Deletes dead pane routes/hook and the
api.panes.* client block.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 20:39:48 +00:00

38 lines
1.0 KiB
TypeScript

import type { Attachment } from '@/lib/attachments';
import { CodeBlock } from '@/components/CodeBlock';
import {
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
} from '@/components/ui/dialog';
interface Props {
attachment: Attachment | null;
onClose: () => void;
}
export function AttachmentPreviewModal({ attachment, onClose }: Props) {
const title = attachment
? attachment.kind === 'lines' && attachment.range
? `${attachment.filename}:${attachment.range[0]}-${attachment.range[1]}`
: attachment.filename
: '';
return (
<Dialog open={attachment !== null} onOpenChange={() => onClose()}>
<DialogContent className="sm:max-w-2xl max-h-[80vh] overflow-y-auto">
<DialogHeader>
<DialogTitle className="font-mono text-sm">{title}</DialogTitle>
</DialogHeader>
{attachment && (
<CodeBlock
code={attachment.content}
lang={attachment.language ?? undefined}
/>
)}
</DialogContent>
</Dialog>
);
}