feat(artifacts): open binary files & the folder with the OS app#108
Merged
Conversation
Two artifacts-drawer improvements: 1. Binary/rich files (pdf, office docs, images, archives, media, db, fonts, binaries) now open in the OS default application instead of the in-app text preview, which failed with a UTF-8 error. viewer_for_path classifies these as "external"; clicking such a tree row launches the OS app (open_workspace_path target "system", from the #80 machinery). The preview error state also gains an "Open with the system app" button for unrecognized binary extensions that still fall through. 2. New "open the workspace folder in your file browser" icon in the artifacts drawer header (Files/Explorer/Finder), alongside the existing open-in-editor / open-in-terminal actions.
juacker
marked this pull request as ready for review
July 12, 2026 14:51
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.
What
Two artifacts-drawer improvements (PR A of the three you raised):
1. Open binary/rich files with the OS app (fixes the PDF error)
Clicking a
.pdf(or any non-text file) in the artifacts tree used to open the in-app text preview, which then failed with "does not contain UTF-8 text". Now such files launch the OS default application instead.viewer_for_pathgains an"external"class for documents (pdf, doc/docx, xls/xlsx, ppt/pptx, odt/ods/odp, rtf, epub), images (png/jpg/gif/webp/…), audio/video, archives (zip/tar/7z/…), and binaries (exe/dll/so/wasm/jar/sqlite/db/parquet/fonts).externaltree row callsopen_workspace_path(ws, path, "system")— the injection-safe OS-open machinery from fix(system-apps): make "open in editor/terminal" cross-platform #80 (xdg-open/explorer.exe/open).2. Open the workspace folder in the file browser
New icon in the artifacts drawer header (next to open-in-editor / open-in-terminal) that opens the workspace root in the OS file manager —
open_workspace_path(ws, null, "system"), which on a directory opens Files/Explorer/Finder.Verification
cargo fmt+ new unit testviewer_for_path_classifies_binary_as_external(pdf/png/zip/sqlite → external; md/rs/json unchanged).tsc/eslint/ vitest (132) /vite buildclean.viewerwas already a string field).Test locally
Next up (separately, as agreed): PR B — drag-and-drop copy of artifacts between workspaces.