feat(files): add "This computer" local file browser - #1
Closed
roxi3906 wants to merge 1 commit into
Closed
Conversation
Add a local-filesystem sibling to the remote SSH browser, opening local files as preview-workbench tabs through the shared preview pipeline. - shared/local-fs: pure types + validation, sensitive-path detection, dir sorting, bookmark key - main/local-fs: LocalFsService (list/preview/roots/reveal/openPath) over node:fs, entry-capped, realpath-canonicalized; reused by the managed preview resolver so local images/PDFs stream through validated paths - bridge: window.api.localFs (5 methods); 'local' added to PreviewFileSource / ManagedPreviewSource; regenerated web api map - UI: LocalFileBrowser (back/up/refresh, editable address bar, Go-to bookmarks, sensitive-file/dir confirm), LocalFileHeaderActions (reveal / copy path / open-with), wired into the Files-panel Artifacts dropdown Sensitive-path warning covers credential dirs (.ssh/.aws/.gnupg) on entry plus suffix-less secret files (SSH keys, cloud credentials). Co-Authored-By: Claude Opus 4.8 <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
Adds a local-filesystem file browser ("This computer") as a sibling to the existing remote SSH browser. Local files open as standard preview-workbench tabs and render through the shared preview pipeline. Entry point is a new LOCAL section in the Files-panel Artifacts dropdown.
What's included
src/shared/local-fs.ts+ tests): pure types,validateLocalPath,resolveLocalPath,sortLocalEntries,isSensitiveLocalPath, and the reservedLOCAL_BOOKMARKS_KEY.src/main/local-fs/):LocalFsService(list / preview / roots / reveal / openPath) backed bynode:fs, entry-capped and realpath-canonicalized. The same instance also feeds the managed-preview resolver, so local images/PDFs stream through the same validated path.window.api.localFs(5 methods);'local'added toPreviewFileSource/ManagedPreviewSource; regenerated web api map.LocalFileBrowser(back/up/refresh, editable address bar, Go-to with fixed Home + pin/unpin bookmarks, sensitive-file/dir confirm) andLocalFileHeaderActions(Reveal in Finder + Copy path / Open-with), replacing "Download" in the header and fallback surfaces for local files.Security model
Deliberately "Home start, full-disk navigable" — paths are not confined to a storage root; validation rejects only malformed input (non-absolute / control chars) and
realpathcanonicalizes symlinks/...The arbitrary-path read via
source: 'local'is reachable only by the trusted main renderer: theopen-science-preview://protocol resolves opaque, owner-scoped resource IDs (never renderer-supplied paths), the HTML preview sandbox runs underdefault-src 'none'; connect-src 'none'with no preload, and local Office files skip the OOPIF pipeline.acquire/readRange/releaseare isolated perownerId(webContents).Sensitive-path warning covers credential directories (
.ssh/.aws/.gnupg) on entry, dotenv files, and suffix-less secret files (SSH private keys, cloudcredentials,.pgpass,.p12/.pfx).Testing
tsc --noEmiton both node and web projects — clean.local-fs+ mainlocal-fs/servicesuites pass (20 tests, incl. new suffix-less-secret cases); previously verified managed-preview / office-preview suites unaffected.LocalFileBrowser,LocalFileHeaderActions) have no unit tests — verified via typecheck/lint only.Deferred / not included
docs/local-artifacts-mockup.html.🤖 Generated with Claude Code