Repository navigation
Conversation
The viewer panels (the file panel beside a session, plans and memory) get a folder button just before Close that shows the open file selected in Finder, Explorer or the file manager. A new reveal-file IPC takes an absolute path, since these panels open files outside any project, and only calls shell.showItemInFolder on a file that exists.
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
Adds a Reveal in Finder button to the viewer toolbar, just before Close. It shows the open file selected in its folder, in Finder on macOS, Explorer on Windows and the file manager on Linux.
Why
When a session points at a file, it opens in the panel beside the terminal. From there, the only way to reach that file in Finder (to attach it somewhere, move it, open it in another app) is to copy the path and navigate to it by hand. That is slowest exactly for the files that live outside the project, such as plans in
~/.claude/plansor memory files, which the Files tab cannot reach. The project file browser already has Reveal in Finder in its context menu; this brings the same action to the open file.What it does
aria-labelname the platform's file manager (Reveal in Finder/Explorer/File Manager), the same wording as the file browser's context menu.ViewerPanel: the file panel beside a session, and the plan and memory viewers. It works for text, markdown, JSON, HTML and the image/PDF/PowerPoint previews alike.Implementation notes
file-management.js: newrevealFile(filePath, { shell }), next tomanageProjectEntry. It takes an absolute path, because these viewers open files outside any attached project, so the project-relativemanage-project-entrychannel cannot serve them. It rejects non-strings, relative paths and missing files, and only callsshell.showItemInFolder.main.js: newreveal-fileIPC handler returning{ ok, filePath }or{ ok: false, error }.preload.js:window.api.revealFile(filePath).public/viewer-toolbar.js:revealoption,revealBtnin the toolbar API, and aFOLDER_ICONwith the same path asPICONS.folder.public/viewer-panel.js: turns the button on, shows/hides it inopen(), and revealsthis.filePathon click.fp-toolbar-btn fp-icon-btnclasses.Testing
test/file-management.test.js:revealFilereveals an existing file outside any project, normalizes..segments, and rejects relative paths, missing files and non-string input without touching the shell.test/viewer-panel.test.js: the button reveals the currently open file, including a media preview, does nothing once the panel is destroyed, and is hidden with no file.test/viewer-toolbar.test.js: loads the realviewer-toolbar.jsin avmcontext and checks the button sits right before Close, its per-platform label, and that it is absent unless requested.npm test: 444 of 446 pass. The two failures (incremental columns upgrade a version-4/12 database…indb-schema-reconcile.test.js) fail the same way on currentmainon my machine and are unrelated.electron .with an isolatedSWITCHBOARD_DATA_DIR): opened a markdown file outside the project in the file panel. The toolbar showed Preview, Wrap, Go to line, Save, Reveal in Finder, Close. Clicking it went throughreveal-filetoshell.showItemInFolderfor that file, and the IPC returnedokfor a real file and an error for a missing file and for a relative path.