From bba678568a56d6e0ceeb52e814b2871b6d59dca0 Mon Sep 17 00:00:00 2001 From: teernisse Date: Fri, 30 Jan 2026 09:26:35 -0500 Subject: [PATCH] Polish: simplify formatTimestamp and tone down export button Replace try/catch with isNaN guard in the HTML exporter's formatTimestamp, matching the same cleanup applied client-side. Downgrade the export button from btn-primary to btn-secondary so it doesn't compete visually with the main content area. The primary blue gradient was overly prominent for a utility action. Co-Authored-By: Claude Opus 4.5 --- src/client/components/ExportButton.tsx | 2 +- src/server/services/html-exporter.ts | 17 +++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/client/components/ExportButton.tsx b/src/client/components/ExportButton.tsx index 6a3f5de..b3a535e 100644 --- a/src/client/components/ExportButton.tsx +++ b/src/client/components/ExportButton.tsx @@ -65,7 +65,7 @@ export function ExportButton({ btn btn-sm flex-shrink-0 gap-1.5 transition-all duration-200 ${state === "success" ? "text-white shadow-glow-success" : ""} ${state === "error" ? "text-white" : ""} - ${state === "idle" || state === "exporting" ? "btn-primary" : ""} + ${state === "idle" || state === "exporting" ? "btn-secondary" : ""} `} style={ state === "success" diff --git a/src/server/services/html-exporter.ts b/src/server/services/html-exporter.ts index 89bc85b..77c1177 100644 --- a/src/server/services/html-exporter.ts +++ b/src/server/services/html-exporter.ts @@ -170,16 +170,13 @@ function renderMarkdown(text: string): string { } function formatTimestamp(ts: string): string { - try { - const d = new Date(ts); - return d.toLocaleTimeString(undefined, { - hour: "2-digit", - minute: "2-digit", - second: "2-digit", - }); - } catch { - return ""; - } + const d = new Date(ts); + if (isNaN(d.getTime())) return ""; + return d.toLocaleTimeString(undefined, { + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + }); } function getHighlightCss(): string {