@devries-cameron20 / t3code Mirror · read-only / commits / 81f23426d4
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 13:30 UTC

fix(web): Settings > Projects list follows the selected environment (#36856)

Julius Marminge committed Nov 14, 2026 at 10:10 UTC 81f23426d4652ce1d45a87e2a1ab041d52a3c3a3
2 files changed +33 -3
apps/web/src/components/settings/ProjectSettingsPanel.browser.test.tsx
+27
@@ -658,6 +658,33 @@ describe("project settings scope", () => {
658 await expect.element(remoteOption()).toBeVisible();
659 });
660
661 + it("lists only the selected environment's projects and keeps it when one is opened", async () => {
662 + setup();
663 + const [primaryProject, remoteProject] = state.projects;
664 + state.projects = [
665 + primaryProject!,
666 + {
667 + ...remoteProject!,
668 + title: "Remote only",
669 + repositoryIdentity: null,
670 + },
671 + ];
672 + await using screen = await mountSettings({ machine: primaryId });
673 +
674 + await expect.element(page.getByRole("button", { name: /^Shared repo/ })).toBeVisible();
675 + await expect
676 + .element(page.getByRole("button", { name: /^Remote only/ }))
677 + .not.toBeInTheDocument();
678 +
679 + await userEvent.click(page.getByRole("button", { name: /^Shared repo/ }));
680 + await vi.waitFor(() =>
681 + expect(screen.router.state.location.search).toEqual({
682 + project: projectKey(),
683 + machine: primaryId,
684 + }),
685 + );
686 + });
687 +
688 it("offers only the selected project's checkout environments", async () => {
689 setup();
690 state.projects = state.projects.filter((project) => project.environmentId === primaryId);
apps/web/src/components/settings/SettingsScopeNotice.tsx
+6 -3
@@ -15,6 +15,8 @@ import { SettingsPageContainer, SettingsSection } from "./settingsLayout";
15 import { useSettingsScope } from "./SettingsScopeContext";
16 import type { SettingsScopeSearch } from "./settingsScope";
17 import {
18 + projectScopeMenuGroups,
19 + selectProjectAxis,
20 settingsScopeEnvironmentAddress,
21 settingsScopeEnvironmentLabels,
22 settingsScopeProjectMachines,
@@ -57,6 +59,7 @@ export function SettingsScopeNotice({
59 target === "checkout"
60 ? groups.filter((group) => !search.project || group.projectKey === search.project)
61 : [null];
62 + const projectGroups = projectScopeMenuGroups(groups, search);
63 const renderChoices = (group: SidebarProjectSnapshot | null) => {
64 const choices: ScopeChoice[] = group
65 ? group.memberProjects.map((member) => {
@@ -81,11 +84,11 @@ export function SettingsScopeNotice({
84 };
85 })
86 : target === "project"
84 - ? groups.map((group) => ({
87 + ? projectGroups.map((group) => ({
88 label: group.displayName,
89 secondary: [
90 ...(group.archived ? ["Archived"] : []),
88 - ...(groups.some(
91 + ...(projectGroups.some(
92 (other) =>
93 other.projectKey !== group.projectKey && other.displayName === group.displayName,
94 )
@@ -94,7 +97,7 @@ export function SettingsScopeNotice({
97 group.workspaceRoot,
98 ].join(" · "),
99 icon: <ProjectFavicon project={group} className="size-4 shrink-0" />,
97 - search: { project: group.projectKey },
100 + search: selectProjectAxis(search, group.projectKey),
101 }))
102 : target === "environment"
103 ? environments