Skip to content

Build your personal knowledge base with Trilium Notes

feat(revisions): add an icon based on the source

Elian Doran315a97701bee
diff --git a/apps/client/src/widgets/dialogs/revisions.css b/apps/client/src/widgets/dialogs/revisions.css
index 3a49fa5c28..438d32061a 100644
--- a/apps/client/src/widgets/dialogs/revisions.css
+++ b/apps/client/src/widgets/dialogs/revisions.css
@@ -69,6 +69,10 @@ body.mobile .revisions-dialog {
.revision-list {
flex-shrink: 0;
+
+ .dropdown-item + .dropdown-item {
+ border-top: 1px solid var(--main-border-color) !important;
+ }
}
.save-revision-controls {
diff --git a/apps/client/src/widgets/dialogs/revisions.tsx b/apps/client/src/widgets/dialogs/revisions.tsx
index 12a8316e61..56f9114bc1 100644
--- a/apps/client/src/widgets/dialogs/revisions.tsx
+++ b/apps/client/src/widgets/dialogs/revisions.tsx
@@ -189,6 +189,15 @@ function SaveRevisionButton({ noteId, onSaved }: { noteId: string, onSaved: () =
);
}
+const REVISION_SOURCE_ICONS: Record<string, string> = {
+ auto: "bx bx-time-five",
+ manual: "bx bx-save",
+ etapi: "bx bx-code-alt",
+ llm: "bx bx-bot",
+ restore: "bx bx-history"
+};
+const DEFAULT_REVISION_ICON = "bx bx-file";
+
function RevisionsList({ revisions, onSelect, currentRevision }: { revisions: RevisionItem[], onSelect: (val: string) => void, currentRevision?: RevisionItem }) {
return (
<FormList onSelect={onSelect} fullHeight wrapperClassName="revision-list">
@@ -196,6 +205,7 @@ function RevisionsList({ revisions, onSelect, currentRevision }: { revisions: Re
<FormListItem
key={item.revisionId}
value={item.revisionId}
+ icon={REVISION_SOURCE_ICONS[item.source ?? ""] ?? DEFAULT_REVISION_ICON}
active={currentRevision && item.revisionId === currentRevision.revisionId}
>
<div>