Skip to content

feat: New from Clipboard (Cmd+N) and Reveal in Finder - #8

Merged
TheFoot merged 1 commit into
mainfrom
feat/clipboard-and-reveal
Jul 6, 2026
Merged

feat: New from Clipboard (Cmd+N) and Reveal in Finder#8
TheFoot merged 1 commit into
mainfrom
feat/clipboard-and-reveal

Conversation

@TheFoot

@TheFoot TheFoot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Two companion features for getting content into and out of MarkDoc:

New from Clipboard (⌘N / Ctrl+N)

  • Reads the clipboard (Rust-side via tauri-plugin-clipboard-manager — no webview clipboard permission issues), suggests a filename derived from the content (first ATX heading, else first line, sanitised, dated fallback), shows the native save dialog, writes the file, and opens it through the standard open_file_in_window routing.
  • Entry points: File → New from Clipboard… (first item, ⌘N) and a New from Clipboard button on the Welcome screen.
  • Empty or non-text clipboard shows a native info dialog.
  • New Rust commands: read_clipboard_text(), write_text_file(path, contents) (mirrors the read_file_as_text pattern — paths are user-authorised via the save dialog).

Reveal in Finder / Show in File Explorer

  • Selects the open document in the OS file manager via the opener plugin's reveal_item_in_dir.
  • Entry points: File menu (platform-specific label) and a folder icon in the viewer toolbar.
  • Hidden / no-op for the bundled User Guide (virtual document with no path on disk).

Docs

  • src/USERGUIDE.md was still documenting the pre-refactor editor app (tabs, editing, saving, ⌘E) — rewritten for the view-only viewer, including the new features.
  • README + CLAUDE.md updated (features, shortcuts, menu table, commands, mock docs, smoke checklist).

Test plan

  • 107 Vitest unit tests (14 new: filename derivation edge cases, clipboard flow happy path / cancel / empty)
  • 22 Playwright e2e (6 new across new-from-clipboard.spec.ts and reveal.spec.ts; web-mode mock gains a seedable clipboard and records write_text_file / reveal_in_dir / message dialogs)
  • cargo check / clippy -D warnings / cargo test
  • typecheck / eslint / prettier
  • Manual smoke on macOS: ⌘N with markdown on the clipboard (filename suggestion, save, open), empty-clipboard dialog, Reveal in Finder from menu + toolbar, user guide shows no reveal affordance

🤖 Generated with Claude Code

New from Clipboard saves the clipboard's text to a user-chosen path
(filename suggested from the first heading or line of the content) and
opens it through the standard open_file_in_window routing. Entry points:
File menu (Cmd+N) and a Welcome-screen button. Empty/non-text clipboard
shows an info dialog. Clipboard is read Rust-side via
tauri-plugin-clipboard-manager, and the file write goes through a new
write_text_file command mirroring read_file_as_text.

Reveal in Finder / Show in File Explorer selects the open document in
the OS file manager via the opener plugin's reveal_item_in_dir. Entry
points: File menu (platform-specific label) and a viewer toolbar button.
Hidden and no-op for the bundled user guide (no path on disk).

Also rewrites src/USERGUIDE.md, which still documented the pre-refactor
editor app (tabs, editing, saving), for the view-only viewer.

Tests: 14 new Vitest cases (filename derivation + clipboard flow),
6 new Playwright specs; the web-mode mock gains a seedable clipboard,
write_text_file/reveal_in_dir handling, and message-dialog recording.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@TheFoot
TheFoot merged commit 3385e74 into main Jul 6, 2026
2 checks passed
@TheFoot
TheFoot deleted the feat/clipboard-and-reveal branch July 6, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant