Repository navigation
Desktop: open folders with the system dialog, so ~/Desktop opens (v0.21.0) - #53
Merged
Merged
Conversation
…opens (v0.21.0) In Electron the page's showDirectoryPicker never returns for a folder Chromium calls sensitive (~/Desktop, ~): Electron emits file-system-access-restricted and waits for an answer nobody gave, so every later click failed with "File picker already active". Open Folder, Open Files and Save As now use Electron's native dialogs; main.cjs reads the files with fs and writes back only paths it opened, the same path as `readm3 edit .`. A listener answers the restricted event too, so a page picker can never hang again. Older desktop builds and browsers keep the page pickers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <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.
Open Folder on ~/Desktop did nothing in the desktop app, and the next click said the picker was already open.
Cause: the page uses
showDirectoryPicker. In Electron, picking a folder Chromium treats as sensitive (~/Desktop, ~) emitsfile-system-access-restrictedon the session and waits for the app to answer. readm3 never listened, so the promise never settled and every later picker failed with "File picker already active".Fix:
desktop/main.cjs: newpickandsave-asIPC handlers usingdialog.showOpenDialog/showSaveDialog. Files are read withfsthrough the existingload()and written back only to paths inopened, the same pathreadm3 edit .takes. Afile-system-access-restrictedlistener answers allow for readm3's own pages, so a page picker can never hang again.desktop/preload.cjs: exposespickandsaveAs.site/disk.ts:pickFolder,pickFilesandsaveAsuse the bridge when it has them. Browsers and older desktop builds keep the page pickers.Tests: typecheck clean, 198/198 unit tests, 19/19 viewer specs.
🤖 Generated with Claude Code