docs: update CLAUDE.md, ROADMAP.md, SESSION-LOG.md
- Registratura v0.4.0 with QuickLook preview description - New task 3.03d: QuickLook + bug fixes (NAS links, overflow, vault filter) - Session log updated with all fixes and new features - attachment-preview.tsx added to key files list
This commit is contained in:
@@ -32,10 +32,7 @@ const ZOOM_STEP = 0.25;
|
||||
|
||||
/** Check if a MIME type can be previewed */
|
||||
function isPreviewable(type: string): boolean {
|
||||
return (
|
||||
type.startsWith("image/") ||
|
||||
type === "application/pdf"
|
||||
);
|
||||
return type.startsWith("image/") || type === "application/pdf";
|
||||
}
|
||||
|
||||
/** Filter to only previewable attachments with inline data */
|
||||
@@ -169,7 +166,12 @@ export function AttachmentPreview({
|
||||
if (!isImage || zoom <= 1) return;
|
||||
e.preventDefault();
|
||||
setIsPanning(true);
|
||||
panStart.current = { x: e.clientX, y: e.clientY, panX: pan.x, panY: pan.y };
|
||||
panStart.current = {
|
||||
x: e.clientX,
|
||||
y: e.clientY,
|
||||
panX: pan.x,
|
||||
panY: pan.y,
|
||||
};
|
||||
},
|
||||
[isImage, zoom, pan],
|
||||
);
|
||||
@@ -239,7 +241,9 @@ export function AttachmentPreview({
|
||||
if (!open || !att) return null;
|
||||
|
||||
const fileExt =
|
||||
att.name.split(".").pop()?.toUpperCase() ?? att.type.split("/")[1]?.toUpperCase() ?? "FILE";
|
||||
att.name.split(".").pop()?.toUpperCase() ??
|
||||
att.type.split("/")[1]?.toUpperCase() ??
|
||||
"FILE";
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 z-[100] flex flex-col bg-black/90 backdrop-blur-sm animate-in fade-in duration-200">
|
||||
@@ -270,7 +274,9 @@ export function AttachmentPreview({
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 text-white/70 hover:text-white hover:bg-white/10"
|
||||
onClick={() => setZoom((z) => Math.max(z - ZOOM_STEP, ZOOM_MIN))}
|
||||
onClick={() =>
|
||||
setZoom((z) => Math.max(z - ZOOM_STEP, ZOOM_MIN))
|
||||
}
|
||||
title="Micșorează (−)"
|
||||
>
|
||||
<Minus className="h-4 w-4" />
|
||||
@@ -278,7 +284,10 @@ export function AttachmentPreview({
|
||||
<button
|
||||
type="button"
|
||||
className="px-2 text-xs text-white/70 hover:text-white font-mono min-w-[3.5rem] text-center"
|
||||
onClick={() => { setZoom(1); setPan({ x: 0, y: 0 }); }}
|
||||
onClick={() => {
|
||||
setZoom(1);
|
||||
setPan({ x: 0, y: 0 });
|
||||
}}
|
||||
title="Resetează zoom (0)"
|
||||
>
|
||||
{Math.round(zoom * 100)}%
|
||||
@@ -287,7 +296,9 @@ export function AttachmentPreview({
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 text-white/70 hover:text-white hover:bg-white/10"
|
||||
onClick={() => setZoom((z) => Math.min(z + ZOOM_STEP, ZOOM_MAX))}
|
||||
onClick={() =>
|
||||
setZoom((z) => Math.min(z + ZOOM_STEP, ZOOM_MAX))
|
||||
}
|
||||
title="Mărește (+)"
|
||||
>
|
||||
<Plus className="h-4 w-4" />
|
||||
@@ -347,7 +358,10 @@ export function AttachmentPreview({
|
||||
<button
|
||||
type="button"
|
||||
className="absolute left-3 top-1/2 -translate-y-1/2 z-10 flex items-center justify-center w-10 h-10 rounded-full bg-black/50 text-white/70 hover:text-white hover:bg-black/70 transition-colors"
|
||||
onClick={(e) => { e.stopPropagation(); goPrev(); }}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
goPrev();
|
||||
}}
|
||||
title="Anterior (←)"
|
||||
>
|
||||
<ChevronLeft className="h-5 w-5" />
|
||||
@@ -355,7 +369,10 @@ export function AttachmentPreview({
|
||||
<button
|
||||
type="button"
|
||||
className="absolute right-3 top-1/2 -translate-y-1/2 z-10 flex items-center justify-center w-10 h-10 rounded-full bg-black/50 text-white/70 hover:text-white hover:bg-black/70 transition-colors"
|
||||
onClick={(e) => { e.stopPropagation(); goNext(); }}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
goNext();
|
||||
}}
|
||||
title="Următor (→)"
|
||||
>
|
||||
<ChevronRight className="h-5 w-5" />
|
||||
|
||||
@@ -617,17 +617,16 @@ export function RegistryEntryDetail({
|
||||
)}
|
||||
</div>
|
||||
</ScrollArea>
|
||||
{/* QuickLook-style attachment preview */}
|
||||
{previewIndex !== null && (
|
||||
<AttachmentPreview
|
||||
key={previewIndex}
|
||||
attachments={previewableAtts}
|
||||
initialIndex={previewIndex}
|
||||
open
|
||||
onClose={() => setPreviewIndex(null)}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* QuickLook-style attachment preview */}
|
||||
{previewIndex !== null && (
|
||||
<AttachmentPreview
|
||||
key={previewIndex}
|
||||
attachments={previewableAtts}
|
||||
initialIndex={previewIndex}
|
||||
open
|
||||
onClose={() => setPreviewIndex(null)}
|
||||
/>
|
||||
)}
|
||||
</SheetContent>
|
||||
</Sheet>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user