From 9b7d37dd8abfa38c12de2c02c7d711f5499e6d50 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Fri, 3 Jan 2025 15:10:12 +0000 Subject: [PATCH] More emojis --- plugin/src/views/history-view.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/plugin/src/views/history-view.ts b/plugin/src/views/history-view.ts index 481c16d..4f6050c 100644 --- a/plugin/src/views/history-view.ts +++ b/plugin/src/views/history-view.ts @@ -1,6 +1,6 @@ import type { WorkspaceLeaf } from "obsidian"; import { ItemView } from "obsidian"; -import type { SyncHistory } from "src/tracing/sync-history"; +import { SyncHistory, SyncType } from "src/tracing/sync-history"; import { SyncSource, SyncStatus } from "src/tracing/sync-history"; import { intlFormatDistance } from "date-fns"; import type { Database } from "src/database/database"; @@ -24,6 +24,20 @@ export class HistoryView extends ItemView { }); } + private static formatSyncType(type: SyncType | undefined): string { + switch (type) { + case SyncType.CREATE: + return "👶 "; + case SyncType.DELETE: + return "🗑️ "; + case SyncType.UPDATE: + return "✍️ "; + case undefined: + default: + return ""; + } + } + private static formatSource(source: SyncSource | undefined): string { switch (source) { case SyncSource.PUSH: @@ -76,6 +90,7 @@ export class HistoryView extends ItemView { const header = card.createDiv({ cls: "history-card-header" }); header.createEl("h5", { text: + HistoryView.formatSyncType(entry.type) + entry.relativePath + HistoryView.formatSource(entry.source), cls: "history-card-title",