The best way to control Claude Code, Codex and more from any computer or phone
fix(clients): hide disconnected environments when adding projects (#14490)
Julius Marminge committed
Sep 30, 2026 at 16:20 UTC
7c67876983ade7ef886c825eefe569b3a96c81e8
2 files changed
+21
-16
apps/mobile/src/features/projects/AddProjectScreen.tsx
+4
-1
@@ -405,7 +405,10 @@ function useEnvironmentOptions(): ReadonlyArray<EnvironmentOption> {
405
supportsCloneTracking: config?.environment.capabilities.projectCloneTracking === true,
406
};
407
});
408
- return Arr.sort(options, environmentOptionOrder);
408
+ return Arr.sort(
409
+ options.filter((environment) => canCreateProjectInEnvironment(environment.connectionState)),
410
+ environmentOptionOrder,
411
+ );
412
}, [connectedEnvironments, savedConnectionsById, serverConfigByEnvironmentId]);
413
}
414
apps/web/src/components/CommandPalette.tsx
+17
-15
@@ -963,21 +963,23 @@ function OpenCommandPaletteDialog(props: {
963
);
964
965
const addProjectEnvironmentOptions = useMemo(() => {
966
- const options = environments.map((environment): AddProjectEnvironmentOption => {
967
- const isPrimary = environment.entry.target._tag === "PrimaryConnectionTarget";
968
- return {
969
- environmentId: environment.environmentId,
970
- label: resolveEnvironmentOptionLabel({
971
- isPrimary,
966
+ const options = environments
967
+ .filter((environment) => canCreateProjectInEnvironment(environment.connection.phase))
968
+ .map((environment): AddProjectEnvironmentOption => {
969
+ const isPrimary = environment.entry.target._tag === "PrimaryConnectionTarget";
970
+ return {
971
environmentId: environment.environmentId,
973
- runtimeLabel: environment.label,
974
- }),
975
- isPrimary,
976
- machine: resolveEnvironmentMachineKind(environment.serverConfig),
977
- isConnected: canCreateProjectInEnvironment(environment.connection.phase),
978
- status: connectionStatusText(environment.connection),
979
- };
980
- });
972
+ label: resolveEnvironmentOptionLabel({
973
+ isPrimary,
974
+ environmentId: environment.environmentId,
975
+ runtimeLabel: environment.label,
976
+ }),
977
+ isPrimary,
978
+ machine: resolveEnvironmentMachineKind(environment.serverConfig),
979
+ isConnected: canCreateProjectInEnvironment(environment.connection.phase),
980
+ status: connectionStatusText(environment.connection),
981
+ };
982
+ });
983
984
options.sort((left, right) => {
985
if (left.isPrimary !== right.isPrimary) {
@@ -1658,7 +1660,7 @@ function OpenCommandPaletteDialog(props: {
1660
);
1661
1662
const openAddProjectFlow = useCallback(() => {
1661
- // With no environment at all there is nothing to browse, so the only
1663
+ // With no connected environment there is nothing to browse, so the only
1664
// useful next step is connecting one.
1665
if (addProjectEnvironmentOptions.length === 0) {
1666
setOpen(false);