Skip to content

Build your personal knowledge base with Trilium Notes

chore(collections/list): style archived notes differently

Elian Doranbacbe9f47c58
diff --git a/apps/client/src/services/attribute_renderer.ts b/apps/client/src/services/attribute_renderer.ts
index 9432eebc61..01d6337367 100644
--- a/apps/client/src/services/attribute_renderer.ts
+++ b/apps/client/src/services/attribute_renderer.ts
@@ -90,7 +90,8 @@ const HIDDEN_ATTRIBUTES = [
"viewType",
"geolocation",
"docName",
- "webViewSrc"
+ "webViewSrc",
+ "archived"
];
async function renderNormalAttributes(note: FNote) {
diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.css b/apps/client/src/widgets/collections/legacy/ListOrGridView.css
index 60afe89549..2a6b25366a 100644
--- a/apps/client/src/widgets/collections/legacy/ListOrGridView.css
+++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.css
@@ -16,6 +16,10 @@
flex-grow: 1;
}
+.note-book-card.archived {
+ opacity: 0.5;
+}
+
.note-book-card:not(.expanded) .note-book-content {
padding: 10px
}
diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx
index 2b5d1bdd0c..ef37b6685e 100644
--- a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx
+++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx
@@ -64,7 +64,7 @@ function ListNoteCard({ note, parentNote, expand, highlightedTokens }: { note: F
return (
<div
- className={`note-book-card no-tooltip-preview ${isExpanded ? "expanded" : ""}`}
+ className={`note-book-card no-tooltip-preview ${isExpanded ? "expanded" : ""} ${note.isArchived ? "archived" : ""}`}
data-note-id={note.noteId}
>
<h5 className="note-book-header">
@@ -100,7 +100,7 @@ function GridNoteCard({ note, parentNote, highlightedTokens }: { note: FNote, pa
return (
<div
- className={`note-book-card no-tooltip-preview block-link`}
+ className={`note-book-card no-tooltip-preview block-link ${note.isArchived ? "archived" : ""}`}
data-href={`#${notePath}`}
data-note-id={note.noteId}
onClick={(e) => link.goToLink(e)}