Skip to content

feat(web): rename saved environments without disconnecting - #57

Merged
NicholasZolton merged 1 commit into
mainfrom
NicholasZolton/rename-desktop-environment
Nov 5, 2026
Merged

NicholasZolton merged 1 commit into
mainfrom
NicholasZolton/rename-desktop-environment

Conversation

@NicholasZolton

@NicholasZolton NicholasZolton commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Saved environments on desktop and web could only use the host's system name. There was no way to give a remote machine a recognizable name without renaming the host.

Add Rename… to the environment's ⋯ menu. The name is saved on this device and survives app restarts, reconnection, route changes, and discovery refreshes. Renaming keeps the active connection and running agents intact. It does not change the hostname, credentials, or other devices' names.

Test plan

  • Focused connection registry, route, catalog persistence, and connection-state tests.
  • vp run check:changed: formatting, lint, both Knip passes, typechecks for all seven affected packages, 74 tests, and changed-component React Compiler checks.
  • Real browser flow against two isolated local servers: blank-name validation, Cancel, Enter and Save, trimmed names, persistence after reload, and an unchanged connected session generation.
  • Packaged desktop verification; the app will be rebuilt from main after merging. The desktop and web app share this UI.

Before + After

Before renaming:

Original host name

New action and dialog:

Rename action in the environment menu

Rename environment dialog

After saving:

Saved environment name

Rollout

Only local connection metadata changes; no database migration or server deployment is needed. Rebuild the desktop app after merging and leave the running app alone for Nicholas to restart.

royal-walnut-flamingo

Copilot AI balanced review requested due to automatic review settings November 5, 2026 06:54
@NicholasZolton
NicholasZolton merged commit c4bba37 into main Nov 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

4 open issues
What changed in this PR

Adds client-side renaming for saved environments (web/desktop) while preserving the active connection/supervisor session and persisting the name across restarts and route/discovery refreshes.

Changes:

  • Introduces an EnvironmentRegistry.rename operation and exposes it via the environment catalog runtime commands/atoms.
  • Persists a user-chosen label via a new labelSource: "user" marker to prevent discovery refresh from overwriting the name.
  • Adds the web UI menu action + dialog to rename an environment, plus docs and test updates.
File Description
packages/​client-runtime/​src/​state/​threads-atoms.test.ts Extends test harness to account for the new rename command.
packages/​client-runtime/​src/​state/​connections.ts Adds a serial runtime command for environment-catalog:rename and exports it.
packages/​client-runtime/​src/​connection/​routes.ts Preserves labelSource when creating learned routes.
packages/​client-runtime/​src/​connection/​routes.test.ts Expands learned-route tests to cover labelSource propagation.
packages/​client-runtime/​src/​connection/​registry.ts Implements rename logic, introduces labelSource handling, and refactors entry publishing to keep supervisor/session intact.
packages/​client-runtime/​src/​connection/​registry.test.ts Adds coverage for rename persistence, no-disconnect behavior, and failure rollback.
packages/​client-runtime/​src/​connection/​model.ts Adds optional labelSource to connection targets to distinguish user-chosen labels.
docs/​user/​remote-access.md Documents how renaming works on web/desktop and its non-impact on host/agents.
apps/​web/​src/​components/​settings/​SavedEnvironmentRows.tsx Adds “Rename…” menu item + dialog wiring in saved environment rows.
apps/​web/​src/​components/​settings/​RenameEnvironmentDialog.tsx New rename dialog UI and save flow calling the atom command.

Review effort: Lite

Comment on lines +1081 to +1087
const trimmed = label.trim();
if (trimmed.length === 0) {
return yield* new ConnectionBlockedError({
reason: "configuration",
detail: "Environment name cannot be empty.",
});
}
Comment on lines +1091 to +1094
const entry = yield* userEntry(environmentId);
if (entry.target._tag === "PrimaryConnectionTarget") {
return yield* new PlatformEnvironmentRemovalError({ environmentId });
}
Comment on lines +67 to +79
function withUserLabel(target: ConnectionTarget, label: string): ConnectionTarget {
const fields = { label, labelSource: "user" as const };
switch (target._tag) {
case "PrimaryConnectionTarget":
return new PrimaryConnectionTarget({ ...target, ...fields });
case "BearerConnectionTarget":
return new BearerConnectionTarget({ ...target, ...fields });
case "RelayConnectionTarget":
return new RelayConnectionTarget({ ...target, ...fields });
case "SshConnectionTarget":
return new SshConnectionTarget({ ...target, ...fields });
}
}
Effect.gen(function* () {
const entry = yield* userEntry(environmentId);
if (entry.target._tag === "PrimaryConnectionTarget") {
return yield* new PlatformEnvironmentRemovalError({ environmentId });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants