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 24, 10:15 UTC
fix(web): show project settings for new threads (#9743)
maria committed
Sep 4, 2026 at 14:32 UTC
cbe93e8dfba68ff6fbe8c69e43a633fdc79db62d
2 files changed
+34
-3
apps/web/src/components/ChatView.tsx
+15
-1
@@ -1970,6 +1970,18 @@ export default function ChatView(props: ChatViewProps) {
1970
const handleNewThreadInActiveProject = useCallback(() => {
1971
startNewThreadForProject(activeProjectRef, handleNewThread);
1972
}, [activeProjectRef, handleNewThread]);
1973
+ const projectGroupingSettings = useClientSettings(selectProjectGroupingSettings);
1974
+ const activeDraftLogicalProjectKey =
1975
+ !isServerThread && activeProject
1976
+ ? deriveLogicalProjectKeyFromSettings(activeProject, projectGroupingSettings)
1977
+ : undefined;
1978
+ const handleOpenDraftProjectSettings = useCallback(() => {
1979
+ if (!activeDraftLogicalProjectKey) return;
1980
+ void navigate({
1981
+ to: "/projects/$projectKey",
1982
+ params: { projectKey: activeDraftLogicalProjectKey },
1983
+ });
1984
+ }, [activeDraftLogicalProjectKey, navigate]);
1985
const activeEnvironmentShell = useEnvironmentQuery(
1986
activeThread ? environmentShell.stateAtom(activeThread.environmentId) : null,
1987
);
@@ -1977,7 +1989,6 @@ export default function ChatView(props: ChatViewProps) {
1989
const activeProjectKey = activeProject
1990
? `${activeProject.environmentId}:${activeProject.workspaceRoot}`
1991
: null;
1980
- const projectGroupingSettings = useClientSettings(selectProjectGroupingSettings);
1992
const clientSettingsHydrated = useClientSettingsHydrated();
1993
const [pendingFileSurfaceIdsByProject, setPendingFileSurfaceIdsByProject] = useState<
1994
ReadonlyMap<string, ReadonlySet<string>>
@@ -7729,6 +7740,9 @@ export default function ChatView(props: ChatViewProps) {
7740
rightPanelOpen={rightPanelOpen}
7741
gitCwd={gitCwd}
7742
onNewThreadInProject={handleNewThreadInActiveProject}
7743
+ {...(activeDraftLogicalProjectKey
7744
+ ? { onOpenProjectSettings: handleOpenDraftProjectSettings }
7745
+ : {})}
7746
onRunProjectScript={runProjectScript}
7747
onAddProjectScript={saveProjectScript}
7748
onUpdateProjectScript={updateProjectScript}
apps/web/src/components/chat/ChatHeader.tsx
+19
-2
@@ -35,6 +35,7 @@ import { useRemoteOpenState, type RemoteOpenMode } from "../../remoteOpen";
35
import { usePrimaryEnvironmentId } from "../../state/environments";
36
import { useT3ProjectFileScripts } from "~/hooks/useT3ProjectFileScripts";
37
import { useThreadActionMenu } from "~/hooks/useThreadActionMenu";
38
+import { readLocalApi } from "~/localApi";
39
import { threadEnvironment } from "../../state/threads";
40
import { useAtomCommand } from "../../state/use-atom-command";
41
import { observeResponsiveBreakpointFade, usePanelAnimationSettings } from "../../panelAnimations";
@@ -66,6 +67,7 @@ interface ChatHeaderProps {
67
gitCwd: string | null;
68
readonly onOpenPullRequest?: ((number: number) => void) | undefined;
69
onNewThreadInProject: () => void;
70
+ onOpenProjectSettings?: (() => void) | undefined;
71
onRunProjectScript: (script: ProjectScript) => void;
72
onAddProjectScript: (input: NewProjectScriptInput) => Promise<ProjectScriptActionResult>;
73
onUpdateProjectScript: (
@@ -137,6 +139,7 @@ export const ChatHeader = memo(function ChatHeader({
139
gitCwd,
140
onOpenPullRequest,
141
onNewThreadInProject,
142
+ onOpenProjectSettings,
143
onRunProjectScript,
144
onAddProjectScript,
145
onUpdateProjectScript,
@@ -275,15 +278,29 @@ export const ChatHeader = memo(function ChatHeader({
278
);
279
const handleHeaderContextMenu = useCallback(
280
(event: ReactMouseEvent) => {
278
- if (!isServerThread || renamingTitle !== null) return;
281
+ if (renamingTitle !== null) return;
282
// The right-side controls (git, scripts, open-in) keep their own
283
// behavior; only the breadcrumb area opens the thread menu.
284
if ((event.target as HTMLElement).closest("[data-chat-header-actions]")) return;
285
+ if (!isServerThread && onOpenProjectSettings === undefined) return;
286
cancelPendingTitleMenu();
287
event.preventDefault();
288
+ if (!isServerThread) {
289
+ const api = readLocalApi();
290
+ if (!api) return;
291
+ void api.contextMenu
292
+ .show([{ id: "project-settings", label: "Project settings", icon: "settings" }], {
293
+ x: event.clientX,
294
+ y: event.clientY,
295
+ })
296
+ .then((action) => {
297
+ if (action === "project-settings") onOpenProjectSettings?.();
298
+ });
299
+ return;
300
+ }
301
openMenu({ x: event.clientX, y: event.clientY });
302
},
286
- [cancelPendingTitleMenu, isServerThread, openMenu, renamingTitle],
303
+ [cancelPendingTitleMenu, isServerThread, onOpenProjectSettings, openMenu, renamingTitle],
304
);
305
const handleRenameKeyDown = useCallback(
306
(event: ReactKeyboardEvent<HTMLInputElement>) => {