Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

chore: show compact attachment count instead of thumbnails in comment previews

memoclaw4f6730a12eea
diff --git a/web/src/components/MemoPreview/MemoPreview.tsx b/web/src/components/MemoPreview/MemoPreview.tsx
index 91a059625..7149a5a04 100644
--- a/web/src/components/MemoPreview/MemoPreview.tsx
+++ b/web/src/components/MemoPreview/MemoPreview.tsx
@@ -132,9 +132,17 @@ const MemoPreview = ({
)}
>
{showMeta && meta}
- {showMeta && truncate && hasContent && <div className="text-muted-foreground/50 shrink-0">·</div>}
+ {showMeta && truncate && (hasContent || hasAttachments) && <div className="text-muted-foreground/50 shrink-0">·</div>}
{contentNode}
- {hasAttachments && <AttachmentThumbnails attachments={attachments} />}
+ {hasAttachments &&
+ (truncate ? (
+ <div className="shrink-0 text-muted-foreground/70 inline-flex justify-center items-center gap-0.5">
+ <FileIcon className="w-3 h-3 inline-block" />
+ <span className="text-xs">{attachments.length}</span>
+ </div>
+ ) : (
+ <AttachmentThumbnails attachments={attachments} />
+ ))}
</div>
</MemoViewContext.Provider>
);