From 73c281aa3358618aa8bec7188e8953948bf99731 Mon Sep 17 00:00:00 2001 From: Arjun <6592213+arkml@users.noreply.github.com> Date: Thu, 19 Mar 2026 01:14:14 +0530 Subject: [PATCH] show last ran time stamp --- .../apps/renderer/src/extensions/task-block.tsx | 16 ++++++++++++++++ apps/x/apps/renderer/src/styles/editor.css | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/apps/x/apps/renderer/src/extensions/task-block.tsx b/apps/x/apps/renderer/src/extensions/task-block.tsx index e39d8d62..935d7a81 100644 --- a/apps/x/apps/renderer/src/extensions/task-block.tsx +++ b/apps/x/apps/renderer/src/extensions/task-block.tsx @@ -3,22 +3,37 @@ import { ReactNodeViewRenderer, NodeViewWrapper } from '@tiptap/react' import { CalendarClock, Loader2, X } from 'lucide-react' import { inlineTask } from '@x/shared' +function formatDateTime(iso: string): string { + const d = new Date(iso) + return d.toLocaleString('en-US', { + month: 'short', + day: 'numeric', + hour: 'numeric', + minute: '2-digit', + hour12: true, + }) +} + function TaskBlockView({ node, deleteNode }: { node: { attrs: Record }; deleteNode: () => void }) { const raw = node.attrs.data as string let instruction = '' let scheduleLabel = '' let processing = false + let lastRunAt = '' try { const parsed = inlineTask.InlineTaskBlockSchema.parse(JSON.parse(raw)) instruction = parsed.instruction scheduleLabel = parsed['schedule-label'] ?? '' processing = parsed.processing ?? false + lastRunAt = parsed.lastRunAt ?? '' } catch { // Fallback: show raw data instruction = raw } + const lastRunLabel = lastRunAt ? formatDateTime(lastRunAt) : '' + return (
@@ -41,6 +56,7 @@ function TaskBlockView({ node, deleteNode }: { node: { attrs: Record {scheduleLabel} + {lastRunLabel && ยท last ran {lastRunLabel}} )}
diff --git a/apps/x/apps/renderer/src/styles/editor.css b/apps/x/apps/renderer/src/styles/editor.css index 794d8a08..12767630 100644 --- a/apps/x/apps/renderer/src/styles/editor.css +++ b/apps/x/apps/renderer/src/styles/editor.css @@ -608,6 +608,10 @@ color: color-mix(in srgb, var(--foreground) 55%, transparent); } +.tiptap-editor .ProseMirror .task-block-last-run { + color: color-mix(in srgb, var(--foreground) 38%, transparent); +} + /* Shared block styles (image, embed, chart, table) */ .tiptap-editor .ProseMirror .image-block-wrapper, .tiptap-editor .ProseMirror .embed-block-wrapper,