Repository navigation
feat: allow project creation from non-loopback origins - #81
Merged
Merged
Conversation
Project creation (and add/update source) was gated on the loopback host-daemon probe, which only answers on the machine running bb. The daemon is only genuinely required for the native macOS folder picker; the hostId is available from any device via the server's /api/v1/hosts. Fall back to the connected primary host when the daemon is unreachable, so remote devices get the manual path dialog instead of no entry point at all. The dialog now names the host the path resolves on, since remote users are typing a path on a different machine's filesystem. - useLocalPathPicker: resolve hostId as daemon host ?? connected primary host; expose hostName. Extracted usePathPickerHost for the non-picker gating in ProjectActionsMenu. - ProjectPathDialog: name the host in the description copy. - ProjectSettingsView: gate add/edit source on the resolved host; path-existence warnings stay daemon-gated (skipped remotely). Co-Authored-By: Claude Opus 4.8 <[email protected]>
f183840 changed projectWithThreadsResponseSchema (part of the sdk app-runtime bundle graph) without regenerating the committed bundle, breaking the @bb/sdk codegen sync check on CI. Co-Authored-By: Claude Opus 4.8 <[email protected]>
# Conflicts: # packages/sdk/src/app-runtime-browser-bundle.generated.ts
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.
Problem
There is no way to add a new project (or add/update a project source) when the app is opened from anything other than
localhost— e.g. via a Tailscale name or from another device. The "Add project" entry point disappears entirely.Root cause
All path-entry flows gated on the loopback host-daemon probe, which by design only runs on loopback origins (the daemon binds
127.0.0.1and only sends CORS headers for loopback origins — see 5380f81). That probe supplied both thehostIdand the native folder picker. But the daemon is only genuinely required for the native macOS folder picker:hostIdis available from any device via the server'sGET /api/v1/hosts(usePrimaryHost)POST /api/v1/projectsonly enforcesassertPrimaryHostId— it never needed the browser on localhostFix (client-only)
Resolve the picker's host as daemon host → fallback to the connected primary host. When the daemon is unreachable,
pickFolderis alreadynull, so the flow naturally falls through to the manual path dialog. Requiresstatus === "connected"so we never create sources against a stale host.Since remote users are typing a path on a different machine's filesystem, the dialog now names the host: "Enter an absolute path on to the project folder."
useLocalPathPicker: host fallback +hostName; extractedusePathPickerHostfor the non-picker gating inProjectActionsMenuProjectPathDialog: host name in description copyProjectSettingsView/ProjectActionsMenu: gate add/edit source on the resolved host; path-existence warnings stay daemon-gated (skipped remotely)Loopback behavior is unchanged: native picker on macOS, manual dialog elsewhere.
Testing
turbo run typecheck --filter=@bb/app✓,turbo run test --filter=@bb/app✓ (145 files, 1043 tests)Plan: plans/remote-project-creation.md (also on glyphdown)
🤖 Generated with Claude Code