feat: quick file preview for images, PDF, docx, and more - #120
Merged
mattenarle10 merged 1 commit intoJul 27, 2026
Merged
Conversation
Clicking a non-markdown file in the sidebar now opens an in-app preview instead of the "open in default app" toast. Zero new dependencies. - images/video/audio: native renderers via blob url - pdf: webview-native iframe via data url - text/code: read-only <pre> with "open as text" to edit - office/unknown formats: info card + "open in default app" Triggers: click, context menu "quick preview", and Space (Finder Quick Look) on a focused sidebar row. .md/.csv keep opening in the editor. macOS toolbar left-padding clears the native traffic-light buttons. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
|
hey sorry just got back on the repo, will review and merge in a bit! |
sashamerzliakov
added a commit
to sashamerzliakov/markamd
that referenced
this pull request
Jul 29, 2026
The install section, the release badge and the homebrew line were all inherited from upstream, so a visitor read the fork's feature list and then downloaded Matt's app without any of it. The updater badge claimed "notarized — Apple Developer", which is not true of this build. - install now points at this repo's releases, states plainly that the fork ships macOS/apple-silicon only, and sends anyone wanting Windows, Linux or intel mac to upstream with a note about what they'll be getting - documents the unsigned first-launch step, since this build has no Developer ID and macOS will block it - says the in-app updater is disabled and why: it needs upstream's signing key, and pointing it at upstream's manifest would replace the fork with the original app - says homebrew installs upstream, not this - release badge reads from this repo; upstream's kept alongside it for context - "notarized" badge replaced with "fork build: unsigned" Version becomes 1.6.2-fork.1: upstream 1.6.2 as the base, fork revision 1. Not 1.7.x — upstream's quick-preview overlay (mattenarle10#120) is deliberately not in this fork, so claiming that lineage would be wrong. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
marka.md only opens
.md/.markdown/.mdx/.csv. Clicking any other file (image, PDF, docx, video,config.json, …) hits the binary-signature guard and shows a bare "open in default app" toast — there's no way to glance at a file inside the app. This adds an in-app quick preview overlay, with zero new dependencies.What it does
A new fullscreen overlay (
FilePreviewOverlay) mirrors the existingDiagramViewerOverlaychrome and renders each file type natively:<img>with zoom / fit / drag-pan / ctrl-wheel<video controls><audio controls><iframe>via webview-native rendering<pre>+ "open as text" to editBinary files are read once via
@tauri-apps/plugin-fsreadFile→ blob/data URL (PDF uses a data URL for webview-iframe compatibility; blob URLs are revoked on close). No new Tauri permissions are required —fs:allow-read-fileandopener:allow-open-pathare already granted.Triggers
.md/.csvkeep opening in the editor as before. The toolbar shows aquick previewbadge +esc to closehint so it's clearly read-only; on macOS the toolbar left-padding clears the native traffic-light buttons.Behavior change
Clicking a non-markdown file now opens the preview overlay instead of the load-error toast. Text/code files preview read-only with an "open as text" button, so editability is preserved (one click into the editor).
Key files
src/lib/preview.ts— extension → kind/mime classification (pure, tested)src/components/overlays/file-preview-overlay.tsx— the overlay + per-kind rendererssrc/styles/overlays/file-preview.css— overlay stylessrc/app.tsx— routing (handleSelectFile), context-menu item, Space shortcut, overlay wiringsrc/components/files/folder-node.tsx—data-mdv-tree-pathon file rows (Space target)menu.quickPreview+preview.*keysVerification
Rebased onto
main; on the new base (TypeScript 7, v1.6.2):bun test— 54 pass (includes newtests/preview.test.tsfor kind/mime classification)bunx tsc --noEmit✅bun run build(tsc + vite) ✅cargo check --release✅ (no Rust changes)Manual QA still recommended across formats.
Out of scope / future
convertFileSrc) for streaming large media — current path reads the whole file, fine for typical preview sizes🤖 Generated with Claude Code