Surface the desktop server switcher and allow a different server per window - #2740
Draft
bhushit wants to merge 13 commits into
Draft
Surface the desktop server switcher and allow a different server per window#2740bhushit wants to merge 13 commits into
bhushit wants to merge 13 commits into
Conversation
…om Connect URLs The server target was reachable only from the native "Window > Server" menu, and BbDesktopApi exposed nothing about it, so the renderer could neither read nor change which bb server the app targets. Selecting a custom URL also skipped authenticateConnectTarget, so a pasted getbb.app origin loaded without a session cookie and hit a sign-in wall, while the same server picked from the Connect list authenticated. Expose the target over four experimental_ BbDesktopApi members backed by a new server-target IPC module, add a Settings > Connection section that lists the selectable servers and edits the custom URL, and route custom targets on a getbb.app host through the same Connect authentication the Connect-list entries use. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…bar indicator Add a `remoteUi` experiment (default off) that gates both Settings > Connection and a new sidebar footer pill showing which server the UI renders from. The pill reuses the Connection section's server list and switch actions through a shared useServerTarget hook, and derives its status dot from the existing websocket connection state rather than inventing one. The native Server menu appended a "no Connect servers" line whenever the Connect sync was skipped, even when This Mac plus a custom server were already listed, which read as a contradiction. Show that line only when nothing beyond the builtin server is selectable, and surface the same guidance as quiet muted text in the Connection section instead. Rewrite the skip labels and section copy in plain language. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace the single custom server URL with a list the user manages, and make bb Connect a removable default. This Mac is now the trust root: switching between already-trusted servers stays available to remote pages, but only a local frame may add a server, remove one, or untrust bb Connect, so a hostile remote page can never grow the set of servers the app will load. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Collapse the sidebar server indicator into an icon-only footer action with a status dot, and rebuild the Connection settings on the plugin marketplace card layout so bb Connect is a removable default entry. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Selecting a remote server now opens (or focuses) a dedicated window while the This Mac window stays put, so closing the remote window is always the way back and the app can never be stranded. Remote windows get their own loading and error views, best-effort Connect auth with per-URL renewal refcounting, and Cmd-N duplicates the focused window's server. Startup always boots the builtin server; per-window persistence across restart is deferred. An in-flight guard keeps rapid repeat selections from spawning duplicate windows. With switching no longer needed from a remote page, all server-target IPC (switch, add, remove, trust) is now accepted only from the builtin origin, matching the native menu; isTrustedSwitchOrigin is gone and the renderer disables switching in remote windows. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The sidebar indicator gated on the remoteUi flag of whichever server the window happened to be viewing, so a remote server with the experiment on would render this app's switcher inside its window — wired to the local preload, listing the local catalog, and inert under the builtin-only mutation guard. Gate the indicator and the Connection settings tab on canManageServers instead, which main derives from the window's sender origin, so remote windows show no switcher at all: you view that server and close the window to return. Co-Authored-By: Claude Opus 4.7 <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.
What was wrong
bb desktop already lets you point the app at a remote bb server (
Window ▸ Server,Window ▸ Set Server URL…), but it has three gaps:customtarget holds a single URL; setting a new one replaces it.Refs #1451 (multiple desktop servers / remote handoff) and #483 (the original remote-session request the switcher shipped from).
What changed
All behind a new
remoteUiexperiment (default off):server-target.ts, v2 schema + migration); auto-discovered getbb Connect machines list alongside.openRemoteServerWindow), leaving This Mac in place; closing the window returns you. Per-window Connect session; auth failure falls through to load the server so its gate can prompt sign-in instead of a fatal error — you can never be stranded.isBuiltinServerOrigin), and the switcher only renders on the This Mac window. A remote or compromised page can neither drive nor display it.New
BbDesktopApimembers areexperimental_-prefixed withdocs/api_to_audit.mdentries. NoHOST_DAEMON_PROTOCOL_VERSIONchange (no server↔daemon wire touched).How you verified
pnpm exec turbo run typecheck test lintgreen across@bb/app,@bb/desktop,@bb/desktop-contract,@bb/domain(0 errors).Refs #1451