Repository navigation
Add projects through an Add a project dialog with the native folder picker - #223
Merged
Merged
Conversation
…icker The sidebar's new-workspace panel is replaced by a centered Add a project dialog: a Host selector, and on this Mac a Browse folder row that opens macOS's folder picker through a sender-checked invoke channel. A device keeps a ~/ path field. Refusals stay inside the dialog naming the folder. A browser tab offers no Add project. hided no longer lists home folders for registration, since nothing asks for them now.
The dialog now answers success by a registration id its device did not have when the folder was sent, so a project removed meanwhile cannot hold it open. Choosing a device hands the keyboard to its path field instead of back to the selector. The desktop spec drives the device path to its refusal, and the design guide names the new dialog.
A desktop typecheck left desktop/tsconfig.tsbuildinfo in the previous commit; it is removed and every tsbuildinfo is ignored.
# Conflicts: # docs/UI_BEHAVIOR.md
yansfil
added a commit
that referenced
this pull request
Sep 28, 2026
Related: follows #223 (Add a project dialog). Clone from URL lands separately in the same "Other ways to add" group. ## Summary Add a project could only register a folder that already exists. Now, on this Mac, an "Other ways to add" group sits under Browse folder, and `Create new project` names a folder, shows where it goes, and makes it with its own Git repository before registering it, in one step. hided answers a new `project_target` probe on the same `$HOME` line the create is checked on, so a taken name, a folder outside home, or an invalid name shows inline before anything is sent. The core's existing creation worker makes the folder and runs `git init` off the runtime lock; a failed create keeps its folder, and a retry continues into it.  The location row names the parent as `~` spells it; the full path under it follows the name as it is typed (the long path here is the e2e fixture's temporary home). ## Review - **Judge**: a target that is an empty folder, or holds only `.git` and `.DS_Store`, counts as a leftover of a failed create and is continued into instead of refused as existing. This is how behavior 5 (retry converges, nothing deleted) and "existing target refused" were reconciled; the view says "An empty folder by this name is already there; the project is made in it." - **Judge**: copy - title "Create a new project", description "Name it, and Hide makes the folder with its own Git repository and adds it.", row detail "A new folder with its own Git repository". - **Files to watch**: - `hided/src/boundary.rs`, `hided/src/server.rs` - the `$HOME` boundary: `resolve_new_project` allows home itself as the parent (the new folder is still strictly under it) and never follows a symlink at the target. - `herdr-core/src/live.rs` - failure path: the folder is made at the literal checked path before `registration()` canonicalizes it (a review finding fixed in the second commit). - `contracts/hided-ws.schema.json` - WS contract: new `project_target` frame, `projectTarget`/`projectTargetResult` defs, `already_exists` reason, `new_folder` on `create_workspace`. - `web/src/registration.tsx` - the send/answer logic Browse folder used is extracted here and shared by both views; D3 will want it too. ## Evidence - **Confirmed**: - Desktop e2e `desktop/e2e/add-project.spec.ts` against an isolated Herdr and a dev Electron app, 2/2 passing: the new test opens the view (name focused, default `~`), picks `~/projects` through the stubbed picker, sees `already_exists` for a folder with a file, the name problem for `a/b`, creates `fresh` with Enter, then asserts the dialog closes, the project row appears, `fresh/.git` is a directory, the taken folder is untouched, a reopen defaults beside `fresh` and refuses the same name as `already_registered`, and Back returns focus to the row. - The existing Browse folder, cancel, `outside_home`, `already_registered` and device-field flows still pass in the same spec. - Core unit test: folder made as its own repository inside another repository's tree; a retry, an empty folder and a `.DS_Store`-only folder are continued into; a folder with contents, a file, and a symlink at the name are refused and left untouched. - hided test: probe answers parent label, full path, leftover and each refusal (`already_exists`, `invalid_path`, `not_found`, `outside_home`) and makes nothing; `new_folder` creates are forwarded as the canonical path or refused with the path as sent. - Core runtime test: a `new_folder` create naming an SSH device is refused. - `verify-cargo.sh lint`, `verify-web.sh` (web 443 tests, desktop 44, typecheck, lint, build), `check-design-contract.mjs`: pass. - Two native review passes; findings fixed: a symlink race at the leaf (core canonicalized before creating) and `.DS_Store` breaking retry convergence. - **Not confirmed**: - Under load (six parallel builds, load average about 10) one full `herdr-core` run failed 3 unrelated deadline tests (`github::tests` gh timeouts, `live::tests::a_hung_hcoord_link...`); they pass on rerun and passed in the earlier full run. - A real `git init` failure (git missing) was not exercised live; its message path is covered only by reading. - Not observed against the installed app; QA used the dev app from this branch only. <details><summary>More evidence</summary>  The first view: Browse folder keeps the keyboard; Create new project sits under "Other ways to add", on this Mac only. </details> **AI tooling**: mostly AI tools; the diff, the boundary checks, and the e2e screenshots were read by hand.
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
Adding a local project meant typing a path into a small panel at the bottom of the sidebar, completed from a home listing hided served.
That panel is gone. Every Add project entry point now opens a centered
Add a projectdialog: a Host selector, and on this Mac aBrowse folderrow (Enter) that opens macOS's own folder picker through a new sender-checkedhide:pick-folderinvoke channel.The picked folder goes out as the existing
create_workspace. A refusal stays in the dialog naming the folder, and the dialog closes when the project appears.A device keeps a
~/path field. A plain browser tab no longer offers Add project, and hided no longer lists home folders for registration.Review
Add projectin the menu and the shortcut sheet, and has no browser chord (the ⌥⇧N move is gone).desktop/src/main/host.ts- security boundary: a new IPC handler; it reusesfromShell, answers null to any other sender, and logs no path.hided/src/server.rs,hided/src/boundary.rs- failure path: the localremote_file_listhome listing is removed, so a local one now reaches the core and is answered as an unconfigured target; the$HOMEline forcreate_workspaceis unchanged.contracts/hided-ws.schema.json- snapshot wire:remote_file_listleaves thedirectory_listandpath_refusedkind enums.web/src/AddProjectDialog.tsx- the answer is read, not assumed: a registration id new to the device closes it;path_refused, the core'sworkspace.create*error, or the shell's ownalready_registeredkeeps it open.design/hide-screens.penstill draws the old panel onScreen / Dialogs and Sheets(the guide says so). Redraw it in this PR, or as a follow-up?Evidence
add-project.spec.ts, with the picker stubbed in the main process: a cancel leaves the dialog unchanged; an outside-home folder showsoutside_homenaming it and stays open; a home folder registers and closes the dialog.already_registered; ⌘⇧N, the Overview button and × work; a device Host gets a focused~/field and shows the device path's refusal.s2(outside home,.., a file refused by hided; a home folder registers; the browser offers no Add project),s4,s8,sidebar-shell, plus thes2sheet test's moved-chord count (8 to 7).cargo test -p hidedincluding the rewrittenregistration_refusals_are_answered_by_hidedanda_remote_listing_is_forwarded_untouched(local too). Also: clippy and fmt for hided; web and desktop typecheck, lint, unit (web 438, desktop 43) and build; design contract; repository hygiene scripts.menu.tstokeyboard.tsnew_workspace), not clicked in e2e. The desktop spec checks the IPC sender only through the shell page; there is no test that a browser display page is refused. Fullcargo test --workspaceand the full web e2e suite were left to CI.More evidence
AI tooling: mostly AI tools; the stubbed-picker flows, the real picker and each capture were reviewed in captures of the running isolated app.