Repository navigation
feat(folders): create a new folder while picking one to open - #8
Closed
Jonathan-Asher wants to merge 1 commit into
Closed
Jonathan-Asher wants to merge 1 commit into
Jonathan-Asher wants to merge 1 commit into
Conversation
Starting a project in an empty folder meant leaving codeg to make the folder first: the Open folder dialog could only pick a directory that already existed, and in web mode there was no other way to make one on the server at all. The dialog's directory browser now has a New folder button beside Home and Up. It opens a name box at the top of the listing; Enter creates the folder in the directory being listed, and the browser moves into it, so Next opens it as the workspace. Escape or the X cancels without closing the dialog. A rejected name is explained under the box, which keeps what was typed. DirectoryBrowser takes this as an opt-in allowCreateFolder prop, so the other pickers that embed it are unchanged. The folder is made by create_directory_core, shared by the Tauri command and POST /api/create_directory. It trims the name and rejects empty names, "." and "..", path separators and control characters (plus the names and characters Windows reserves, on Windows), needs an absolute, existing parent, creates exactly one directory, and reports an existing entry of that name, symlinks included, instead of reusing or following it. Errors are a thiserror enum mapped onto the existing error codes (400/404/409/403/500) with i18n keys, translated in all ten locales. The native folder picker now asks for canCreateDirectories, the macOS panel's own New Folder button. tauri-plugin-dialog already defaults it to on; this keeps it on.
Owner
Author
|
Upstream test.yml passed on all 7 jobs (run 37311141140). Opened upstream as spacering-net#881. |
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.
CI run of upstream's test.yml for the upstream PR branch pr/new-folder. Not for merging.