From eb6e291191d10728d59afeb238a5e2eeec76b3dc Mon Sep 17 00:00:00 2001 From: Jake Date: Fri, 24 Apr 2026 23:49:58 +0100 Subject: [PATCH] feat(phase9): HistoryPage .md export via save dialog Replaces the clipboard-only path with saveTranscriptAsMarkdown. User picks the location via the OS save dialog; cancellation leaves no side effect, no toast, no fallback. Toast on success names the file. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/lib/pages/HistoryPage.svelte | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/lib/pages/HistoryPage.svelte b/src/lib/pages/HistoryPage.svelte index baa1fcb..d1b88c5 100644 --- a/src/lib/pages/HistoryPage.svelte +++ b/src/lib/pages/HistoryPage.svelte @@ -8,6 +8,10 @@ import { deriveAutoTags, buildFrontmatter, buildMarkdown, normaliseTag, } from "$lib/utils/frontmatter.js"; + import { + saveTranscriptAsMarkdown, + exportTranscriptsToDir, + } from "$lib/utils/saveMarkdown"; import { getPreferences } from "$lib/stores/preferences.svelte.js"; import { clampTextLines, measurePreWrap } from "$lib/utils/textMeasure.js"; import { bodyPretextLineHeight, pretextFontShorthand } from "$lib/utils/accessibilityTypography.js"; @@ -341,15 +345,7 @@ } async function exportMarkdown(item) { - const md = buildMarkdown(item); - try { - await navigator.clipboard.writeText(md); - } catch { - try { - await invoke("copy_to_clipboard", { text: md }); - } catch {} - } - toasts.info("Markdown copied to clipboard — paste into Obsidian or save as .md"); + await saveTranscriptAsMarkdown(item); } async function openEditor(item) {