Skip to content

Allow custom environment names - #4538

Open
colonelpanic8 wants to merge 3 commits into
pingdotgg:mainfrom
colonelpanic8:t3code/custom-environment-names
Open

Allow custom environment names#4538
colonelpanic8 wants to merge 3 commits into
pingdotgg:mainfrom
colonelpanic8:t3code/custom-environment-names

Conversation

@colonelpanic8

@colonelpanic8 colonelpanic8 commented Jul 25, 2026

Copy link
Copy Markdown

What Changed

  • Add optional, client-local environment display names keyed by environment ID.
  • Add a Rename action to saved environment rows; clearing the field restores the server-reported label.
  • Resolve custom names through the shared web environment presentation so pickers, sidebars, and thread indicators use the same name.
  • Preserve SSH aliases when adding manual SSH connections.
  • Show the connection URL beneath saved environment names for additional disambiguation.

Why

Different remote machines commonly report the same hostname, making saved connections and environment pickers indistinguishable. Custom names provide an opt-in per-client override without changing environment identity or server configuration.

UI Changes

Settings → Connections now exposes a Rename action on each saved environment. The dialog makes the override explicitly client-local and allows clearing it to return to the live server default. Browser verification covered pairing a remote, renaming it, persistence after reload, clearing the override, and the URL subtitle.

Checklist

  • vp run --filter @t3tools/contracts test -- src/settings.test.ts
  • vp run --filter @t3tools/web test -- src/clientPersistenceStorage.test.ts src/localApi.test.ts
  • vp check (passes with existing repository warnings)
  • vp run typecheck (blocked by pre-existing web type errors and the isolated checkout missing @astrojs/check; changed contracts typecheck passes)

Note

Low Risk
Changes are limited to client-local persistence and UI labeling; no server config or auth changes, with schema validation on saved names.

Overview
Adds optional per-environment display names stored in client settings (environmentDisplayNames) so saved connections and environment pickers can be distinguished without changing server identity.

Connections gets a Rename flow on each saved remote row: a dialog saves a trimmed override or clears it to fall back to the server default; rows show the connection URL via shared displayUrl metadata instead of ad hoc SSH formatting.

Environment presentation now resolves label from client overrides (with defaultLabel preserved) everywhere useEnvironments / useEnvironment run, so sidebars and pickers stay consistent.

Also fixes SSH presentation: manual SSH adds use the target alias as the initial label, and connectionCatalogDisplayUrl omits a missing username and appends port when set. useUpdatePrimarySettings reads the primary environment id from primaryEnvironmentIdAtom instead of the presentation hook.

Reviewed by Cursor Bugbot for commit 5e10a60. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Allow custom per-environment display names in connection settings

  • Adds a Rename action to saved environment rows in ConnectionsSettings.tsx, opening a dialog to set a client-local display name stored in ClientSettings.environmentDisplayNames.
  • Extends settings.ts with an environmentDisplayNames field (keyed by EnvironmentId, trimmed non-empty strings) and a matching patch field; defaults to {}.
  • Updates projectEnvironmentPresentation in environments.ts to apply overrides from client settings, exposing both label (possibly overridden) and defaultLabel.
  • Fixes SSH display URLs in presentation.ts to omit the username when absent (previously rendered as null@host) and include the port when set.

Macroscope summarized 5e10a60.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 070f8ea0-393f-40af-a4dc-d29b9deec671

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jul 25, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e8f62d6. Configure here.

Comment thread apps/web/src/components/settings/ConnectionsSettings.tsx
@macroscopeapp

macroscopeapp Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces a new user-facing feature (custom environment naming) with new UI components, schema additions, and changes to environment display logic. New features warrant human review even when well-scoped.

You can customize Macroscope's approvability policy. Learn more.

colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 25, 2026
# Conflicts:
#	apps/web/src/components/settings/ConnectionsSettings.tsx
#	apps/web/src/state/environments.ts
#	packages/contracts/src/settings.ts
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 25, 2026
# Conflicts:
#	apps/web/src/components/settings/ConnectionsSettings.tsx
#	apps/web/src/state/environments.ts
#	packages/contracts/src/settings.ts
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 25, 2026
# Conflicts:
#	apps/web/src/components/settings/ConnectionsSettings.tsx
#	apps/web/src/state/environments.ts
#	packages/contracts/src/settings.ts
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 25, 2026
# Conflicts:
#	apps/web/src/components/settings/ConnectionsSettings.tsx
#	apps/web/src/state/environments.ts
#	packages/contracts/src/settings.ts
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
# Conflicts:
#	apps/web/src/components/settings/ConnectionsSettings.tsx
#	apps/web/src/state/environments.ts
#	packages/contracts/src/settings.ts
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 26, 2026
# Conflicts:
#	apps/web/src/components/settings/ConnectionsSettings.tsx
#	apps/web/src/state/environments.ts
#	packages/contracts/src/settings.ts
@colonelpanic8
colonelpanic8 force-pushed the t3code/custom-environment-names branch from e8f62d6 to 46480c0 Compare July 28, 2026 02:08
Comment thread apps/web/src/components/settings/ConnectionsSettings.tsx Outdated
@inayayousfi

Copy link
Copy Markdown
Contributor

Written by inayayousfi, typed by gpt-5.6-sol running in OpenCode.
Every call here is inayayousfi's, and no agent acted on its own.

Thanks for tackling environment naming. PR #7267 now covers the same core problem with a server-owned name that propagates across web, desktop, mobile, and T3 Connect. It also supports authorized remote renaming, duplicate-name confirmation, and restoring the detected machine name.

Would you be open to closing this PR in favor of #7267? That would save maintainers from reviewing and reconciling two naming implementations. The SSH alias and connection URL presentation changes here do not overlap, so they could still stand on their own if you want to keep pursuing them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants