@devries-cameron20 / t3code-1 / commits / 7c6e889ddb
Fork 0

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

feat: subagents, side chats and linked threads open the same way (#39515)

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>

Julius Marminge committed Nov 20, 2026 at 12:19 UTC 7c6e889ddbc2c8b74a4fd784623175abea4ee310
76 files changed +1907 -544
apps/desktop/src/settings/DesktopClientSettings.test.ts
+1
@@ -27,6 +27,7 @@ const clientSettings: ClientSettings = {
27 browserDefaultAppearance: "dark",
28 browserRecordingFrameRate: 60,
29 browserLinkTarget: "app",
30 + sideThreadOpenTarget: "main",
31 browserAutoShowFloatingPreview: false,
32 browserProfiles: [{ id: "work", name: "Work", kind: "persistent" }],
33 browserDefaultProfileId: "work",
apps/mobile/src/Stack.tsx
+5
@@ -789,6 +789,11 @@ const RootStackConfig = createWorkspaceStackNavigator({
789 screen: LinkedThreadSheet,
790 options: sheetRoute({ detent: 0.9, android: "fullScreen" }),
791 }),
792 + // Maximized from the inspector, like ThreadInspectorFullscreen.
793 + LinkedThreadFullscreen: createNativeStackScreen({
794 + screen: LinkedThreadSheet,
795 + options: modalRoute({ header: "glass", itemStyle: "editor", duoMinimize: "onScrollUp" }),
796 + }),
797 ThreadGuestShare: createNativeStackScreen({
798 screen: ThreadGuestShareSheet,
799 options: sheetRoute({ detent: 0.5 }),
apps/mobile/src/features/threads/LinkedThreadSheet.tsx
+35 -36
@@ -17,7 +17,7 @@ import {
17 } from "@t3tools/client-runtime/work-log/item-detail";
18 import { EnvironmentId, ThreadId } from "@t3tools/contracts";
19 import { T, useGT, useLocale, useMessages } from "gt-react-native";
20 -import { useRef, useState, useSyncExternalStore } from "react";
20 +import { useEffect, useRef, useState, useSyncExternalStore } from "react";
21 import type * as React from "react";
22 import { AppState, Pressable, ScrollView, View } from "react-native";
23 import { useSafeAreaInsets } from "react-native-safe-area-context";
@@ -26,7 +26,6 @@ import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator";
26 import { AppText as Text } from "../../components/ui/AppText";
27 import { Button } from "../../components/ui/Button";
28 import { ScreenContent } from "../../components/ui/ScreenContent";
29 -import { SheetHeader } from "../../components/ui/SheetHeader";
29 import { SelectableMarkdownText } from "../../native/SelectableMarkdownText";
30 import { useEnvironments } from "../../state/environments";
31 import {
@@ -40,30 +39,11 @@ import { useConnectLinkedEnvironment, useLinkedThreadView } from "../../state/li
39 import { peerLinkEnvironment } from "../../state/peerLinks";
40 import { useEnvironmentQuery } from "../../state/query";
41 import { useMarkdownPreviewStyles } from "../files/FileMarkdownPreview";
42 +import type { LinkedThreadRouteParams } from "./linkedThreadRoute";
43 import { ReadOnlyComposerBar } from "./ReadOnlyComposerBar";
44 +import { ThreadInspectorHeader, type ThreadInspectorPresentation } from "./thread-inspector-header";
45 import { useOpenLinkedThread } from "./useOpenLinkedThread";
46
46 -type LinkedThreadRouteParams = {
47 - readonly viaEnvironmentId: string;
48 - readonly environmentId: string;
49 - readonly threadId: string;
50 - readonly label: string;
51 - readonly title?: string;
52 -};
53 -
54 -/** The route params that open a linked environment's thread read-only. */
55 -export const linkedThreadRouteParams = (
56 - thread: { readonly environmentId: EnvironmentId; readonly threadId: ThreadId },
57 - linked: { readonly viaEnvironmentId: EnvironmentId; readonly label: string },
58 - title: string | null,
59 -): LinkedThreadRouteParams => ({
60 - viaEnvironmentId: linked.viaEnvironmentId,
61 - environmentId: thread.environmentId,
62 - threadId: thread.threadId,
63 - label: linked.label,
64 - ...(title === null ? {} : { title }),
65 -});
66 -
47 function ActivityRow(props: {
48 readonly activity: ThreadFeedActivity;
49 readonly target: LinkedThreadTarget;
@@ -263,12 +243,23 @@ const subscribeAppState = (onChange: () => void) => {
243 };
244 const appIsActive = () => AppState.currentState === "active";
245
266 -function LinkedThreadView(props: { readonly target: LinkedThreadTarget }) {
246 +/**
247 + * A linked environment's thread, read through the environment this app is connected to. The app
248 + * never connects to the linked one, so the view only reads. It shows in the inspector, where
249 + * `presentation` maximizes it, or as its own screen, where `presentation` closes it.
250 + */
251 +export function LinkedThreadView(props: {
252 + readonly target: LinkedThreadTarget;
253 + /** Closes the screen by going back when absent. */
254 + readonly presentation?: ThreadInspectorPresentation;
255 +}) {
256 const { target } = props;
257 const gt = useGT();
258 const m = useMessages();
259 const locale = useLocale();
260 const navigation = useNavigation();
261 + const presentation = props.presentation ?? { onClose: () => navigation.goBack() };
262 + const inInspector = "onMaximize" in presentation;
263 const insets = useSafeAreaInsets();
264 const via =
265 useEnvironments().environments.find(
@@ -299,23 +290,34 @@ function LinkedThreadView(props: { readonly target: LinkedThreadTarget }) {
290 const connection = useConnectLinkedEnvironment(target);
291 const connectState = connection.state;
292 const openThread = useOpenLinkedThread();
293 + const shown = useRef(true);
294 + // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- records unmount, so a connect that resolves after the view is gone navigates nowhere
295 + useEffect(() => {
296 + shown.current = true;
297 + return () => {
298 + shown.current = false;
299 + };
300 + }, []);
301 const connect = async () => {
302 const outcome = await connection.connect();
304 - if (outcome.type === "unreachable") return;
305 - // This sheet closes either way: the thread opens where the app is now connected, or the
306 - // add-environment screen takes its place.
303 + if (outcome.type === "unreachable" || !shown.current) return;
304 + // The read-only view gives way either way: the thread opens where the app is now connected,
305 + // or the add-environment screen takes its place. In the inspector the thread replaces it there.
306 if (outcome.type === "connected") {
308 - navigation.goBack();
307 + if (!inInspector) navigation.goBack();
308 openThread({ environmentId: target.environmentId, threadId: target.threadId });
309 return;
310 }
312 - navigation.dispatch(StackActions.replace("ConnectionsNew", { linked: target.environmentId }));
311 + if (inInspector) navigation.navigate("ConnectionsNew", { linked: target.environmentId });
312 + else {
313 + navigation.dispatch(StackActions.replace("ConnectionsNew", { linked: target.environmentId }));
314 + }
315 };
316 return (
315 - <View collapsable={false} className="flex-1 bg-sheet">
316 - <SheetHeader
317 + <View collapsable={false} className={inInspector ? "flex-1 bg-screen" : "flex-1 bg-sheet"}>
318 + <ThreadInspectorHeader
319 + {...presentation}
320 title={projection?.thread.title || target.title || gt("Thread on {label}", { label })}
318 - onClose={() => navigation.goBack()}
321 />
322 <ScreenContent>
323 <ScrollView
@@ -422,10 +424,7 @@ function LinkedThreadView(props: { readonly target: LinkedThreadTarget }) {
424 );
425 }
426
425 -/**
426 - * A linked environment's thread, read through the environment this app is connected to. The app
427 - * never connects to the linked one, so the screen only reads.
428 - */
427 +/** The read-only view as its own screen: a sheet, or the whole screen when maximized from the inspector. */
428 export function LinkedThreadSheet({ route }: StaticScreenProps<LinkedThreadRouteParams>) {
429 const { viaEnvironmentId, environmentId, threadId, label, title } = route.params;
430 return (
apps/mobile/src/features/threads/ThreadAgentsSheet.tsx
+3 -4
@@ -30,10 +30,10 @@ import { SubagentStopButton } from "./SubagentStopButton";
30 import { ThreadWorkflowGroup } from "./ThreadWorkflowGroup";
31 import { ScreenContent } from "../../components/ui/ScreenContent";
32 import { subagentThreadTarget, type SubagentThreadTarget } from "./threadAgentsPresentation";
33 -import { linkedThreadRouteParams } from "./LinkedThreadSheet";
33 import { useLinkedThreadReach } from "../../state/linkedThread";
34
35 import { useOpenThreadInspector } from "./thread-inspector-navigation";
36 +import { useOpenLinkedThreadRead } from "./useOpenLinkedThread";
37
38 type AgentsTarget = { readonly environmentId: EnvironmentId; readonly threadId: ThreadId };
39
@@ -53,6 +53,7 @@ export function ThreadAgentsSheet({ route }: StaticScreenProps<AgentsTarget>) {
53 const target = route.params;
54 const navigation = useNavigation();
55 const openInspector = useOpenThreadInspector();
56 + const openLinkedRead = useOpenLinkedThreadRead();
57 const insets = useSafeAreaInsets();
58 const gt = useGT();
59 const messages = useMessages();
@@ -73,9 +74,7 @@ export function ThreadAgentsSheet({ route }: StaticScreenProps<AgentsTarget>) {
74 const openChildThread = (child: SubagentThreadTarget, title: string | null = null) => {
75 void Haptics.selectionAsync();
76 if (child.linked !== undefined) {
76 - navigation.dispatch(
77 - StackActions.replace("LinkedThread", linkedThreadRouteParams(child, child.linked, title)),
78 - );
77 + openLinkedRead(child, child.linked, title, { source: target, replace: true });
78 return;
79 }
80 if (
apps/mobile/src/features/threads/ThreadRouteScreen.tsx
+2 -6
@@ -127,12 +127,8 @@ import {
127 useWorkspaceBackNavigation,
128 } from "../layout/workspace/useAndroidWorkspaceNavigation";
129 import { openSettings } from "../settings/settings-navigation";
130 -import {
131 - InspectorContentScope,
132 - ThreadInspectorHeader,
133 - ThreadInspectorPreview,
134 - type ThreadInspectorPresentation,
135 -} from "./thread-inspector-preview";
130 +import { ThreadInspectorHeader, type ThreadInspectorPresentation } from "./thread-inspector-header";
131 +import { InspectorContentScope, ThreadInspectorPreview } from "./thread-inspector-preview";
132 import { useStartSideChat } from "./useStartSideChat";
133 import { useThreadStatusAnnouncements } from "./useThreadStatusAnnouncements";
134 import type { ThreadInspectorMode, ThreadInspectorTarget } from "./thread-inspector-navigation";
apps/mobile/src/features/threads/linkedThreadRoute.ts new
+22
@@ -0,0 +1,22 @@
1 +import type { EnvironmentId, ThreadId } from "@t3tools/contracts";
2 +
3 +export type LinkedThreadRouteParams = {
4 + readonly viaEnvironmentId: string;
5 + readonly environmentId: string;
6 + readonly threadId: string;
7 + readonly label: string;
8 + readonly title?: string;
9 +};
10 +
11 +/** The route params that open a linked environment's thread read-only. */
12 +export const linkedThreadRouteParams = (
13 + thread: { readonly environmentId: EnvironmentId; readonly threadId: ThreadId },
14 + linked: { readonly viaEnvironmentId: EnvironmentId; readonly label: string },
15 + title: string | null,
16 +): LinkedThreadRouteParams => ({
17 + viaEnvironmentId: linked.viaEnvironmentId,
18 + environmentId: thread.environmentId,
19 + threadId: thread.threadId,
20 + label: linked.label,
21 + ...(title === null ? {} : { title }),
22 +});
apps/mobile/src/features/threads/thread-inspector-header.tsx new
+38
@@ -0,0 +1,38 @@
1 +import { useGT } from "gt-react-native";
2 +
3 +import { AppBar } from "../../components/ui/AppBar";
4 +import { SheetHeader } from "../../components/ui/SheetHeader";
5 +
6 +/** A thread shown outside its route: in the inspector pane, or presented full screen with a close. */
7 +export type ThreadInspectorPresentation =
8 + | { readonly onMaximize: () => void }
9 + | { readonly onClose: () => void };
10 +
11 +export function ThreadInspectorHeader(
12 + props: ThreadInspectorPresentation & { readonly title: string; readonly subtitle?: string },
13 +) {
14 + const gt = useGT();
15 + if ("onMaximize" in props) {
16 + return (
17 + <AppBar
18 + title={props.title}
19 + subtitle={props.subtitle}
20 + actions={[
21 + {
22 + accessibilityLabel: gt("Maximize thread"),
23 + icon: "arrow.up.left.and.arrow.down.right",
24 + onPress: props.onMaximize,
25 + },
26 + ]}
27 + />
28 + );
29 + }
30 + return (
31 + <SheetHeader
32 + title={props.title}
33 + subtitle={props.subtitle}
34 + onClose={props.onClose}
35 + accessibilityLabel={gt("Close thread")}
36 + />
37 + );
38 +}
apps/mobile/src/features/threads/thread-inspector-navigation.test.tsx
+60 -4
@@ -3,17 +3,19 @@ import * as NodeModule from "node:module";
3 import * as React from "react";
4 import { act, useLayoutEffect } from "react";
5 import { createRoot } from "react-dom/client";
6 +import { EnvironmentId, ThreadId } from "@t3tools/contracts";
7 import { expect, it, vi } from "vite-plus/test";
8
9 const harness = vi.hoisted(() => ({
10 dispatch: (_action: unknown) => {},
11 getState: (): unknown => undefined,
12 getRoute: (): unknown => undefined,
13 + inspectorSupported: true,
14 }));
15
16 vi.mock("react-native", () => ({ Platform: { OS: "ios" } }));
17 vi.mock("../layout/AdaptiveWorkspaceLayout", () => ({
16 - useWorkspacePaneState: () => ({ fileInspector: { supported: true } }),
18 + useWorkspacePaneState: () => ({ fileInspector: { supported: harness.inspectorSupported } }),
19 }));
20 vi.mock("@react-navigation/native", async () => {
21 const { createRequire } = await import("node:module");
@@ -28,7 +30,7 @@ vi.mock("@react-navigation/native", async () => {
30 });
31
32 import { useOpenThreadInspector } from "./thread-inspector-navigation";
31 -import { useOpenLinkedThread } from "./useOpenLinkedThread";
33 +import { useOpenLinkedThread, useOpenLinkedThreadRead } from "./useOpenLinkedThread";
34
35 const requireNavigation = NodeModule.createRequire(
36 NodeModule.createRequire(import.meta.url).resolve("@react-navigation/native/package.json"),
@@ -38,11 +40,12 @@ const { StackRouter, StackActions } = requireNavigation("@react-navigation/route
40 StackActions: typeof import("@react-navigation/native").StackActions;
41 };
42
41 -function setup(fromAgents: boolean, fullscreen = false) {
43 +function setup(fromAgents: boolean, fullscreen = false, inspectorSupported = true) {
44 + harness.inspectorSupported = inspectorSupported;
45 (globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true;
46 const router = StackRouter({});
47 const options = {
45 - routeNames: ["Home", "Thread", "ThreadAgents", "ThreadInspectorFullscreen"],
48 + routeNames: ["Home", "Thread", "ThreadAgents", "ThreadInspectorFullscreen", "LinkedThread"],
49 routeParamList: {},
50 routeGetIdList: {},
51 };
@@ -66,12 +69,15 @@ function setup(fromAgents: boolean, fullscreen = false) {
69 );
70 let openInspector: ReturnType<typeof useOpenThreadInspector>;
71 let openLinkedThread: ReturnType<typeof useOpenLinkedThread>;
72 + let openLinkedThreadRead: ReturnType<typeof useOpenLinkedThreadRead>;
73 function Probe() {
74 const open = useOpenThreadInspector();
75 const openLinked = useOpenLinkedThread();
76 + const openLinkedRead = useOpenLinkedThreadRead();
77 useLayoutEffect(() => {
78 openInspector = open;
79 openLinkedThread = openLinked;
80 + openLinkedThreadRead = openLinkedRead;
81 });
82 return null;
83 }
@@ -94,6 +100,9 @@ function setup(fromAgents: boolean, fullscreen = false) {
100 openLinked(threadId: string) {
101 act(() => openLinkedThread({ environmentId: source.environmentId, threadId }));
102 },
103 + openLinkedRead(...input: Parameters<typeof openLinkedThreadRead>) {
104 + act(() => openLinkedThreadRead(...input));
105 + },
106 [Symbol.dispose]() {
107 act(() => root.unmount());
108 },
@@ -134,6 +143,53 @@ it("opens a completion link in the parent inspector", () => {
143 });
144 });
145
146 +it.each([
147 + { inspectorSupported: true, fromAgents: false },
148 + { inspectorSupported: true, fromAgents: true },
149 + { inspectorSupported: false, fromAgents: false },
150 + { inspectorSupported: false, fromAgents: true },
151 +])(
152 + "opens a linked environment's thread in the inspector where there is one ($inspectorSupported, from Agents $fromAgents)",
153 + ({ inspectorSupported, fromAgents }) => {
154 + using screen = setup(fromAgents, false, inspectorSupported);
155 + const thread = {
156 + environmentId: EnvironmentId.make("linked-vm"),
157 + threadId: ThreadId.make("there"),
158 + };
159 + const linked = { viaEnvironmentId: EnvironmentId.make("remote-environment"), label: "fs-17" };
160 + screen.openLinkedRead(thread, linked, "Fix the build", {
161 + source: screen.source,
162 + replace: fromAgents,
163 + });
164 + if (inspectorSupported) {
165 + // Beside the parent, like a subagent or a side chat; the Agents sheet gives way.
166 + expect(screen.state.routes.map((route) => route.name)).toEqual(["Home", "Thread"]);
167 + expect(screen.state.routes.at(-1)).toMatchObject({
168 + key: screen.parentKey,
169 + params: {
170 + inspector: {
171 + type: "linkedThread",
172 + ...thread,
173 + linked: { ...linked, title: "Fix the build" },
174 + },
175 + },
176 + });
177 + return;
178 + }
179 + // A phone has no inspector: the read-only thread takes the screen, replacing the sheet.
180 + expect(screen.state.routes.map((route) => route.name)).toEqual([
181 + "Home",
182 + "Thread",
183 + "LinkedThread",
184 + ]);
185 + expect(screen.state.routes.at(-1)?.params).toEqual({
186 + ...thread,
187 + ...linked,
188 + title: "Fix the build",
189 + });
190 + },
191 +);
192 +
193 it("switches between subagents and devices in the same parent route", () => {
194 using screen = setup(false);
195 screen.open({ type: "thread", environmentId: screen.source.environmentId, threadId: "child" });
apps/mobile/src/features/threads/thread-inspector-navigation.ts
+13 -2
@@ -2,14 +2,22 @@ import { StackActions, useNavigation } from "@react-navigation/native";
2 import { createContext, use } from "react";
3 import { Platform } from "react-native";
4
5 +import { resolveMobileSideThreadPresentation } from "@t3tools/client-runtime/side-thread";
6 +
7 import { useWorkspacePaneState } from "../layout/AdaptiveWorkspaceLayout";
8
9 export type ThreadInspectorMode = "route" | "git" | "files" | "preview";
10
11 export type ThreadInspectorTarget = {
10 - readonly type: "thread" | "device" | "localPreview";
12 + /** "linkedThread" is a thread on a linked environment, read through `linked.viaEnvironmentId`. */
13 + readonly type: "thread" | "linkedThread" | "device" | "localPreview";
14 readonly environmentId: string;
15 readonly threadId: string;
16 + readonly linked?: {
17 + readonly viaEnvironmentId: string;
18 + readonly label: string;
19 + readonly title?: string;
20 + };
21 readonly deviceKey?: string;
22 /** The environment's localhost page a "localPreview" shows. */
23 readonly url?: string;
@@ -27,7 +35,10 @@ export function useOpenThreadInspector() {
35 source: { readonly environmentId: string; readonly threadId: string },
36 target: ThreadInspectorTarget,
37 ) => {
30 - if (Platform.OS !== "ios" || !fileInspector.supported) return false;
38 + const presentation = resolveMobileSideThreadPresentation({
39 + inspectorAvailable: Platform.OS === "ios" && fileInspector.supported,
40 + });
41 + if (presentation === "full-screen") return false;
42 if (openInInspector) openInInspector(target);
43 else {
44 const parent = navigation.getState()?.routes.findLast((route) => route.name === "Thread");
apps/mobile/src/features/threads/thread-inspector-preview.tsx
+40 -37
@@ -1,11 +1,8 @@
1 import { useIsFocused, useNavigation, type StaticScreenProps } from "@react-navigation/native";
2 import { EnvironmentId, ThreadId } from "@t3tools/contracts";
3 -import { useGT } from "gt-react-native";
3 import { type ReactNode } from "react";
4 import { View } from "react-native";
5
7 -import { AppBar } from "../../components/ui/AppBar";
8 -import { SheetHeader } from "../../components/ui/SheetHeader";
6 import { LocalPreviewScreen } from "../browser/LocalPreviewRouteScreen";
7 import { DevicePreviewScreen } from "../devices/DevicePreviewRouteScreen";
8 import {
@@ -16,42 +13,11 @@ import {
13 ThreadInspectorNavigationContext,
14 type ThreadInspectorTarget,
15 } from "./thread-inspector-navigation";
16 +import { linkedThreadRouteParams } from "./linkedThreadRoute";
17 +import { LinkedThreadView } from "./LinkedThreadSheet";
18 +import type { ThreadInspectorPresentation } from "./thread-inspector-header";
19 import { ThreadPreviewRoute } from "./thread-preview-route";
20
21 -/** A thread shown outside its route: in the inspector pane, or presented full screen with a close. */
22 -export type ThreadInspectorPresentation =
23 - | { readonly onMaximize: () => void }
24 - | { readonly onClose: () => void };
25 -
26 -export function ThreadInspectorHeader(
27 - props: ThreadInspectorPresentation & { readonly title: string; readonly subtitle?: string },
28 -) {
29 - const gt = useGT();
30 - if ("onMaximize" in props) {
31 - return (
32 - <AppBar
33 - title={props.title}
34 - subtitle={props.subtitle}
35 - actions={[
36 - {
37 - accessibilityLabel: gt("Maximize thread"),
38 - icon: "arrow.up.left.and.arrow.down.right",
39 - onPress: props.onMaximize,
40 - },
41 - ]}
42 - />
43 - );
44 - }
45 - return (
46 - <SheetHeader
47 - title={props.title}
48 - subtitle={props.subtitle}
49 - onClose={props.onClose}
50 - accessibilityLabel={gt("Close thread")}
51 - />
52 - );
53 -}
54 -
21 /** A thread shown beside or over the workspace does not take the workspace's content width. */
22 export function InspectorContentScope({ children }: { readonly children: ReactNode }) {
23 return (
@@ -102,6 +68,12 @@ export function ThreadInspectorPreview(props: {
68 });
69 }}
70 />
71 + ) : target.type === "linkedThread" && target.linked ? (
72 + <LinkedThread
73 + key={`${target.linked.viaEnvironmentId}:${target.environmentId}:${target.threadId}`}
74 + thread={target}
75 + linked={target.linked}
76 + />
77 ) : target.type === "device" ? (
78 <DevicePreviewScreen
79 key={`${target.environmentId}:${target.threadId}`}
@@ -133,3 +105,34 @@ export function ThreadInspectorPreview(props: {
105 </ThreadInspectorNavigationContext>
106 );
107 }
108 +
109 +/** A linked environment's read-only thread in the inspector; Maximize gives it the whole screen. */
110 +function LinkedThread(props: {
111 + readonly thread: Pick<ThreadInspectorTarget, "environmentId" | "threadId">;
112 + readonly linked: NonNullable<ThreadInspectorTarget["linked"]>;
113 +}) {
114 + const navigation = useNavigation();
115 + const params = linkedThreadRouteParams(
116 + {
117 + environmentId: EnvironmentId.make(props.thread.environmentId),
118 + threadId: ThreadId.make(props.thread.threadId),
119 + },
120 + {
121 + viaEnvironmentId: EnvironmentId.make(props.linked.viaEnvironmentId),
122 + label: props.linked.label,
123 + },
124 + props.linked.title ?? null,
125 + );
126 + return (
127 + <LinkedThreadView
128 + target={{
129 + viaEnvironmentId: EnvironmentId.make(params.viaEnvironmentId),
130 + environmentId: EnvironmentId.make(params.environmentId),
131 + threadId: ThreadId.make(params.threadId),
132 + label: params.label,
133 + title: params.title ?? null,
134 + }}
135 + presentation={{ onMaximize: () => navigation.navigate("LinkedThreadFullscreen", params) }}
136 + />
137 + );
138 +}
apps/mobile/src/features/threads/thread-subagent-group.tsx
+8 -7
@@ -28,11 +28,11 @@ import { useServerConfigs } from "../../state/entities";
28 import { SubagentRow } from "./SubagentRow";
29 import { useVisibleSecondClock } from "./use-visible-second-clock";
30 import { subagentThreadTarget } from "./threadAgentsPresentation";
31 -import { linkedThreadRouteParams } from "./LinkedThreadSheet";
31 import { useLinkedThreadReach } from "../../state/linkedThread";
32 import { WorkLogBlock } from "./work-log-layout";
33
34 import { useOpenThreadInspector } from "./thread-inspector-navigation";
35 +import { useOpenLinkedThreadRead } from "./useOpenLinkedThread";
36
37 type SubagentItem = Extract<OrchestrationV2TurnItem, { type: "subagent" }>;
38 type AgentTiming = Pick<OrchestrationV2Subagent, "status" | "startedAt" | "completedAt">;
@@ -114,6 +114,7 @@ export function ThreadSubagentGroup(props: {
114 const config = useAtomValue(serverEnvironment.configValueAtom(props.environmentId));
115 const navigation = useNavigation();
116 const openInspector = useOpenThreadInspector();
117 + const openLinkedRead = useOpenLinkedThreadRead();
118 const members = props.activities.flatMap(({ projectedItem }) =>
119 projectedItem.item.type === "subagent" ? [projectedItem.item] : [],
120 );
@@ -224,12 +225,12 @@ export function ThreadSubagentGroup(props: {
225 onPress={() => {
226 if (target === null) return;
227 if (target.linked !== undefined) {
227 - navigation.dispatch(
228 - StackActions.push(
229 - "LinkedThread",
230 - linkedThreadRouteParams(target, target.linked, agent.title),
231 - ),
232 - );
228 + openLinkedRead(target, target.linked, agent.title, {
229 + source: {
230 + environmentId: props.environmentId,
231 + threadId: members[0]!.threadId,
232 + },
233 + });
234 return;
235 }
236 if (
apps/mobile/src/features/threads/useOpenLinkedThread.ts
+53
@@ -1,8 +1,12 @@
1 import { StackActions, useNavigation, useRoute, type Route } from "@react-navigation/native";
2 import { use } from "react";
3 +import type { EnvironmentId, ThreadId } from "@t3tools/contracts";
4 +
5 import { linkedThreadStep } from "../../lib/android-workspace-navigation";
6 +import { linkedThreadRouteParams } from "./linkedThreadRoute";
7 import {
8 ThreadInspectorNavigationContext,
9 + type ThreadInspectorTarget,
10 useOpenThreadInspector,
11 } from "./thread-inspector-navigation";
12
@@ -33,3 +37,52 @@ export function useOpenLinkedThread() {
37 else if (step === "push") navigation.dispatch(StackActions.push("Thread", target));
38 };
39 }
40 +
41 +/**
42 + * Opens a linked environment's thread read-only, read through `linked.viaEnvironmentId`: in the
43 + * inspector where the layout has one, as subagents and side chats do, else as its own screen.
44 + * `source` is the thread it opens from when the caller is not that thread's own screen.
45 + */
46 +export function useOpenLinkedThreadRead() {
47 + const navigation = useNavigation();
48 + const route = useRoute<Route<string, { environmentId?: string; threadId?: string }>>();
49 + const openInspector = useOpenThreadInspector();
50 + const openInInspector = use(ThreadInspectorNavigationContext);
51 + return (
52 + thread: { readonly environmentId: EnvironmentId; readonly threadId: ThreadId },
53 + linked: { readonly viaEnvironmentId: EnvironmentId; readonly label: string },
54 + title: string | null,
55 + options?: {
56 + readonly source?: { readonly environmentId: string; readonly threadId: string };
57 + /** Replaces the calling sheet instead of stacking on it. */
58 + readonly replace?: boolean;
59 + },
60 + ) => {
61 + const params = linkedThreadRouteParams(thread, linked, title);
62 + const target: ThreadInspectorTarget = {
63 + type: "linkedThread",
64 + environmentId: params.environmentId,
65 + threadId: params.threadId,
66 + linked: {
67 + viaEnvironmentId: params.viaEnvironmentId,
68 + label: params.label,
69 + ...(params.title === undefined ? {} : { title: params.title }),
70 + },
71 + };
72 + if (openInInspector) {
73 + openInInspector(target);
74 + return;
75 + }
76 + const source =
77 + options?.source ??
78 + (route.name === "Thread" && route.params?.environmentId && route.params.threadId
79 + ? { environmentId: route.params.environmentId, threadId: route.params.threadId }
80 + : null);
81 + if (source !== null && openInspector(source, target)) return;
82 + navigation.dispatch(
83 + options?.replace
84 + ? StackActions.replace("LinkedThread", params)
85 + : StackActions.push("LinkedThread", params),
86 + );
87 + };
88 +}
apps/mobile/src/features/threads/useOpenThreadLink.ts
+3 -10
@@ -1,19 +1,17 @@
1 -import { StackActions, useNavigation } from "@react-navigation/native";
1 import { resolveLinkedThreadOpen } from "@t3tools/client-runtime/linked-thread";
2 import type { EnvironmentId, ScopedThreadRef } from "@t3tools/contracts";
3
4 import { useEnvironments } from "../../state/environments";
5 import { useLinkedEnvironments } from "../../state/peerLinks";
7 -import { linkedThreadRouteParams } from "./LinkedThreadSheet";
8 -import { useOpenLinkedThread } from "./useOpenLinkedThread";
6 +import { useOpenLinkedThread, useOpenLinkedThreadRead } from "./useOpenLinkedThread";
7
8 /**
9 * Opens a thread that a link or chip in `viaEnvironmentId` points at: in place when this app is
10 * connected to its environment, else read-only through `viaEnvironmentId`'s link to it.
11 */
12 export function useOpenThreadLink(viaEnvironmentId: EnvironmentId | null) {
15 - const navigation = useNavigation();
13 const openThread = useOpenLinkedThread();
14 + const openLinkedRead = useOpenLinkedThreadRead();
15 const linkedEnvironments = useLinkedEnvironments(viaEnvironmentId);
16 const { presentationById } = useEnvironments();
17 return (thread: ScopedThreadRef, title: string | null = null) => {
@@ -29,12 +27,7 @@ export function useOpenThreadLink(viaEnvironmentId: EnvironmentId | null) {
27 linked: true,
28 }) === "linked"
29 ) {
32 - navigation.dispatch(
33 - StackActions.push(
34 - "LinkedThread",
35 - linkedThreadRouteParams(thread, { viaEnvironmentId, label }, title),
36 - ),
37 - );
30 + openLinkedRead(thread, { viaEnvironmentId, label }, title);
31 return;
32 }
33 openThread({
apps/web/src/closedViewStore.test.ts
+6 -2
@@ -58,7 +58,7 @@ describe("closedViewStore", () => {
58 id: "bad",
59 kind: "panel-tab",
60 threadRef: refA,
61 - surface: { kind: "side-chat", id: "side-chat:x" },
61 + surface: { kind: "thread", id: "thread:x" },
62 },
63 {
64 id: "bad",
@@ -100,7 +100,8 @@ describe("closedViewStore", () => {
100 const sideChatId = store.remember({
101 kind: "panel-tab",
102 threadRef: refA,
103 - surface: { id: "side-chat:side", kind: "side-chat", threadId: ThreadId.make("side") },
103 + // Saved before a side chat's tab became a `thread` surface.
104 + surface: { id: "side-chat:side", kind: "side-chat", threadId: "side" } as never,
105 });
106 const publicId = store.remember(diff(refA));
107 const browserId = store.remember({
@@ -134,6 +135,9 @@ describe("closedViewStore", () => {
135 publicId,
136 sideChatId,
137 ]);
138 + expect(useClosedViewStore.getState().entries.at(-1)).toMatchObject({
139 + surface: { id: "thread:side", kind: "thread", threadId: "side" },
140 + });
141 const saved = JSON.stringify(await storage!.getItem(name!));
142 expect(saved).not.toContain("private.example");
143 expect(saved).not.toContain("Private page");
apps/web/src/closedViewStore.ts
+12 -5
@@ -12,7 +12,7 @@ import { createJSONStorage, persist } from "zustand/middleware";
12 import { decodeLinkedThreadSurface } from "./linkedThreadSurface";
13 import { resolveStorage } from "./lib/storage";
14 import { randomUUID } from "./lib/utils";
15 -import { type RightPanelSurface } from "./rightPanelStore";
15 +import { decodeThreadSurface, type RightPanelSurface } from "./rightPanelStore";
16
17 export type ClosedView =
18 | {
@@ -84,8 +84,8 @@ const isClosedViewEntry = (entry: unknown): entry is ClosedViewEntry => {
84 typeof surface.target.name === "string" &&
85 (surface.target.platform === "ios" || surface.target.platform === "android")))
86 );
87 - case "side-chat":
88 - return typeof surface.threadId === "string" && surface.id === `side-chat:${surface.threadId}`;
87 + case "thread":
88 + return typeof surface.threadId === "string" && surface.id === `thread:${surface.threadId}`;
89 case "linked-thread":
90 return (
91 (surface.title === null || typeof surface.title === "string") &&
@@ -116,6 +116,13 @@ const isClosedViewEntry = (entry: unknown): entry is ClosedViewEntry => {
116 }
117 };
118
119 +/** A closed side chat tab saved before its surface became `thread`. */
120 +const renamedSideChatTab = (entry: unknown): unknown => {
121 + const view = entry as { kind?: unknown; surface?: { kind?: unknown } | null } | null;
122 + if (view?.kind !== "panel-tab" || view.surface?.kind !== "side-chat") return entry;
123 + return { ...view, surface: decodeThreadSurface(view.surface) };
124 +};
125 +
126 export const useClosedViewStore = create<ClosedViewStoreState>()(
127 persist(
128 (set) => ({
@@ -145,13 +152,13 @@ export const useClosedViewStore = create<ClosedViewStoreState>()(
152 storage: createJSONStorage(() =>
153 resolveStorage(typeof window !== "undefined" ? window.localStorage : undefined),
154 ),
148 - version: 2,
155 + version: 3,
156 migrate: (persisted) => {
157 const entries = (persisted as Partial<Pick<ClosedViewStoreState, "entries">> | null)
158 ?.entries;
159 return {
160 entries: Array.isArray(entries)
154 - ? entries.filter(isClosedViewEntry).filter(isPersistentView)
161 + ? entries.map(renamedSideChatTab).filter(isClosedViewEntry).filter(isPersistentView)
162 : [],
163 };
164 },
apps/web/src/components/ChatView.browser.test.tsx
+38 -2
@@ -774,8 +774,8 @@ it("selecting a side-chat tab focuses that side chat's composer", async () => {
774 onboardingCompletedAt: "2026-01-01T00:00:00.000Z",
775 });
776 const parentRef = scopeThreadRef(ENVIRONMENT_ID, parent.id);
777 - useRightPanelStore.getState().openSideChat(parentRef, otherSide.id);
778 - useRightPanelStore.getState().openSideChat(parentRef, side.id);
777 + useRightPanelStore.getState().openThread(parentRef, otherSide.id);
778 + useRightPanelStore.getState().openThread(parentRef, side.id);
779 const router = getRouter(
780 createMemoryHistory({ initialEntries: [`/${ENVIRONMENT_ID}/${parent.id}`] }),
781 );
@@ -805,6 +805,42 @@ it("selecting a side-chat tab focuses that side chat's composer", async () => {
805 await expect.element(mainEditor).toHaveTextContent("main draft");
806 });
807
808 +it("a subagent tab shows its read-only bar under no header of its own", async () => {
809 + const parent = threadWithHistory("subagent-parent", 1);
810 + const subagent = {
811 + ...threadWithHistory("subagent-child", 1),
812 + providerSubagentOf: parent.id,
813 + olderSettled: true as const,
814 + };
815 + await page.viewport(1400, 900);
816 + using _environment = installFakeEnvironment([parent, subagent]);
817 + __setClientSettingsForTests({
818 + ...DEFAULT_CLIENT_SETTINGS,
819 + onboardingCompletedAt: "2026-01-01T00:00:00.000Z",
820 + });
821 + const parentRef = scopeThreadRef(ENVIRONMENT_ID, parent.id);
822 + useRightPanelStore.getState().openThread(parentRef, subagent.id);
823 + const router = getRouter(
824 + createMemoryHistory({ initialEntries: [`/${ENVIRONMENT_ID}/${parent.id}`] }),
825 + );
826 + await router.load();
827 + await using screen = await render(<AppRoot router={router} />, {
828 + // AppRoot brings its own router.
829 + router: false,
830 + });
831 + const pane = screen.getByTestId("side-thread-pane");
832 + // No header of its own: the tab names it, and only a side chat has actions to put in one.
833 + await expect.element(pane.getByRole("heading", { name: subagent.title })).not.toBeInTheDocument();
834 + await expect.element(pane.getByText("Runs on its own")).toBeVisible();
835 + await expect.element(pane.getByRole("button", { name: "Add to chat" })).not.toBeInTheDocument();
836 + await expect
837 + .element(screen.getByRole("textbox", { name: `Message ${subagent.title}`, exact: true }))
838 + .not.toBeInTheDocument();
839 + await expect
840 + .element(screen.getByRole("textbox", { name: `Message ${parent.title}`, exact: true }))
841 + .toBeVisible();
842 +});
843 +
844 it("/side sends the draft's attachments and context, and keeps them when it does not start", async () => {
845 await page.viewport(1400, 900);
846 const thread = threadWithHistory("side-attachments", 1);
apps/web/src/components/ChatView.tsx
+21 -4
@@ -72,7 +72,6 @@ import {
72 type AssistantCitation,
73 type ResponseContextRecord,
74 type ChatFileAttachment,
75 - isProviderNativeSubagentThread,
75 type EnvironmentId,
76 type MessageId,
77 type ModelSelection,
@@ -309,6 +308,8 @@ import { getTriggerDisplayModelName } from "./chat/providerIconUtils";
308 import { resolveScrollToEndClearance } from "./composerFooterLayout";
309 import { ChatHeader } from "./chat/ChatHeader";
310 import { useSideChat } from "./chat/useSideChat";
311 +import { sideThreadComposer, sideThreadKindOf } from "@t3tools/client-runtime/side-thread";
312 +import { useOpenSurfaceInMainView } from "../hooks/useOpenSurfaceInMainView";
313 import { useRemoteOpenState } from "~/remoteOpen";
314 import { shouldShowOpenInPicker } from "./chat/OpenInPicker.logic";
315 import { useOpenFavoriteEditorShortcut } from "./chat/OpenInPickerShortcut";
@@ -460,6 +461,7 @@ export default function ChatView(props: ChatViewProps) {
461 embedded: parentPanel,
462 } = props;
463 const embedded = parentPanel !== undefined;
464 + const panelHostShell = useQuietThreadShell(parentPanel?.hostRef ?? null);
465 const canOperateThread = useEnvironmentScope(environmentId, AuthOrchestrationOperateScope);
466 const canOperateTerminal = useEnvironmentScope(environmentId, AuthTerminalOperateScope);
467 const draftId = routeKind === "draft" ? props.draftId : null;
@@ -858,8 +860,9 @@ export default function ChatView(props: ChatViewProps) {
860 serverProjection === null ? null : deriveRunlessWorkStartedAt(serverProjection);
861 const providerSubagentStatus =
862 serverProjection === null ? null : deriveProviderSubagentStatus(serverProjection);
863 + const sideThreadKind = serverThread === null ? null : sideThreadKindOf(serverThread.source);
864 const isProviderSubagent =
862 - serverThread !== null && isProviderNativeSubagentThread(serverThread.source);
865 + sideThreadKind !== null && sideThreadComposer(sideThreadKind) === "read-only";
866 const supportsProviderSwitchingViaHandoff = threadSupportsProviderHandoff(serverProjection);
867 const activeLatestRun = isServerThread ? serverLatestRun : (activeThread?.latestRun ?? null);
868 const activeActivityRun = isServerThread ? serverActivityRun : (activeThread?.latestRun ?? null);
@@ -942,8 +945,16 @@ export default function ChatView(props: ChatViewProps) {
945 };
946 }
947 if (parentSubagentThreadRef !== null) {
948 + const title = parentSubagentThread?.title ?? gt("Parent thread");
949 + // Embedded in its parent's panel, the parent is the view around it.
950 + if (
951 + parentPanel !== undefined &&
952 + scopedThreadKey(parentPanel.hostRef) === scopedThreadKey(parentSubagentThreadRef)
953 + ) {
954 + return { title };
955 + }
956 return {
946 - title: parentSubagentThread?.title ?? gt("Parent thread"),
957 + title,
958 open: (): void => {
959 void navigate({
960 to: "/$environmentId/$threadId",
@@ -2888,6 +2899,9 @@ export default function ChatView(props: ChatViewProps) {
2899 if (activeThread) setThreadError(activeThread.id, message);
2900 },
2901 });
2902 + // An embedded thread's commands run in its host's terminal, which is the host's checkout.
2903 + const runsOutsideHostCheckout =
2904 + embedded && (activeThread?.worktreePath ?? null) !== (panelHostShell?.worktreePath ?? null);
2905 // A maximized panel covers the terminal drawer the command runs in.
2906 const runSideChatShellCommandStable = useStableCallback((command: string) => {
2907 if (activeThreadRef) useRightPanelStore.getState().setMaximized(activeThreadRef, false);
@@ -2913,6 +2927,7 @@ export default function ChatView(props: ChatViewProps) {
2927 ? gt("Available once the thread's worktree is set up.")
2928 : null;
2929 const openSideChatStable = useStableCallback(() => void sideChat.open());
2930 + const openSurfaceInMainView = useOpenSurfaceInMainView(activeThreadRef);
2931 const sendSideChatStable = useStableCallback(sideChat.open);
2932 const { onConfirmRevertStable, onForkFromRunStable, onRevertTimelineTurnStable } =
2933 useTimelineRewind({
@@ -3290,6 +3305,7 @@ export default function ChatView(props: ChatViewProps) {
3305 );
3306 // Above the early return, where React Compiler can cache it for the side chat pane.
3307 const sideChatParentPanel = {
3308 + hostRef: scopeThreadRef(environmentId, threadId),
3309 openToolDiff: onOpenToolDiffStable,
3310 runShellCommand: runSideChatShellCommandStable,
3311 };
@@ -3516,7 +3532,7 @@ export default function ChatView(props: ChatViewProps) {
3532 citationHistory={citationHistory}
3533 onCiteAssistantText={citeAssistantTextStable}
3534 onReplyToResponse={replyToResponseStable}
3519 - {...(activeProject
3535 + {...(activeProject && !runsOutsideHostCheckout
3536 ? { onRunShellCommand: parentPanel?.runShellCommand ?? runShellCommandStable }
3537 : {})}
3538 isWorking={isWorking}
@@ -4091,6 +4107,7 @@ export default function ChatView(props: ChatViewProps) {
4107 terminalLabelsById={activeTerminalLabelsById}
4108 onActivate={activateRightPanelSurfaceStable}
4109 onCloseSurface={closeRightPanelSurfaceStable}
4110 + onOpenInMainView={openSurfaceInMainView}
4111 onRenameDevice={(surfaceId, title) => {
4112 if (activeThreadRef)
4113 useRightPanelStore.getState().renameDevice(activeThreadRef, surfaceId, title);
apps/web/src/components/ReopenClosedViewShortcut.tsx
+6 -2
@@ -33,6 +33,7 @@ import {
33 selectThreadRightPanelState,
34 useRightPanelStore,
35 } from "../rightPanelStore";
36 +import { serverEnvironment } from "../state/server";
37 import { appAtomRegistry } from "../rpc/atomRegistry";
38 import { readProject, readThreadShell } from "../state/entities";
39 import { previewEnvironment } from "../state/preview";
@@ -117,8 +118,11 @@ export function ReopenClosedViewShortcut() {
118 ownerExists: readThreadShell(ref) !== null || drafts.getDraftThreadByRef(ref) !== null,
119 sideChatExists:
120 entry.kind !== "panel-tab" ||
120 - entry.surface.kind !== "side-chat" ||
121 - readThreadShell(scopeThreadRef(ref.environmentId, entry.surface.threadId)) !== null,
121 + entry.surface.kind !== "thread" ||
122 + readThreadShell(scopeThreadRef(ref.environmentId, entry.surface.threadId)) !== null ||
123 + // The shell leaves idle subagents out, so one it does not list may still exist.
124 + appAtomRegistry.get(serverEnvironment.configValueAtom(ref.environmentId))
125 + ?.shellThreadFamilies === true,
126 shellLive:
127 appAtomRegistry.get(environmentShell.stateValueAtom(ref.environmentId)).status === "live",
128 panel,
apps/web/src/components/RightPanelTabs.tsx
+32 -11
@@ -27,6 +27,7 @@ import type {
27 ThreadId,
28 } from "@t3tools/contracts";
29 import { getTerminalLabel } from "@t3tools/shared/terminalLabelsCopy";
30 +import { formatSubagentDisplayTitle } from "@t3tools/client-runtime/state/subagent-display";
31 import {
32 closestCenter,
33 DndContext,
@@ -39,6 +40,7 @@ import { restrictToFirstScrollableAncestor, restrictToHorizontalAxis } from "@dn
40 import { horizontalListSortingStrategy, SortableContext, useSortable } from "@dnd-kit/sortable";
41 import { CSS } from "@dnd-kit/utilities";
42 import {
43 + Bot,
44 CircleDotIcon,
45 Smartphone,
46 ChevronDown,
@@ -136,6 +138,10 @@ export interface RightPanelTabsProps {
138 onActivate: (surface: RightPanelSurface) => void;
139 onRenameDevice?: (surfaceId: string, title: string) => void;
140 onCloseSurface: (surface: RightPanelSurface) => void;
141 + /** Moves a subagent, side chat or linked thread tab to the main screen. */
142 + onOpenInMainView?: (
143 + surface: Extract<RightPanelSurface, { kind: "thread" | "linked-thread" }>,
144 + ) => void;
145 onCloseOtherSurfaces: (surface: RightPanelSurface) => void;
146 onCloseSurfacesToRight: (surface: RightPanelSurface) => void;
147 onCloseAllSurfaces: () => void;
@@ -217,6 +223,7 @@ const SURFACE_UNAVAILABLE_HINTS = {
223 } as const;
224
225 type TabContextMenuAction =
226 + | "open-in-main-view"
227 | "rename"
228 | "copy-path"
229 | "toggle-mute"
@@ -613,8 +620,9 @@ function surfaceTitle(
620 return /^\d+$/.test(surface.key) ? `#${surface.key}` : surface.key;
621 case "device":
622 return surface.title ?? surface.target?.name ?? resolve(msg("Device"));
616 - case "side-chat":
617 - return resolve(msg("Side chat"));
623 + case "thread":
624 + // Until the thread's own title loads.
625 + return resolve(msg("Thread"));
626 case "linked-thread":
627 return linkedThreadTitle(
628 surface,
@@ -710,7 +718,7 @@ function SurfaceIcon({
718 return <PullRequestGlyph.link className="size-3 shrink-0" />;
719 case "issue":
720 return <IssueSurfaceIcon surface={surface} environmentId={environmentId} />;
713 - case "side-chat":
721 + case "thread":
722 return <SideChatTabIcon environmentId={environmentId} threadId={surface.threadId} />;
723 case "linked-thread":
724 return <MessagesSquare className="size-3 shrink-0" />;
@@ -743,16 +751,16 @@ function sideChatTabState(shell: EnvironmentThreadShell | null) {
751 return threadRuntimeIsActive(shell.runtime) ? "running" : null;
752 }
753
746 -// Static dots: a side chat tab can stay open for a whole run.
754 +// Static dots: a side chat or subagent tab can stay open for a whole run.
755 function SideChatTabIcon(props: { environmentId: EnvironmentId | null; threadId: ThreadId }) {
748 - const state = sideChatTabState(
749 - useQuietThreadShell(
750 - props.environmentId === null ? null : scopeThreadRef(props.environmentId, props.threadId),
751 - ),
756 + const shell = useQuietThreadShell(
757 + props.environmentId === null ? null : scopeThreadRef(props.environmentId, props.threadId),
758 );
759 + const state = sideChatTabState(shell);
760 + const Icon = shell !== null && shell.lineage.sideChat !== true ? Bot : MessagesSquare;
761 return (
762 <>
755 - <MessagesSquare className="size-3 shrink-0" />
763 + <Icon className="size-3 shrink-0" />
764 {state === null ? null : (
765 <span
766 className={cn(
@@ -969,11 +977,16 @@ function RightPanelTab(
977 disabled: props.dragDisabled,
978 });
979 const sideChatShell = useQuietThreadShell(
972 - surface.kind === "side-chat" && props.environmentId !== null
980 + surface.kind === "thread" && props.environmentId !== null
981 ? scopeThreadRef(props.environmentId, surface.threadId)
982 : null,
983 );
976 - const title = sideChatShell?.title ?? props.title;
984 + const title =
985 + sideChatShell === null
986 + ? props.title
987 + : sideChatShell.lineage.sideChat === true
988 + ? sideChatShell.title
989 + : formatSubagentDisplayTitle(sideChatShell.title);
990 const sideChatState = sideChatTabState(sideChatShell);
991 const content = (
992 <>
@@ -1279,6 +1292,9 @@ export function RightPanelTabs(props: RightPanelTabsProps) {
1292 if (surfaceIndex < 0) return;
1293
1294 const items: ContextMenuItem<TabContextMenuAction>[] = [];
1295 + if ((surface.kind === "thread" || surface.kind === "linked-thread") && props.onOpenInMainView) {
1296 + items.push({ id: "open-in-main-view", label: gt("Open in main view") });
1297 + }
1298 if (surface.kind === "device" && props.onRenameDevice)
1299 items.push({ id: "rename", label: gt("Rename") });
1300 if (surface.kind === "file" && surface.attachment === undefined) {
@@ -1320,6 +1336,11 @@ export function RightPanelTabs(props: RightPanelTabsProps) {
1336
1337 const action = await api.contextMenu.show(items, { x: event.clientX, y: event.clientY });
1338 switch (action) {
1339 + case "open-in-main-view":
1340 + if (surface.kind === "thread" || surface.kind === "linked-thread") {
1341 + props.onOpenInMainView?.(surface);
1342 + }
1343 + break;
1344 case "rename":
1345 setRenamingDevice(surface.id);
1346 break;
apps/web/src/components/ThreadRouteView.tsx
+1 -1
@@ -31,7 +31,7 @@ import {
31 * Keeps the family of an open thread the shell leaves out (an older settled thread) in the shell
32 * rows until the route leaves it, so every reader of its shell row finds it.
33 */
34 -function useOpenThreadFamily(threadRef: ScopedThreadRef | null, missing: boolean) {
34 +export function useOpenThreadFamily(threadRef: ScopedThreadRef | null, missing: boolean) {
35 const key = threadRef === null ? null : scopedThreadKey(threadRef);
36 // Sticks to the route thread, so the row the family brings in does not release it.
37 const [mountedKey, setMountedKey] = useState<string | null>(null);
apps/web/src/components/chat/LinkedThreadPage.tsx new
+65
@@ -0,0 +1,65 @@
1 +import { scopeThreadRef } from "@t3tools/client-runtime/environment";
2 +import type { EnvironmentId, ThreadId } from "@t3tools/contracts";
3 +import { Navigate } from "@tanstack/react-router";
4 +import { useGT } from "gt-react";
5 +
6 +import { isElectron } from "~/env";
7 +import { linkedThreadSurface } from "../../linkedThreadSurface";
8 +import { useEnvironment } from "../../state/environments";
9 +import { useLinkedEnvironments } from "../../state/peerLinks";
10 +import { buildThreadRouteParams } from "../../threadRoutes";
11 +import { SidebarInset } from "../ui/sidebar";
12 +import { WorkspaceBreadcrumb, WorkspaceBreadcrumbItem } from "../WorkspaceBreadcrumb";
13 +import { WorkspacePageHeader } from "../WorkspacePageHeader";
14 +import { LinkedThread } from "./LinkedThreadPane";
15 +
16 +/**
17 + * A linked environment's thread on the main screen, read through `viaEnvironmentId`. Once this
18 + * client is connected to the thread's own environment, the thread opens there instead.
19 + */
20 +export function LinkedThreadPage(props: {
21 + readonly viaEnvironmentId: EnvironmentId;
22 + readonly environmentId: EnvironmentId;
23 + readonly threadId: ThreadId;
24 +}) {
25 + const { viaEnvironmentId, environmentId, threadId } = props;
26 + const gt = useGT();
27 + const own = useEnvironment(environmentId);
28 + const connected = own?.connection.phase === "connected";
29 + const linkedLabel = useLinkedEnvironments(connected ? null : viaEnvironmentId).get(environmentId);
30 + if (connected) {
31 + return (
32 + <Navigate
33 + to="/$environmentId/$threadId"
34 + params={buildThreadRouteParams(scopeThreadRef(environmentId, threadId))}
35 + replace
36 + />
37 + );
38 + }
39 + const surface = linkedThreadSurface({
40 + viaEnvironmentId,
41 + environmentId,
42 + threadId,
43 + label: own?.label ?? linkedLabel ?? gt("a linked environment"),
44 + title: null,
45 + });
46 + return (
47 + <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none">
48 + <LinkedThread
49 + key={surface.id}
50 + panelRef={null}
51 + surface={surface}
52 + visible
53 + renderHeader={(title) => (
54 + <WorkspacePageHeader electron={isElectron} className="relative bg-background">
55 + <WorkspaceBreadcrumb ariaLabel={gt("Thread breadcrumb")}>
56 + <WorkspaceBreadcrumbItem current>
57 + <h1 className="truncate">{title}</h1>
58 + </WorkspaceBreadcrumbItem>
59 + </WorkspaceBreadcrumb>
60 + </WorkspacePageHeader>
61 + )}
62 + />
63 + </SidebarInset>
64 + );
65 +}
apps/web/src/components/chat/LinkedThreadPane.tsx
+54 -33
@@ -42,7 +42,7 @@ function LinkedThreadComposer(props: {
42 const { label, via } = props;
43 const gt = useGT();
44 return (
45 - <div className="flex shrink-0 flex-col gap-1 px-3 pb-3">
45 + <div className="chat-composer-lane flex shrink-0 flex-col gap-1 pt-1.5 pb-4 sm:pt-2 sm:pb-5">
46 {props.notice ? <ComposerBannerStack items={[props.notice]} detached /> : null}
47 <ComposerSurface.Shell>
48 <ComposerSurface.Host>
@@ -76,12 +76,14 @@ const ignore = () => {};
76 * and drawn by the timeline every thread uses. The client never connects to the linked one, so
77 * the view only reads: what would need that connection is absent. Key it by its surface id.
78 */
79 -export function LinkedThreadPane(props: {
80 - /** The thread whose panel shows the tab. */
81 - readonly panelRef: ScopedThreadRef;
79 +export function LinkedThread(props: {
80 + /** The thread whose panel shows it as a tab, or null on the main screen. */
81 + readonly panelRef: ScopedThreadRef | null;
82 readonly surface: LinkedThreadSurface;
83 - /** Whether the tab is showing; the stream runs only while it is. */
83 + /** Whether it is showing; the stream runs only while it is. */
84 readonly visible: boolean;
85 + /** What sits above the timeline on the main screen; a tab already names the thread. */
86 + readonly renderHeader?: (title: string) => ReactNode;
87 }) {
88 const { surface, panelRef } = props;
89 const gt = useGT();
@@ -173,30 +175,36 @@ export function LinkedThreadPane(props: {
175 onLoadEarlier: view.loadEarlier,
176 };
177 return (
176 - <div className="flex h-full min-h-0 flex-col">
177 - <h2 className="shrink-0 truncate border-b border-border px-3 py-2 text-sm font-medium">
178 - {linkedThreadTitle(
178 + // `data-chat-canvas` gives the timeline the side gutters it has in a thread's own chat.
179 + <div
180 + data-chat-canvas
181 + className="flex h-full min-h-0 flex-col [--chat-lane-inset-end:0px] [--chat-lane-inset-start:0px] [--chat-timeline-gutter:0px]"
182 + >
183 + {props.renderHeader?.(
184 + linkedThreadTitle(
185 { title: projection?.thread.title || surface.title },
186 gt("Thread on {label}", { label }),
181 - )}
182 - </h2>
187 + ),
188 + )}
189 {projection === null ? (
190 <>
185 - <div className="min-h-0 flex-1 overflow-y-auto p-3">
186 - {failure === null ? (
187 - <div className="flex items-center gap-2 text-sm text-muted-foreground">
188 - <Spinner size="sm" />
189 - <T>
190 - Reading from <Var>{label}</Var>…
191 - </T>
192 - </div>
193 - ) : (
194 - <Alert variant="error">
195 - <AlertTitle>{failure.title}</AlertTitle>
196 - <AlertDescription>{failure.detail}</AlertDescription>
197 - {retryAction}
198 - </Alert>
199 - )}
191 + <div className="chat-composer-lane min-h-0 flex-1 overflow-y-auto py-3">
192 + <div className="chat-content-lane">
193 + {failure === null ? (
194 + <div className="flex items-center gap-2 text-sm text-muted-foreground">
195 + <Spinner size="sm" />
196 + <T>
197 + Reading from <Var>{label}</Var>…
198 + </T>
199 + </div>
200 + ) : (
201 + <Alert variant="error">
202 + <AlertTitle>{failure.title}</AlertTitle>
203 + <AlertDescription>{failure.detail}</AlertDescription>
204 + {retryAction}
205 + </Alert>
206 + )}
207 + </div>
208 </div>
209 <LinkedThreadComposer
210 label={label}
@@ -221,14 +229,16 @@ export function LinkedThreadPane(props: {
229 {() => (
230 <>
231 {failure === null ? null : (
224 - <div className="shrink-0 px-3 pb-2">
225 - <Alert variant="warning">
226 - <AlertTitle>{failure.title}</AlertTitle>
227 - <AlertDescription>
228 - {failure.detail} <T>Showing what was read before.</T>
229 - </AlertDescription>
230 - {retryAction}
231 - </Alert>
232 + <div className="chat-composer-lane shrink-0 pb-2">
233 + <div className="chat-content-lane">
234 + <Alert variant="warning">
235 + <AlertTitle>{failure.title}</AlertTitle>
236 + <AlertDescription>
237 + {failure.detail} <T>Showing what was read before.</T>
238 + </AlertDescription>
239 + {retryAction}
240 + </Alert>
241 + </div>
242 </div>
243 )}
244 <LinkedThreadComposer
@@ -245,3 +255,14 @@ export function LinkedThreadPane(props: {
255 </div>
256 );
257 }
258 +
259 +/** A linked environment's thread as a right panel tab. Key it by its surface id. */
260 +export function LinkedThreadPane(props: {
261 + /** The thread whose panel shows the tab. */
262 + readonly panelRef: ScopedThreadRef;
263 + readonly surface: LinkedThreadSurface;
264 + /** Whether the tab is showing. */
265 + readonly visible: boolean;
266 +}) {
267 + return <LinkedThread panelRef={props.panelRef} surface={props.surface} visible={props.visible} />;
268 +}
apps/web/src/components/chat/MarkdownThreadLink.browser.test.tsx
+10
@@ -6,6 +6,7 @@ import { AsyncResult, Atom, AtomRegistry } from "effect/reactivity";
6 import { expect, it, vi } from "vite-plus/test";
7
8 import { act, render } from "../../../test/render";
9 +import { isMacPlatform } from "../../lib/utils";
10 import { linkedThreadSurface } from "../../linkedThreadSurface";
11 import { selectThreadRightPanelState, useRightPanelStore } from "../../rightPanelStore";
12 import { MarkdownThreadLink } from "./MarkdownThreadLink";
@@ -35,6 +36,9 @@ vi.mock(import("../../state/entities"), () => ({
36 ref?.projectId === "essay-project" ? ({ title: "Essays" } as never) : null,
37 }));
38 vi.mock(import("../../state/environments"), () => ({
39 + // The click rule reads the client setting, whose module asks for these.
40 + useEnvironments: (() => []) as never,
41 + usePrimaryEnvironment: (() => null) as never,
42 useEnvironmentIdentities: () => [
43 { environmentId: EnvironmentId.make("environment"), label: "Here" },
44 { environmentId: EnvironmentId.make("remote"), label: "Remote" },
@@ -211,6 +215,12 @@ it.for([
215 await chip.click();
216 expect(panel().surfaces).toHaveLength(1);
217 expect(screen.router?.state.location.pathname).toBe("/");
218 + // The modifier reads it on the main screen instead, through the same environment.
219 + await chip.click({ modifiers: [isMacPlatform(navigator.platform) ? "Meta" : "Control"] });
220 + await vi.waitFor(() =>
221 + expect(screen.router?.state.location.pathname).toBe(`/linked/environment/${linkedId}/there`),
222 + );
223 + expect(panel().surfaces).toHaveLength(1);
224 });
225
226 it("reads through the link when a disconnected machine's thread is only cached here", async () => {
apps/web/src/components/chat/MarkdownThreadLink.tsx
+24 -14
@@ -1,4 +1,5 @@
1 import type { EnvironmentId, ScopedThreadRef } from "@t3tools/contracts";
2 +import { useNavigate } from "@tanstack/react-router";
3 import { useGT, useMessages } from "gt-react";
4 import { MessagesSquareIcon } from "lucide-react";
5 import {
@@ -13,7 +14,8 @@ import { resolveLinkedThreadOpen } from "@t3tools/client-runtime/linked-thread";
14 import { configuredHostedAppUrl } from "../../hostedPairing";
15 import { useThreadRefs, useThreadShell } from "../../state/entities";
16 import { useConnectedEnvironmentIds, useEnvironmentIdentities } from "../../state/environments";
16 -import { useRightPanelStore } from "../../rightPanelStore";
17 +import { useSideThreadTrigger } from "../../hooks/useSideThreadTrigger";
18 +import { openLinkedThreadRead } from "../../lib/sideChatPane";
19 import { useLinkedEnvironments } from "../../state/peerLinks";
20 import { orchestrationEnvironment } from "../../state/orchestration";
21 import { useEnvironmentQuery } from "../../state/query";
@@ -25,14 +27,16 @@ import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
27 /** `label` is the link's written text; an autolink has none. */
28 export function MarkdownThreadLink(props: {
29 readonly environmentId: EnvironmentId;
28 - /** The thread the link is written in; a linked environment's thread opens in its right panel. */
30 + /** The thread the link is written in; a linked environment's thread can open in its right panel. */
31 readonly threadRef?: ScopedThreadRef | undefined;
32 readonly link: ThreadLink;
33 readonly label: string | null;
34 }) {
35 const gt = useGT();
36 const messages = useMessages();
35 - const panelRef = props.threadRef;
37 + const navigate = useNavigate();
38 + const trigger = useSideThreadTrigger();
39 + const panelRef = props.threadRef ?? null;
40 const candidates = threadLinkCandidates(props.link, props.environmentId);
41 const writtenRef = candidates[0]!;
42 const written = useThreadShell(writtenRef);
@@ -44,10 +48,8 @@ export function MarkdownThreadLink(props: {
48 const linkedLabel = useLinkedEnvironments(
49 connected || writtenRef.environmentId === props.environmentId ? null : props.environmentId,
50 ).get(writtenRef.environmentId);
47 - // A shell cached from an earlier connection does not make the thread open there now. Outside a
48 - // thread there is no panel to read it in, so the link behaves as it does without one.
51 + // A shell cached from an earlier connection does not make the thread open there now.
52 const linked =
50 - panelRef !== undefined &&
53 resolveLinkedThreadOpen({
54 environmentId: writtenRef.environmentId,
55 viaEnvironmentId: props.environmentId,
@@ -94,14 +96,22 @@ export function MarkdownThreadLink(props: {
96 render={
97 <button
98 type="button"
97 - onClick={() =>
98 - useRightPanelStore.getState().openLinkedThread(panelRef, {
99 - viaEnvironmentId: props.environmentId,
100 - ...writtenRef,
101 - label: linkedLabel,
102 - title: knownTitle,
103 - })
104 - }
99 + {...trigger(
100 + (intent) =>
101 + openLinkedThreadRead({
102 + panelRef,
103 + target: {
104 + viaEnvironmentId: props.environmentId,
105 + ...writtenRef,
106 + label: linkedLabel,
107 + title: knownTitle,
108 + },
109 + intent,
110 + navigate,
111 + }),
112 + // Outside a thread there is no panel to read it in.
113 + { panel: panelRef !== null },
114 + )}
115 />
116 }
117 aria-label={gt("Thread, {title}", { title })}
apps/web/src/components/chat/MessagesTimeline.browser.test.tsx
+2 -1
@@ -447,7 +447,8 @@ describe("MessagesTimeline work rows", () => {
447 expect(screen.text()).toContain("Follow-up explanation");
448 expect(screen.text()).not.toContain("Old interrupted progress");
449 await click(screen.buttons("Open Simplify delivery")[0]!);
450 - expect(onOpenThread).toHaveBeenCalledWith(childThreadId);
450 + // A subagent's card says how it was clicked, so it opens beside the thread or in its place.
451 + expect(onOpenThread).toHaveBeenCalledWith(childThreadId, undefined, "primary");
452 } else if (source === "legacy") {
453 expect(screen.text()).toContain("Old interrupted progress");
454 } else {
apps/web/src/components/chat/MessagesTimeline.tsx
+3
@@ -1,4 +1,5 @@
1 import { T, useGT, useMessages, Var } from "gt-react";
2 +import type { SideThreadOpenIntent } from "@t3tools/client-runtime/side-thread";
3 import { threadErrorText } from "@t3tools/client-runtime/state/threads";
4 import { threadEnvironment } from "../../state/threads";
5 import { useAtomCommand } from "../../state/use-atom-command";
@@ -271,6 +272,8 @@ interface MessagesTimelineProps {
272 onOpenThread: (
273 threadId: OrchestrationV2TurnItem["threadId"],
274 environmentId?: EnvironmentId,
275 + /** How the click asked to open a subagent or side chat; a plain click when absent. */
276 + intent?: SideThreadOpenIntent,
277 ) => void;
278 renderHtmlRender?: TimelineRowSharedState["renderHtmlRender"];
279 turnItemSource?: TimelineRowSharedState["turnItemSource"];
apps/web/src/components/chat/ReadOnlyThreadTimeline.tsx
+39 -36
@@ -13,6 +13,7 @@ import {
13 import { useRef, useState, type ReactNode } from "react";
14
15 import { useIncrementalTimelineEntries } from "~/hooks/useIncrementalTimelineEntries";
16 +import { SideThreadsOpenContext } from "~/hooks/useSideThreadTrigger";
17 import { useTheme } from "~/hooks/useTheme";
18 import { deriveActiveWorkStartedAt, derivePhase } from "~/session-logic";
19 import type { ChatFileAttachment } from "~/types";
@@ -93,42 +94,44 @@ export function ReadOnlyThreadTimeline(props: {
94 return (
95 <>
96 <div className="relative min-h-0 flex-1">
96 - <MessagesTimeline
97 - listRef={listRef}
98 - timelineEntries={entries}
99 - isWorking={isWorking}
100 - activeTurnStartedAt={workStartedAt}
101 - latestRun={activityRun}
102 - runningRunId={runningRunId}
103 - turnDiffSummaries={NO_TURN_DIFFS}
104 - runs={projection.runs}
105 - routeThreadKey={threadKey}
106 - onOpenThread={ignore}
107 - supportsConversationRollback={false}
108 - onRevertToTurnCount={ignore}
109 - isRevertingCheckpoint={false}
110 - onImageExpand={props.onImageExpand}
111 - onFileOpen={props.onFileOpen}
112 - onFileDownload={props.onFileOpen}
113 - renderHtmlRender={props.renderHtmlRender}
114 - turnItemSource={props.turnItemSource}
115 - historyControls={props.historyControls}
116 - activeThreadEnvironmentId={NO_ENVIRONMENT_ID}
117 - markdownCwd={undefined}
118 - resolvedTheme={resolvedTheme}
119 - timestampFormat="locale"
120 - workspaceRoot={undefined}
121 - anchorMessageId={null}
122 - onAnchorReady={ignore}
123 - onAnchorSizeChanged={ignore}
124 - contentInsetEndAdjustment={0}
125 - emptyPlaceholderInset={0}
126 - liveFollowEnabled={follow.timelineLiveFollowEnabled}
127 - onIsAtEndChange={follow.onIsAtEndChangeStable}
128 - onViewportAttach={follow.attachTimelineViewport}
129 - onFooterGrow={follow.onTimelineFooterGrowStable}
130 - footer={props.renderFooter?.(items) ?? null}
131 - />
97 + <SideThreadsOpenContext value={false}>
98 + <MessagesTimeline
99 + listRef={listRef}
100 + timelineEntries={entries}
101 + isWorking={isWorking}
102 + activeTurnStartedAt={workStartedAt}
103 + latestRun={activityRun}
104 + runningRunId={runningRunId}
105 + turnDiffSummaries={NO_TURN_DIFFS}
106 + runs={projection.runs}
107 + routeThreadKey={threadKey}
108 + onOpenThread={ignore}
109 + supportsConversationRollback={false}
110 + onRevertToTurnCount={ignore}
111 + isRevertingCheckpoint={false}
112 + onImageExpand={props.onImageExpand}
113 + onFileOpen={props.onFileOpen}
114 + onFileDownload={props.onFileOpen}
115 + renderHtmlRender={props.renderHtmlRender}
116 + turnItemSource={props.turnItemSource}
117 + historyControls={props.historyControls}
118 + activeThreadEnvironmentId={NO_ENVIRONMENT_ID}
119 + markdownCwd={undefined}
120 + resolvedTheme={resolvedTheme}
121 + timestampFormat="locale"
122 + workspaceRoot={undefined}
123 + anchorMessageId={null}
124 + onAnchorReady={ignore}
125 + onAnchorSizeChanged={ignore}
126 + contentInsetEndAdjustment={0}
127 + emptyPlaceholderInset={0}
128 + liveFollowEnabled={follow.timelineLiveFollowEnabled}
129 + onIsAtEndChange={follow.onIsAtEndChangeStable}
130 + onViewportAttach={follow.attachTimelineViewport}
131 + onFooterGrow={follow.onTimelineFooterGrowStable}
132 + footer={props.renderFooter?.(items) ?? null}
133 + />
134 + </SideThreadsOpenContext>
135 {follow.showScrollToBottom ? (
136 <ScrollToEndButton
137 summary={null}
apps/web/src/components/chat/RightPanelSurfaceContent.tsx
+4 -4
@@ -13,7 +13,7 @@ import type {
13 import { scopedThreadKey } from "@t3tools/client-runtime/environment";
14 import { lazy, Suspense } from "react";
15 import { LinkedThreadPane } from "./LinkedThreadPane";
16 -import SideChatPane from "./SideChatPane";
16 +import SideThreadPane from "./SideThreadPane";
17 import type { ComposerImageAttachment, DraftId } from "../../composerDraftStore";
18 import type { ShortcutMatchContext } from "../../keybindings";
19 import type { SideChatParentPanel } from "../../lib/sideChatPane";
@@ -213,13 +213,13 @@ export function RightPanelSurfaceContent(props: {
213 );
214 case "pull-requests":
215 return <ThreadPullRequestsPanel threadRef={threadRef} />;
216 - case "side-chat":
216 + case "thread":
217 // Not lazy: revealing a suspended tiptap editor tears down its view and crashes the composer.
218 return (
219 - <SideChatPane
219 + <SideThreadPane
220 key={surface.id}
221 parentRef={threadRef}
222 - threadId={surface.threadId}
222 + surface={surface}
223 parentPanel={props.sideChatParentPanel}
224 onClose={() => onCloseSurface(surface)}
225 />
apps/web/src/components/chat/SideChatPane.tsx deleted
-166
@@ -1,166 +0,0 @@
1 -import { scopeThreadRef } from "@t3tools/client-runtime/environment";
2 -import {
3 - isAtomCommandInterrupted,
4 - settlePromise,
5 - squashAtomCommandFailure,
6 -} from "@t3tools/client-runtime/state/runtime";
7 -import {
8 - AuthOrchestrationOperateScope,
9 - type ScopedThreadRef,
10 - type ThreadId,
11 -} from "@t3tools/contracts";
12 -import { threadContextRecord } from "@t3tools/shared/composerContextReferences";
13 -import { T, useGT } from "gt-react";
14 -import { Trash2Icon, XIcon } from "lucide-react";
15 -import { useEffect, useState } from "react";
16 -
17 -import { useComposerDraftStore } from "../../composerDraftStore";
18 -import { ComposerHandleContext } from "../../composerHandleContext";
19 -import { useClientSettings } from "../../hooks/useSettings";
20 -import { releaseComposerDraftUploads } from "../../lib/composerDraftUploads";
21 -import type { SideChatParentPanel } from "../../lib/sideChatPane";
22 -import { readLocalApi } from "../../localApi";
23 -import { hostRightPanel, useRightPanelStore } from "../../rightPanelStore";
24 -import { useQuietThreadShell } from "../../state/entities";
25 -import { useEnvironmentScope } from "../../state/session";
26 -import { useEnvironmentShellHasSnapshot } from "../../state/shell";
27 -import { threadEnvironment } from "../../state/threads";
28 -import { useAtomCommand } from "../../state/use-atom-command";
29 -import ChatView from "../ChatView";
30 -import { Button } from "../ui/button";
31 -import { toastManager } from "../ui/toast";
32 -import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
33 -import { BackgroundThreadContext } from "./backgroundThread";
34 -
35 -/** A side chat tab: its title, Add to chat, Delete and Close, over the side chat's own chat. */
36 -export default function SideChatPane(props: {
37 - readonly parentRef: ScopedThreadRef;
38 - readonly threadId: ThreadId;
39 - readonly parentPanel: SideChatParentPanel;
40 - readonly onClose: () => void;
41 -}) {
42 - const { parentRef, threadId } = props;
43 - const gt = useGT();
44 - const threadRef = scopeThreadRef(parentRef.environmentId, threadId);
45 - // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- registers the parent panel as host in the panel store
46 - useEffect(
47 - () => hostRightPanel(scopeThreadRef(parentRef.environmentId, threadId), parentRef),
48 - [parentRef, threadId],
49 - );
50 - const shell = useQuietThreadShell(threadRef);
51 - const snapshotLoaded = useEnvironmentShellHasSnapshot(parentRef.environmentId);
52 - const canOperate = useEnvironmentScope(parentRef.environmentId, AuthOrchestrationOperateScope);
53 - const deleteThread = useAtomCommand(threadEnvironment.delete, { reportFailure: false });
54 - const confirmThreadDelete = useClientSettings((settings) => settings.confirmThreadDelete);
55 - const [deleting, setDeleting] = useState(false);
56 - // Closing an unused side chat deletes it, which would leave the link unreadable.
57 - const canAddToChat = shell !== null && shell.latestUserMessageAt !== null;
58 - const addToChat = () => {
59 - if (!canAddToChat) return;
60 - useComposerDraftStore
61 - .getState()
62 - .addThreadContexts(parentRef, [threadContextRecord(threadRef, shell.title)], {
63 - insertAtCaret: false,
64 - });
65 - };
66 -
67 - const deleteSideChat = async () => {
68 - if (!canOperate || shell === null || deleting) return;
69 - if (confirmThreadDelete) {
70 - const api = readLocalApi();
71 - if (!api) return;
72 - const confirmed = await settlePromise(() =>
73 - api.dialogs.confirm(
74 - [
75 - gt('Delete side chat "{title}"?', { title: shell.title }),
76 - gt("This permanently clears its conversation history."),
77 - ].join("\n"),
78 - { variant: "destructive" },
79 - ),
80 - );
81 - if (confirmed._tag === "Failure" || !confirmed.value) return;
82 - }
83 - setDeleting(true);
84 - const result = await deleteThread({
85 - environmentId: parentRef.environmentId,
86 - input: { threadId },
87 - });
88 - setDeleting(false);
89 - if (result._tag === "Success") {
90 - releaseComposerDraftUploads(threadRef);
91 - useComposerDraftStore.getState().clearDraftThread(threadRef);
92 - useRightPanelStore.getState().closeSurface(parentRef, `side-chat:${threadId}`);
93 - } else if (!isAtomCommandInterrupted(result)) {
94 - const error = squashAtomCommandFailure(result);
95 - toastManager.add({
96 - type: "error",
97 - title: gt("Could not delete the side chat"),
98 - ...(error instanceof Error ? { description: error.message } : {}),
99 - });
100 - }
101 - };
102 -
103 - return (
104 - <div data-side-chat-pane={threadId} className="flex h-full min-h-0 flex-col">
105 - <div className="flex h-9 shrink-0 items-center gap-1 border-b border-border pr-1 pl-3">
106 - <span className="min-w-0 flex-1 truncate text-xs font-medium">
107 - {shell?.title ?? gt("Side chat")}
108 - </span>
109 - <Tooltip>
110 - <TooltipTrigger
111 - render={
112 - <Button
113 - variant="ghost"
114 - size="xs"
115 - aria-disabled={!canAddToChat || undefined}
116 - onClick={addToChat}
117 - >
118 - <T>Add to chat</T>
119 - </Button>
120 - }
121 - />
122 - <TooltipPopup side="bottom">
123 - {canAddToChat
124 - ? gt("Adds this side chat to the main thread's next message.")
125 - : gt("Available after the first message.")}
126 - </TooltipPopup>
127 - </Tooltip>
128 - <Button
129 - variant="ghost"
130 - size="icon-xs"
131 - aria-label={gt("Delete side chat")}
132 - disabled={!canOperate || shell === null || deleting}
133 - onClick={() => void deleteSideChat()}
134 - >
135 - <Trash2Icon />
136 - </Button>
137 - <Button
138 - variant="ghost"
139 - size="icon-xs"
140 - aria-label={gt("Close side chat")}
141 - onClick={props.onClose}
142 - >
143 - <XIcon />
144 - </Button>
145 - </div>
146 - {shell === null ? (
147 - snapshotLoaded ? (
148 - <p className="p-3 text-xs text-muted-foreground">
149 - <T>This side chat was deleted.</T>
150 - </p>
151 - ) : null
152 - ) : (
153 - <BackgroundThreadContext value>
154 - <ComposerHandleContext value={null}>
155 - <ChatView
156 - environmentId={parentRef.environmentId}
157 - threadId={threadId}
158 - routeKind="server"
159 - embedded={props.parentPanel}
160 - />
161 - </ComposerHandleContext>
162 - </BackgroundThreadContext>
163 - )}
164 - </div>
165 - );
166 -}
apps/web/src/components/chat/SideThreadPane.tsx new
+210
@@ -0,0 +1,210 @@
1 +import { scopeThreadRef } from "@t3tools/client-runtime/environment";
2 +import { sideThreadKindOf } from "@t3tools/client-runtime/side-thread";
3 +import { formatSubagentDisplayTitle } from "@t3tools/client-runtime/state/subagent-display";
4 +import {
5 + isAtomCommandInterrupted,
6 + settlePromise,
7 + squashAtomCommandFailure,
8 +} from "@t3tools/client-runtime/state/runtime";
9 +import { AuthOrchestrationOperateScope, type ScopedThreadRef } from "@t3tools/contracts";
10 +import { threadContextRecord } from "@t3tools/shared/composerContextReferences";
11 +import { T, useGT } from "gt-react";
12 +import { Trash2Icon, XIcon } from "lucide-react";
13 +import { useEffect, useState } from "react";
14 +
15 +import { useComposerDraftStore } from "../../composerDraftStore";
16 +import { ComposerHandleContext } from "../../composerHandleContext";
17 +import { useClientSettings } from "../../hooks/useSettings";
18 +import { releaseComposerDraftUploads } from "../../lib/composerDraftUploads";
19 +import type { SideChatParentPanel } from "../../lib/sideChatPane";
20 +import { readLocalApi } from "../../localApi";
21 +import { hostRightPanel, type ThreadSurface, useRightPanelStore } from "../../rightPanelStore";
22 +import { useQuietThreadProjection, useQuietThreadShell } from "../../state/entities";
23 +import { useEnvironmentScope } from "../../state/session";
24 +import { useEnvironmentShellStatus } from "../../state/shell";
25 +import { threadEnvironment, useEnvironmentThread } from "../../state/threads";
26 +import {
27 + isThreadRouteSnapshotAuthoritative,
28 + resolveThreadRouteRenderState,
29 +} from "../../threadRoutes";
30 +import { useOpenThreadFamily } from "../ThreadRouteView";
31 +import { useAtomCommand } from "../../state/use-atom-command";
32 +import ChatView from "../ChatView";
33 +import { Button } from "../ui/button";
34 +import { toastManager } from "../ui/toast";
35 +import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
36 +import { BackgroundThreadContext } from "./backgroundThread";
37 +
38 +/**
39 + * A side chat or a subagent as a tab: the thread's own chat, which decides its bottom, the
40 + * composer or the read-only bar, as it does on the main screen. The tab names it and closes it,
41 + * so only a side chat, which has actions of its own, gets a header.
42 + */
43 +export default function SideThreadPane(props: {
44 + /** The thread whose panel shows the tab. */
45 + readonly parentRef: ScopedThreadRef;
46 + readonly surface: ThreadSurface;
47 + readonly parentPanel: SideChatParentPanel;
48 + readonly onClose: () => void;
49 +}) {
50 + const { parentRef, surface } = props;
51 + const { threadId } = surface;
52 + const gt = useGT();
53 + const threadRef = scopeThreadRef(parentRef.environmentId, threadId);
54 + // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- registers the parent panel as host in the panel store
55 + useEffect(
56 + () => hostRightPanel(scopeThreadRef(parentRef.environmentId, threadId), parentRef),
57 + [parentRef, threadId],
58 + );
59 + const shell = useQuietThreadShell(threadRef);
60 + const bootstrapComplete = isThreadRouteSnapshotAuthoritative(
61 + useEnvironmentShellStatus(parentRef.environmentId),
62 + );
63 + // The shell can leave an idle subagent out, so its own detail says whether it still exists.
64 + const unlistedDetail = useEnvironmentThread(
65 + shell === null ? parentRef.environmentId : null,
66 + shell === null ? threadId : null,
67 + );
68 + useOpenThreadFamily(threadRef, bootstrapComplete && shell === null);
69 + const renderState = resolveThreadRouteRenderState({
70 + bootstrapComplete,
71 + serverThreadExists: shell !== null,
72 + serverThreadDeleted: shell?.deletedAt != null,
73 + unlistedThreadDetail: unlistedDetail,
74 + draftThreadExists: false,
75 + });
76 + const projection = useQuietThreadProjection(threadRef)?.projection;
77 + const thread = shell ?? projection?.thread ?? null;
78 + // A tab opens for side chats and subagents only, so an unloaded one is still one of them.
79 + const kind = sideThreadKindOf(thread) ?? "subagent";
80 + const isSideChat = kind === "side-chat";
81 + const canOperate = useEnvironmentScope(parentRef.environmentId, AuthOrchestrationOperateScope);
82 + const deleteThread = useAtomCommand(threadEnvironment.delete, { reportFailure: false });
83 + const confirmThreadDelete = useClientSettings((settings) => settings.confirmThreadDelete);
84 + const [deleting, setDeleting] = useState(false);
85 + // Closing an unused side chat deletes it, which would leave the link unreadable.
86 + const canAddToChat = shell !== null && shell.latestUserMessageAt !== null;
87 + const addToChat = () => {
88 + if (!canAddToChat) return;
89 + useComposerDraftStore
90 + .getState()
91 + .addThreadContexts(parentRef, [threadContextRecord(threadRef, shell.title)], {
92 + insertAtCaret: false,
93 + });
94 + };
95 +
96 + const deleteSideChat = async () => {
97 + if (!canOperate || shell === null || deleting) return;
98 + if (confirmThreadDelete) {
99 + const api = readLocalApi();
100 + if (!api) return;
101 + const confirmed = await settlePromise(() =>
102 + api.dialogs.confirm(
103 + [
104 + gt('Delete side chat "{title}"?', { title: shell.title }),
105 + gt("This permanently clears its conversation history."),
106 + ].join("\n"),
107 + { variant: "destructive" },
108 + ),
109 + );
110 + if (confirmed._tag === "Failure" || !confirmed.value) return;
111 + }
112 + setDeleting(true);
113 + const result = await deleteThread({
114 + environmentId: parentRef.environmentId,
115 + input: { threadId },
116 + });
117 + setDeleting(false);
118 + if (result._tag === "Success") {
119 + releaseComposerDraftUploads(threadRef);
120 + useComposerDraftStore.getState().clearDraftThread(threadRef);
121 + useRightPanelStore.getState().closeSurface(parentRef, surface.id);
122 + } else if (!isAtomCommandInterrupted(result)) {
123 + const error = squashAtomCommandFailure(result);
124 + toastManager.add({
125 + type: "error",
126 + title: gt("Could not delete the side chat"),
127 + ...(error instanceof Error ? { description: error.message } : {}),
128 + });
129 + }
130 + };
131 +
132 + const title =
133 + thread === null
134 + ? isSideChat
135 + ? gt("Side chat")
136 + : gt("Subagent")
137 + : isSideChat
138 + ? thread.title
139 + : formatSubagentDisplayTitle(thread.title);
140 +
141 + return (
142 + <div
143 + data-side-chat-pane={threadId}
144 + data-testid="side-thread-pane"
145 + className="flex h-full min-h-0 flex-col"
146 + >
147 + {isSideChat ? (
148 + <div className="flex h-9 shrink-0 items-center gap-1 border-b border-border pr-1 pl-3">
149 + <h2 className="min-w-0 flex-1 truncate text-xs font-medium">{title}</h2>
150 + <Tooltip>
151 + <TooltipTrigger
152 + render={
153 + <Button
154 + variant="ghost"
155 + size="xs"
156 + aria-disabled={!canAddToChat || undefined}
157 + onClick={addToChat}
158 + >
159 + <T>Add to chat</T>
160 + </Button>
161 + }
162 + />
163 + <TooltipPopup side="bottom">
164 + {canAddToChat
165 + ? gt("Adds this side chat to the main thread's next message.")
166 + : gt("Available after the first message.")}
167 + </TooltipPopup>
168 + </Tooltip>
169 + <Button
170 + variant="ghost"
171 + size="icon-xs"
172 + aria-label={gt("Delete side chat")}
173 + disabled={!canOperate || shell === null || deleting}
174 + onClick={() => void deleteSideChat()}
175 + >
176 + <Trash2Icon />
177 + </Button>
178 + <Button
179 + variant="ghost"
180 + size="icon-xs"
181 + aria-label={gt("Close side chat")}
182 + onClick={props.onClose}
183 + >
184 + <XIcon />
185 + </Button>
186 + </div>
187 + ) : null}
188 + {renderState === "missing" ? (
189 + <p className="p-3 text-xs text-muted-foreground">
190 + {isSideChat ? (
191 + <T>This side chat was deleted.</T>
192 + ) : (
193 + <T>This thread is no longer available.</T>
194 + )}
195 + </p>
196 + ) : renderState === "loading" && thread === null ? null : (
197 + <BackgroundThreadContext value>
198 + <ComposerHandleContext value={null}>
199 + <ChatView
200 + environmentId={parentRef.environmentId}
201 + threadId={threadId}
202 + routeKind="server"
203 + embedded={props.parentPanel}
204 + />
205 + </ComposerHandleContext>
206 + </BackgroundThreadContext>
207 + )}
208 + </div>
209 + );
210 +}
apps/web/src/components/chat/ThreadLineageWorkflowRow.tsx
+6 -3
@@ -3,6 +3,8 @@ import {
3 type SubagentWorkflowGroup,
4 type RuntimeSubagent,
5 } from "@t3tools/client-runtime/state/subagentRuntime";
6 +import type { SideThreadOpenIntent } from "@t3tools/client-runtime/side-thread";
7 +import { useSideThreadTrigger } from "../../hooks/useSideThreadTrigger";
8 import type { ProviderDriverKind, ProviderInstanceId, ServerProvider } from "@t3tools/contracts";
9 import { msg, T, useGT, useMessages } from "gt-react";
10 import { ChevronDownIcon, SquareIcon } from "lucide-react";
@@ -73,9 +75,10 @@ function WorkflowMemberRow({
75 providers: ReadonlyArray<ServerProvider> | undefined;
76 providerEntries: ReadonlyArray<ProviderInstanceEntry>;
77 driver: ProviderDriverKind | undefined;
76 - onOpen: (threadId: string) => void;
78 + onOpen: (threadId: string, intent: SideThreadOpenIntent) => void;
79 }) {
80 const gt = useGT();
81 + const trigger = useSideThreadTrigger();
82 const threadId = member.childThreadId;
83 const canOpen = threadId !== null;
84 return (
@@ -88,7 +91,7 @@ function WorkflowMemberRow({
91 part="row"
92 aria-label={gt("Open {title} chat", { title: member.title })}
93 disabled={!canOpen}
91 - onClick={() => canOpen && onOpen(threadId)}
94 + {...(canOpen ? trigger((intent) => onOpen(threadId, intent)) : {})}
95 />
96 }
97 >
@@ -147,7 +150,7 @@ export function ThreadLineageWorkflowRow({
150 readonly providers: ReadonlyArray<ServerProvider> | undefined;
151 readonly providerEntries: ReadonlyArray<ProviderInstanceEntry>;
152 readonly driver: ProviderDriverKind | undefined;
150 - readonly onOpenThread: (threadId: string) => void;
153 + readonly onOpenThread: (threadId: string, intent: SideThreadOpenIntent) => void;
154 readonly onStop?: (() => void) | undefined;
155 readonly stopping: boolean;
156 readonly stopDisabled: boolean;
apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx
+21 -1
@@ -42,6 +42,9 @@ vi.mock(import("../../state/entities"), () => ({
42 useAnyEnvironmentHiding: (() => false) as never,
43 }));
44 vi.mock(import("../../state/environments"), () => ({
45 + // The click rule reads the client setting, whose module asks for these.
46 + useEnvironments: (() => []) as never,
47 + usePrimaryEnvironment: (() => null) as never,
48 useEnvironment: (() => null) as never,
49 useEnvironmentProviders: (() => new Map()) as never,
50 }));
@@ -61,7 +64,11 @@ vi.mock(import("../../state/use-atom-command"), () => ({
64 : AsyncResult.failure(Cause.fail(new Error("Connection lost")))) as never,
65 }));
66
67 +import { scopeThreadRef } from "@t3tools/client-runtime/environment";
68 +
69 import { render } from "../../../test/render";
70 +import { isMacPlatform } from "../../lib/utils";
71 +import { selectThreadRightPanelState, useRightPanelStore } from "../../rightPanelStore";
72 import { makeThreadProjectionFixture } from "../../test-fixtures";
73 import { ScrollArea } from "../ui/scroll-area";
74 import { ToastProvider } from "../ui/toast";
@@ -71,6 +78,7 @@ const environmentId = EnvironmentId.make("environment");
78 const threadId = ThreadId.make("fork");
79
80 function setup() {
81 + useRightPanelStore.setState(useRightPanelStore.getInitialState());
82 state.commandSucceeds = false;
83 state.relatedShells = [];
84 state.threadTitles = { source: "Source" };
@@ -168,7 +176,7 @@ it.each([
176 }
177 });
178
171 -it("opens an idle child from Lineage when its shell has not been loaded", async () => {
179 +it("opens an idle child beside the thread, and in its place with the modifier", async () => {
180 setup();
181 const projection = makeThreadProjectionFixture();
182 const childId = ThreadId.make("omitted-child");
@@ -210,10 +218,22 @@ it("opens an idle child from Lineage when its shell has not been loaded", async
218 await screen.getByRole("button", { name: /Previous agents/ }).click();
219 const child = screen.getByRole("button", { name: /Idle child/ });
220 await expect.element(child).toBeEnabled();
221 + const panelRef = scopeThreadRef(environmentId, projection.thread.id);
222 + const panel = () =>
223 + selectThreadRightPanelState(useRightPanelStore.getState().byThreadKey, panelRef);
224 await child.click();
225 + expect(panel()).toMatchObject({
226 + isOpen: true,
227 + activeSurfaceId: "thread:omitted-child",
228 + surfaces: [{ kind: "thread", threadId: childId }],
229 + });
230 + expect(screen.router?.state.location.pathname).toBe("/");
231 + // Idle children can be omitted from the shell; the route loads the child's own detail.
232 + await child.click({ modifiers: [isMacPlatform(navigator.platform) ? "Meta" : "Control"] });
233 await vi.waitFor(() =>
234 expect(screen.router?.state.location.pathname).toBe("/local/omitted-child"),
235 );
236 + expect(panel().surfaces).toHaveLength(1);
237 });
238
239 it("shows a lineage thread's full title in its tooltip", async () => {
apps/web/src/components/chat/ThreadRelationshipsControl.tsx
+37 -12
@@ -63,6 +63,7 @@ import type { MessageResolver } from "~/i18n/messages";
63
64 import { useArchivedThreadSnapshots } from "../../lib/archivedThreadsState";
65 import { buildThreadRouteParams } from "../../threadRoutes";
66 +import type { SideThreadOpenIntent } from "@t3tools/client-runtime/side-thread";
67 import { useLinkedThreadOpener } from "../../state/linkedThreadView";
68 import {
69 useProjects,
@@ -86,7 +87,8 @@ import { useEnvironmentQuery } from "../../state/query";
87 import { AgentElapsed } from "./AgentElapsed";
88 import { ThreadRelationshipIcon, threadRelationshipStatusLabel } from "./ThreadRelationshipIcon";
89 import { ThreadLineageWorkflowRow } from "./ThreadLineageWorkflowRow";
89 -import { resolveThreadOpenRoute } from "../../lib/sideChatPane";
90 +import { useSideThreadTrigger } from "../../hooks/useSideThreadTrigger";
91 +import { openSideThread, resolveThreadOpenRoute } from "../../lib/sideChatPane";
92
93 import { Menu, MenuItem, MenuPopup, MenuTrigger } from "../ui/menu";
94 import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
@@ -219,11 +221,11 @@ function relationshipHint(
221 sideChat: boolean,
222 resolve: MessageResolver,
223 ) {
222 - if (sideChat) return resolve(msg("Open side chat in this chat"));
224 + if (sideChat) return resolve(msg("Open side chat"));
225 if (edge.kind === "transfer") return resolve(msg("Open context transfer in this chat"));
226 if (edge.kind === "subagent") {
227 return edge.sourceThreadId === currentThreadId
226 - ? resolve(msg("Open subagent in this chat"))
228 + ? resolve(msg("Open subagent"))
229 : resolve(msg("Open parent agent in this chat"));
230 }
231 return edge.sourceThreadId === currentThreadId
@@ -301,13 +303,19 @@ function RemoteSubagentRow(props: {
303 isSubagent: true,
304 });
305 const opener = useLinkedThreadOpener(props.parentRef, remoteChild, title);
306 + const trigger = useSideThreadTrigger();
307 return (
308 <li className="group relative flex h-8 items-center rounded-lg">
309 <Tooltip>
310 <TooltipTrigger
311 delay={200}
312 render={
310 - <ThreadDetailsControl size="sm" variant="ghost" part="row" onClick={opener?.open} />
313 + <ThreadDetailsControl
314 + size="sm"
315 + variant="ghost"
316 + part="row"
317 + {...(opener ? trigger(opener.open, { panel: opener.mode === "linked" }) : {})}
318 + />
319 }
320 >
321 <ThreadRelationshipIcon
@@ -492,6 +500,7 @@ export function ThreadRelationshipsPanel(props: {
500 : null;
501 const parentProjection = useQuietThreadProjection(parentRef)?.projection;
502 const navigate = useNavigate();
503 + const trigger = useSideThreadTrigger();
504 const mergeBack = useAtomCommand(threadEnvironment.mergeBack);
505 const stopSession = useAtomCommand(threadEnvironment.stopSession);
506 const interruptTurn = useAtomCommand(threadEnvironment.interruptTurn);
@@ -676,6 +685,20 @@ export function ThreadRelationshipsPanel(props: {
685 });
686 };
687
688 + // A subagent or side chat of this thread opens beside it or in its place, as the click asks.
689 + const openSideThreadRow = (threadId: ThreadId, intent: SideThreadOpenIntent) => {
690 + openSideThread({
691 + threadRef: scopeThreadRef(props.environmentId, threadId),
692 + panelRef: ref,
693 + intent,
694 + navigate: (threadRef) =>
695 + void navigate({
696 + to: "/$environmentId/$threadId",
697 + params: buildThreadRouteParams(threadRef),
698 + }),
699 + });
700 + };
701 +
702 const merge = async () => {
703 if (!latestMergeBackRun || mergeTargetThreadId === null || busyAction !== null) return;
704 if (mergeErrorToastId.current !== null) {
@@ -817,12 +840,12 @@ export function ThreadRelationshipsPanel(props: {
840 ? "group-hover:opacity-0 group-focus-within:opacity-0 pointer-coarse:opacity-0 [@media(hover:none)]:opacity-0"
841 : "";
842 const project = projects.find((project) => project.id === node?.thread?.projectId);
820 - const hint = relationshipHint(
821 - edge,
822 - props.threadId,
823 - node?.thread?.lineage.sideChat === true && !isParent,
824 - m,
825 - );
843 + const isSideChat = node?.thread?.lineage.sideChat === true && !isParent;
844 + const hint = relationshipHint(edge, props.threadId, isSideChat, m);
845 + const openProps =
846 + isSideChat || (isSubagent && !isParent)
847 + ? trigger((intent) => openSideThreadRow(threadId, intent))
848 + : { onClick: () => openThread(threadId) };
849 const RelationshipPopup = agent ? ThreadHoverCardPopup : TooltipPopup;
850 const relationshipTooltip = agent ? (
851 <SubagentTooltipContent
@@ -891,7 +914,7 @@ export function ThreadRelationshipsPanel(props: {
914 size="sm"
915 variant="ghost"
916 part={workflowGroup ? "primary" : "row"}
894 - onClick={() => openThread(threadId)}
917 + {...openProps}
918 />
919 }
920 >
@@ -910,7 +933,9 @@ export function ThreadRelationshipsPanel(props: {
933 providers={providers}
934 providerEntries={providerEntries}
935 driver={providerDriver}
913 - onOpenThread={(memberThreadId) => openThread(memberThreadId as ThreadId)}
936 + onOpenThread={(memberThreadId, intent) =>
937 + openSideThreadRow(memberThreadId as ThreadId, intent)
938 + }
939 onStop={canStopWorkflow ? () => void stopWorkflow(agent.id) : undefined}
940 stopping={stoppingId === agent.id}
941 stopDisabled={stoppingId !== null}
apps/web/src/components/chat/TimelineUserMessageRow.tsx
+3 -1
@@ -288,7 +288,9 @@ function UserMessageContent({ row }: { row: Extract<TimelineRow, { kind: "messag
288 <WorkflowOpeningBlock
289 opening={ctx.workflowOpening}
290 environmentId={ctx.activeThreadEnvironmentId}
291 - onOpenThread={(threadId) => ctx.onOpenThread(ThreadId.make(threadId))}
291 + onOpenThread={(threadId, intent) =>
292 + ctx.onOpenThread(ThreadId.make(threadId), undefined, intent)
293 + }
294 />
295 ) : resolveUserMessagePresentation(row.message).attribution === "automation" ? (
296 <AutomationMessageRow row={row} />
apps/web/src/components/chat/V2LifecycleRow.tsx
+28 -7
@@ -2,8 +2,10 @@ import { T, Var, msg, useGT, useMessages } from "gt-react";
2 import { ThreadHoverCardPopup } from "../ThreadHoverCard";
3 import { AgentElapsed } from "./AgentElapsed";
4 import { projectedSubagentsToRuntime } from "@t3tools/client-runtime/state/subagentRuntime";
5 -import type { ReactNode } from "react";
5 +import { use, type ReactNode } from "react";
6 import { useThreadShell, useProject } from "../../state/entities";
7 +import type { SideThreadOpenIntent } from "@t3tools/client-runtime/side-thread";
8 +import { SideThreadsOpenContext, useSideThreadTrigger } from "../../hooks/useSideThreadTrigger";
9 import { useLinkedThreadOpener } from "../../state/linkedThreadView";
10 import { SubagentTooltipContent } from "./SubagentTooltipContent";
11 import { useAtomValue } from "@effect/atom-react";
@@ -75,7 +77,11 @@ export function V2LifecycleRow(props: {
77 readonly environmentId: EnvironmentId;
78 readonly resourceSummary?: boolean | undefined;
79 readonly runs: ReadonlyArray<HandoffTimelineRun>;
78 - readonly onOpenThread: (threadId: ThreadId) => void;
80 + readonly onOpenThread: (
81 + threadId: ThreadId,
82 + environmentId?: EnvironmentId,
83 + intent?: SideThreadOpenIntent,
84 + ) => void;
85 }) {
86 const { item } = props;
87 const gt = useGT();
@@ -375,7 +381,11 @@ export function SubagentNotificationLink(props: {
381 readonly outcome: OrchestrationV2Notification["outcome"];
382 readonly createdAt: string;
383 readonly timestampFormat: TimestampFormat;
378 - readonly onOpenThread: (threadId: ThreadId) => void;
384 + readonly onOpenThread: (
385 + threadId: ThreadId,
386 + environmentId?: EnvironmentId,
387 + intent?: SideThreadOpenIntent,
388 + ) => void;
389 readonly fallback: ReactNode;
390 }) {
391 const gt = useGT();
@@ -437,7 +447,11 @@ function SubagentTimelineLink(props: {
447 readonly threadId: ThreadId | null;
448 /** The thread in a linked environment that runs this task, when it runs there. */
449 readonly remote?: OrchestrationV2RemoteTaskChild | undefined;
440 - readonly onOpenThread: (threadId: ThreadId) => void;
450 + readonly onOpenThread: (
451 + threadId: ThreadId,
452 + environmentId?: EnvironmentId,
453 + intent?: SideThreadOpenIntent,
454 + ) => void;
455 readonly event?: {
456 readonly status: OrchestrationV2TurnItem["status"] | null;
457 readonly label: string;
@@ -454,8 +468,15 @@ function SubagentTimelineLink(props: {
468 const threadId = props.threadId;
469 // A task in a linked environment opens there, or read-only through this one.
470 const remoteOpener = useLinkedThreadOpener(props.parentRef, remote, props.title);
457 - const open =
458 - threadId !== null ? () => props.onOpenThread(threadId) : (remoteOpener?.open ?? null);
471 + const trigger = useSideThreadTrigger();
472 + const canOpen = use(SideThreadsOpenContext);
473 + const open = !canOpen
474 + ? null
475 + : threadId !== null
476 + ? (intent: SideThreadOpenIntent) => props.onOpenThread(threadId, undefined, intent)
477 + : (remoteOpener?.open ?? null);
478 + // A task on a connected linked environment opens there, on the main screen only.
479 + const panel = threadId !== null || remoteOpener?.mode === "linked";
480 const liveStatus = agent?.status ?? props.status;
481 const status = props.event ? props.event.status : liveStatus;
482 const statusLabel = props.event?.label ?? m(subagentStatusVisual(liveStatus).label);
@@ -540,7 +561,7 @@ function SubagentTimelineLink(props: {
561 data-v2-item-type="subagent"
562 aria-label={gt("Open {title}", { title: props.title })}
563 aria-description={statusLabel}
543 - onClick={open}
564 + {...trigger(open, { panel })}
565 className={cn(
566 className,
567 "cursor-pointer transition-colors hover:bg-accent/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/70",
apps/web/src/components/chat/WorkflowOpeningBlock.tsx
+6 -3
@@ -1,4 +1,6 @@
1 import { T, useGT, useMessages } from "gt-react";
2 +import type { SideThreadOpenIntent } from "@t3tools/client-runtime/side-thread";
3 +import { useSideThreadTrigger } from "../../hooks/useSideThreadTrigger";
4 import { useAtomValue } from "@effect/atom-react";
5 import {
6 isTerminalSubagentStatus,
@@ -39,7 +41,7 @@ function scriptMarkdown(script: string) {
41 export function WorkflowOpeningBlock(props: {
42 readonly opening: WorkflowOpening;
43 readonly environmentId: EnvironmentId;
42 - readonly onOpenThread: (threadId: string) => void;
44 + readonly onOpenThread: (threadId: string, intent?: SideThreadOpenIntent) => void;
45 }) {
46 const gt = useGT();
47 const { opening } = props;
@@ -113,9 +115,10 @@ function WorkflowMemberRow(props: {
115 readonly providerInstanceId: ProviderInstanceId;
116 readonly providers: ReadonlyArray<ServerProvider>;
117 readonly driver: ProviderDriverKind | undefined;
116 - readonly onOpenThread: (threadId: string) => void;
118 + readonly onOpenThread: (threadId: string, intent?: SideThreadOpenIntent) => void;
119 }) {
120 const gt = useGT();
121 + const trigger = useSideThreadTrigger();
122 const { member } = props;
123 const threadId = member.childThreadId;
124 const failed = member.status === "failed";
@@ -142,7 +145,7 @@ function WorkflowMemberRow(props: {
145 type="button"
146 aria-label={gt("Open {title}", { title: member.title })}
147 aria-description={member.status}
145 - onClick={() => props.onOpenThread(threadId)}
148 + {...trigger((intent) => props.onOpenThread(threadId, intent))}
149 className={cn(
150 className,
151 "cursor-pointer transition-colors hover:bg-accent/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/70",
apps/web/src/components/chat/timelineRowContext.ts
+3
@@ -1,4 +1,5 @@
1 import type { ToolCallDiffTarget } from "../../diffPanelStore";
2 +import type { SideThreadOpenIntent } from "@t3tools/client-runtime/side-thread";
3 import type {
4 ProviderApprovalDecision,
5 ResponseContextRecord,
@@ -85,6 +86,8 @@ export interface TimelineRowSharedState {
86 onOpenThread: (
87 threadId: OrchestrationV2TurnItem["threadId"],
88 environmentId?: EnvironmentId,
89 + /** How the click asked to open a subagent or side chat; a plain click when absent. */
90 + intent?: SideThreadOpenIntent,
91 ) => void;
92 workflowOpening: WorkflowOpening | null;
93 /** Absent hides "Fork from this response", as in the guest view. */
apps/web/src/components/chat/useRightPanelActions.ts
+16 -5
@@ -8,6 +8,9 @@ import { formatFilePathForClipboard } from "@t3tools/client-runtime/media-action
8 import { resolvePathLinkTarget } from "@t3tools/shared/fileLinks";
9 import { useStableCallback } from "../../hooks/useStableCallback";
10 import { type ScopedThreadRef, type RunId } from "@t3tools/contracts";
11 +import { scopeThreadRef } from "@t3tools/client-runtime/environment";
12 +import { sideThreadComposer, sideThreadKindOf } from "@t3tools/client-runtime/side-thread";
13 +import { readThreadShell } from "../../state/entities";
14 import { scopedThreadKey } from "@t3tools/client-runtime/environment";
15 import { useEffect } from "react";
16 import {
@@ -207,11 +210,19 @@ export function useRightPanelActions(input: RightPanelActionsInput) {
210 if (surface.kind === "terminal") {
211 focusTerminal(activeThreadRef, surface.activeTerminalId);
212 }
210 - if (surface.kind === "side-chat") {
211 - requestWorkspaceFocus({
212 - area: "panel",
213 - selector: `[data-side-chat-pane="${CSS.escape(surface.threadId)}"] [data-workspace-area="composer"] [contenteditable="true"]`,
214 - });
213 + if (surface.kind === "thread") {
214 + const kind = sideThreadKindOf(
215 + readThreadShell(scopeThreadRef(activeThreadRef.environmentId, surface.threadId)),
216 + );
217 + // A thread with no composer, or one not known yet, takes focus as any other tab does.
218 + requestWorkspaceFocus(
219 + kind !== null && sideThreadComposer(kind) === "composer"
220 + ? {
221 + area: "panel",
222 + selector: `[data-side-chat-pane="${CSS.escape(surface.threadId)}"] [data-workspace-area="composer"] [contenteditable="true"]`,
223 + }
224 + : { area: "panel" },
225 + );
226 }
227 if (surface.kind === "diff" && !diffOpen) {
228 onDiffPanelOpen?.();
apps/web/src/components/chat/useSideChat.ts
+1 -1
@@ -120,7 +120,7 @@ export function useSideChat(input: {
120 } else if (modelSelection !== undefined) {
121 useComposerDraftStore.getState().setModelSelection(targetRef, modelSelection);
122 }
123 - useRightPanelStore.getState().openSideChat(threadRef, targetThreadId);
123 + useRightPanelStore.getState().openThread(threadRef, targetThreadId);
124 return true;
125 };
126 const open = async (message?: SideChatMessage) => {
apps/web/src/components/chat/useThreadLifecycle.tsx
+19 -1
@@ -79,7 +79,8 @@ import { useAtomValue } from "@effect/atom-react";
79 import type { RunStopPresentation } from "@t3tools/client-runtime/state/thread-execution";
80 import { Atom } from "effect/reactivity";
81 import { environmentThreadDetails } from "../../state/threads";
82 -import { resolveThreadOpenRoute } from "../../lib/sideChatPane";
82 +import { type SideThreadOpenIntent, sideThreadKindOf } from "@t3tools/client-runtime/side-thread";
83 +import { openSideThread, resolveThreadOpenRoute } from "../../lib/sideChatPane";
84 import type { useLocalDispatchState } from "./useLocalDispatchState";
85 const RELATED_THREAD_SHELL_WAIT_MS = 1_000;
86
@@ -474,9 +475,11 @@ export function useThreadLifecycle(input: ThreadLifecycleInput) {
475 const handleStopBackgroundWorkStable = useStableCallback(handleStopBackgroundWork);
476 const openRelatedThreadGenerationRef = useRef(0);
477 // A task delegated to a linked environment opens there; the default is this thread's own.
478 + // `intent` comes from the rows that open a subagent, and says the thread is one.
479 const onOpenRelatedThread = async (
480 threadId: ThreadId,
481 threadEnvironmentId: EnvironmentId = environmentId,
482 + intent?: SideThreadOpenIntent,
483 ) => {
484 const generation = ++openRelatedThreadGenerationRef.current;
485 const threadRef = scopeThreadRef(threadEnvironmentId, threadId);
@@ -504,6 +507,21 @@ export function useThreadLifecycle(input: ThreadLifecycleInput) {
507 toastManager.add({ type: "info", title: m(msg("This thread is no longer available")) });
508 return;
509 }
510 + // A subagent or side chat opens beside this thread or in its place; its own parent, like any
511 + // other thread, only in its place.
512 + if (
513 + (intent !== undefined || sideThreadKindOf(shell) !== null) &&
514 + activeThread?.lineage.parentThreadId !== threadId
515 + ) {
516 + openSideThread({
517 + threadRef,
518 + panelRef: activeThreadRef,
519 + intent: intent ?? "primary",
520 + navigate: (ref) =>
521 + void navigate({ to: "/$environmentId/$threadId", params: buildThreadRouteParams(ref) }),
522 + });
523 + return;
524 + }
525 const routeRef = resolveThreadOpenRoute(threadRef, shell);
526 if (scopedThreadKey(routeRef) === routeThreadKey) return;
527 void navigate({
apps/web/src/components/settings/SettingsPanels.tsx
+61
@@ -579,6 +579,9 @@ export function useSettingsRestore(onRestored?: () => void) {
579 ...(settings.followUpBehavior !== DEFAULT_UNIFIED_SETTINGS.followUpBehavior
580 ? [gt("Follow-up behavior")]
581 : []),
582 + ...(settings.sideThreadOpenTarget !== DEFAULT_UNIFIED_SETTINGS.sideThreadOpenTarget
583 + ? [gt("Open subagents and side chats in")]
584 + : []),
585 ...(settings.toolCallVisibility !== DEFAULT_UNIFIED_SETTINGS.toolCallVisibility
586 ? [gt("Tool calls in chat")]
587 : []),
@@ -710,6 +713,7 @@ export function useSettingsRestore(onRestored?: () => void) {
713 composerRichTextEnabled: DEFAULT_UNIFIED_SETTINGS.composerRichTextEnabled,
714 sendShortcut: DEFAULT_UNIFIED_SETTINGS.sendShortcut,
715 followUpBehavior: DEFAULT_UNIFIED_SETTINGS.followUpBehavior,
716 + sideThreadOpenTarget: DEFAULT_UNIFIED_SETTINGS.sideThreadOpenTarget,
717 toolCallVisibility: DEFAULT_UNIFIED_SETTINGS.toolCallVisibility,
718 screenReaderAnnouncements: DEFAULT_UNIFIED_SETTINGS.screenReaderAnnouncements,
719 screenReaderWindowTitle: DEFAULT_UNIFIED_SETTINGS.screenReaderWindowTitle,
@@ -1393,6 +1397,63 @@ export function ChatSettingsPanel() {
1397 />
1398 </SettingsSection>
1399
1400 + <SettingsSection id="side-threads" title={gt("Subagents and side chats")}>
1401 + <SettingsRow
1402 + {...setting("side-thread-open-target")}
1403 + description={
1404 + settings.sideThreadOpenTarget === "panel"
1405 + ? gt(
1406 + "Where a click opens a subagent, a side chat, or a thread on a linked environment. {modifier}-click or middle-click opens it in the main view instead.",
1407 + { modifier: modifierLabel },
1408 + )
1409 + : gt(
1410 + "Where a click opens a subagent, a side chat, or a thread on a linked environment. {modifier}-click or middle-click opens it in the side panel instead.",
1411 + { modifier: modifierLabel },
1412 + )
1413 + }
1414 + resetAction={
1415 + settings.sideThreadOpenTarget !== DEFAULT_UNIFIED_SETTINGS.sideThreadOpenTarget ? (
1416 + <SettingResetButton
1417 + ariaLabel={gt("Reset where subagents and side chats open to default")}
1418 + onClick={() =>
1419 + updateSettings({
1420 + sideThreadOpenTarget: DEFAULT_UNIFIED_SETTINGS.sideThreadOpenTarget,
1421 + })
1422 + }
1423 + />
1424 + ) : null
1425 + }
1426 + control={
1427 + <Select
1428 + value={settings.sideThreadOpenTarget}
1429 + onValueChange={(value) => {
1430 + if (value === "panel" || value === "main") {
1431 + updateSettings({ sideThreadOpenTarget: value });
1432 + }
1433 + }}
1434 + >
1435 + <SelectTrigger
1436 + size="sm"
1437 + className="w-auto min-w-0"
1438 + aria-label={gt("Open subagents and side chats in")}
1439 + >
1440 + <SelectValue>
1441 + {settings.sideThreadOpenTarget === "panel" ? gt("Side panel") : gt("Main view")}
1442 + </SelectValue>
1443 + </SelectTrigger>
1444 + <SelectPopup align="end" alignItemWithTrigger={false}>
1445 + <SelectItem value="panel">
1446 + <T>Side panel</T>
1447 + </SelectItem>
1448 + <SelectItem value="main">
1449 + <T>Main view</T>
1450 + </SelectItem>
1451 + </SelectPopup>
1452 + </Select>
1453 + }
1454 + />
1455 + </SettingsSection>
1456 +
1457 <SettingsSection id="activity" title={gt("Activity")}>
1458 <ToolCallVisibilityRow />
1459 </SettingsSection>
apps/web/src/components/settings/settingsSearch.test.ts
+6
@@ -81,6 +81,12 @@ describe("searchSettings", () => {
81 expect(searchSettings("1password").map((item) => item.to)).not.toContain("/settings/secrets");
82 });
83
84 + it("finds where subagents and side chats open by any of its names", () => {
85 + for (const query of ["side panel", "subagent", "side chat", "linked thread", "middle click"]) {
86 + expect(searchSettings(query).map((item) => item.id)).toContain("side-thread-open-target");
87 + }
88 + });
89 +
90 it("finds the Scheduled tasks page", () => {
91 expect(searchSettings("scheduled tasks")[0]).toMatchObject({
92 id: "scheduled-tasks",
apps/web/src/components/settings/settingsSearch.ts
+10
@@ -805,6 +805,16 @@ export const SETTINGS_SEARCH_ITEMS = [
805 to: "/settings/chat",
806 searchTerms: [msg("queue steer running turn send default behavior composer")],
807 },
808 + {
809 + id: "side-thread-open-target",
810 + title: msg("Open subagents and side chats in"),
811 + to: "/settings/chat",
812 + searchTerms: [
813 + msg(
814 + "subagent side chat linked thread click right panel side panel main view command ctrl middle click",
815 + ),
816 + ],
817 + },
818 {
819 id: "provider-update-checks",
820 title: msg("Provider update checks"),
apps/web/src/hooks/useOpenSurfaceInMainView.ts new
+30
@@ -0,0 +1,30 @@
1 +import { scopeThreadRef } from "@t3tools/client-runtime/environment";
2 +import type { ScopedThreadRef } from "@t3tools/contracts";
3 +import { useNavigate } from "@tanstack/react-router";
4 +
5 +import { type LinkedThreadSurface, linkedThreadRouteParams } from "../linkedThreadSurface";
6 +import { type ThreadSurface, useRightPanelStore } from "../rightPanelStore";
7 +import { buildThreadRouteParams } from "../threadRoutes";
8 +
9 +/**
10 + * Moves a side thread's tab from `panelRef`'s panel to the main screen. The tab closes, without
11 + * the cleanup Close does, so the way back does not show the thread beside itself.
12 + */
13 +export function useOpenSurfaceInMainView(panelRef: ScopedThreadRef | null) {
14 + const navigate = useNavigate();
15 + return (surface: ThreadSurface | LinkedThreadSurface) => {
16 + if (panelRef === null) return;
17 + useRightPanelStore.getState().closeSurface(panelRef, surface.id);
18 + if (surface.kind === "linked-thread") {
19 + void navigate({
20 + to: "/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId",
21 + params: linkedThreadRouteParams(surface),
22 + });
23 + return;
24 + }
25 + void navigate({
26 + to: "/$environmentId/$threadId",
27 + params: buildThreadRouteParams(scopeThreadRef(panelRef.environmentId, surface.threadId)),
28 + });
29 + };
30 +}
apps/web/src/hooks/useRightPanelSurfaceClose.ts
+6 -9
@@ -20,11 +20,9 @@ import {
20 useRightPanelStore,
21 type RightPanelSurface,
22 } from "../rightPanelStore";
23 -import { appAtomRegistry } from "../rpc/atomRegistry";
23 import { readThreadShell } from "../state/entities";
24 import { previewEnvironment } from "../state/preview";
25 import { readEnvironmentScope, useEnvironmentScope } from "../state/session";
27 -import { environmentShell } from "../state/shell";
26 import { threadEnvironment } from "../state/threads";
27 import { useAtomCommand } from "../state/use-atom-command";
28 import { useTerminalUiStateStore } from "../terminalUiStateStore";
@@ -72,13 +70,12 @@ export function useRightPanelSurfaceClose(input: {
70 }
71 }
72 if (
75 - surface.kind === "side-chat" &&
76 - readEnvironmentScope(ref.environmentId, AuthOrchestrationOperateScope) &&
77 - // A live shell without the side chat means it is already deleted.
78 - !(
79 - appAtomRegistry.get(environmentShell.stateValueAtom(ref.environmentId)).status === "live" &&
80 - readThreadShell(scopeThreadRef(ref.environmentId, surface.threadId)) === null
81 - )
73 + surface.kind === "thread" &&
74 + // Only a side chat the shell still lists is thrown away with its tab; a subagent belongs to
75 + // its parent's work, and an unlisted side chat is already deleted.
76 + readThreadShell(scopeThreadRef(ref.environmentId, surface.threadId))?.lineage.sideChat ===
77 + true &&
78 + readEnvironmentScope(ref.environmentId, AuthOrchestrationOperateScope)
79 ) {
80 // The server keeps a side chat with a run or message. Reopen skips one it deleted.
81 void deleteThread({
apps/web/src/hooks/useSideThreadTrigger.ts new
+65
@@ -0,0 +1,65 @@
1 +import {
2 + type SideThreadOpenIntent,
3 + sideThreadOpenIntentOf,
4 +} from "@t3tools/client-runtime/side-thread";
5 +import { useGT } from "gt-react";
6 +import { createContext, use, type KeyboardEvent, type MouseEvent } from "react";
7 +
8 +import { contextMenuSourceOf } from "../contextMenuSource";
9 +import { isMacPlatform } from "../lib/utils";
10 +import { readLocalApi } from "../localApi";
11 +
12 +/**
13 + * False where the threads a view names cannot be opened from it, such as a read-only timeline
14 + * with no environment behind it. Nothing that would open one is offered there.
15 + */
16 +export const SideThreadsOpenContext = createContext(true);
17 +
18 +/**
19 + * The handlers every row, card and chip that opens a subagent, a side chat or a linked thread
20 + * shares: click and Enter open it where the setting says, the modifier or a middle click in the
21 + * other place, and the context menu names both. Pass `panel: false` where no panel can show it.
22 + * Where threads cannot be opened (`SideThreadsOpenContext`) it gives no handlers at all.
23 + */
24 +export function useSideThreadTrigger() {
25 + const gt = useGT();
26 + const canOpen = use(SideThreadsOpenContext);
27 + return (open: (intent: SideThreadOpenIntent) => void, options?: { readonly panel?: boolean }) => {
28 + if (!canOpen) return {};
29 + const mac = isMacPlatform(navigator.platform);
30 + return {
31 + onClick: (event: MouseEvent) => open(sideThreadOpenIntentOf(event, mac)),
32 + // Middle button: keeps the browser's autoscroll from starting under the click.
33 + onMouseDown: (event: MouseEvent) => {
34 + if (event.button === 1) event.preventDefault();
35 + },
36 + onAuxClick: (event: MouseEvent) => {
37 + if (event.button !== 1) return;
38 + event.preventDefault();
39 + open("alternate");
40 + },
41 + onKeyDown: (event: KeyboardEvent) => {
42 + if (event.key !== "Enter" || sideThreadOpenIntentOf(event, mac) !== "alternate") return;
43 + event.preventDefault();
44 + open("alternate");
45 + },
46 + onContextMenu: (event: MouseEvent) => {
47 + const api = readLocalApi();
48 + if (!api) return;
49 + event.preventDefault();
50 + event.stopPropagation();
51 + const items = [
52 + ...(options?.panel === false
53 + ? []
54 + : ([{ id: "panel", label: gt("Open in side panel") }] as const)),
55 + { id: "main", label: gt("Open in main view") },
56 + ] as const;
57 + void api.contextMenu
58 + .show(items, { x: event.clientX, y: event.clientY }, contextMenuSourceOf(event))
59 + .then((clicked) => {
60 + if (clicked === "panel" || clicked === "main") open(clicked);
61 + });
62 + },
63 + };
64 + };
65 +}
apps/web/src/i18n/translations/de.json
+19 -5
@@ -2367,6 +2367,7 @@
2367 "566810ac726b119a": "{title} stummschalten",
2368 "f6d1af395ae7bfcb": "Name des Geräte-Tabs",
2369 "e7ba2fded155ecdd": "{title}, {state}",
2370 + "2906d1220b6a2872": "In Hauptansicht öffnen",
2371 "69ba5155e6e2ef95": "Umbenennen",
2372 "44c90f8f19346bfb": "Andere schließen",
2373 "e6cd4726a7513754": "Rechts davon schließen",
@@ -2844,6 +2845,7 @@
2845 "276c7fa42a15a542": "Aktualisiere ältere Server, um diese Einstellung zu speichern.",
2846 "52163ddccc1eb594": "Einstellung in einigen Umgebungen gespeichert",
2847 "fee07035b4a2a1c3": "Gespeichert auf {environments}.",
2848 + "2a1ecf7863e204aa": "In Seitenleiste öffnen",
2849 "8a7ee5752bb91550": "Kopieren fehlgeschlagen. Gib stattdessen {command} ein.",
2850 "7dfdfa116c6a9d86": "Einordnung konnte nicht gestartet werden",
2851 "25fe0f5f3ef3bb02": "{description} Führe stattdessen {command} in einem Terminal auf diesem Rechner aus.",
@@ -3618,11 +3620,10 @@
3620 " verknüpft. Der Agent kann diese Verknüpfung so verwenden; ändere den Zugriff unter Einstellungen → Umgebungen."
3621 ],
3622 "000b0df227182d39": "Andere Adresse…",
3623 + "fd07b24350a7643f": "einer verknüpften Umgebung",
3624 "6bb5b1b35b2796ae": "Auf {label} über {via} · Arbeitet",
3625 "a73b7ab25d6e9bdf": "Auf {label} über {via}",
3626 "009e2ca841fdc1ef": "diese Umgebung",
3624 - "8cb2e5692c4f05ab": "Öffne diesen Thread auf {label}, um diese Darstellung zu sehen.",
3625 - "745a0b899008618c": "Frühere Runden konnten nicht geladen werden. Versuche es erneut.",
3627 "4ab24e2807a0d82f": "Mit {label} verbunden",
3628 "b797c7beccf2dc46": "Dieses Gerät ist damit gekoppelt und kann seine Threads verwenden.",
3629 "d8c4a71a728fcf68": "Verbindung mit {label} wird hergestellt…",
@@ -3630,8 +3631,11 @@
3631 "a5424a5a76e10aa3": "Tritt einem Netzwerk bei, in dem es sich befindet, etwa seinem Tailscale-Netzwerk, und versuche es erneut. Du kannst hier weiterlesen.",
3632 "1942567fd95da447": "{label} benötigt einen Kopplungscode",
3633 "0f62d432499e13f9": "Erstelle dort einen und füge es diesem Gerät als Umgebung hinzu.",
3634 + "8cb2e5692c4f05ab": "Öffne diesen Thread auf {label}, um diese Darstellung zu sehen.",
3635 + "745a0b899008618c": "Frühere Runden konnten nicht geladen werden. Versuche es erneut.",
3636 "0014ce0aaf1bd68a": "Schreibgeschützt",
3637 "10ca916def8211d4": "Code eingeben",
3638 + "a446e3bda256c2b3": "Verbinden, um zu interagieren",
3639 "d0bda35aeec66684": [
3640 "Wird von ",
3641 {
@@ -3642,7 +3646,6 @@
3646 " gelesen …"
3647 ],
3648 "c3e8cd9bf44e2f43": "Angezeigt wird, was zuvor gelesen wurde.",
3645 - "a446e3bda256c2b3": "Verbinden, um zu interagieren",
3649 "eb6e0584cf4a2a1d": "Sprache: {language}",
3650 "d76c606a3c519b78": "Zeilenumbruch deaktivieren",
3651 "2b683498cee8c8a7": "Zeilen umbrechen",
@@ -3971,6 +3974,7 @@
3974 "6a116665c8d9ad75": "Nebenchat schließen",
3975 "a5e57fdfde50aade": "Zum Chat hinzufügen",
3976 "492a438bf9dbd45d": "Dieser Nebenchat wurde gelöscht.",
3977 + "255a537ab23ddd2d": "Dieser Thread ist nicht mehr verfügbar.",
3978 "7350aa3df15b9802": "Skill {label}",
3979 "9ff9f24d1568fbaf": "Für diesen Skill ist keine Beschreibung verfügbar.",
3980 "274e087f814611a7": "Anweisungen anzeigen",
@@ -4196,9 +4200,9 @@
4200 "5e7eb0f2952de1b2": "Ersetzt",
4201 "59bcb9db3f0f59ea": "Inaktiv",
4202 "94124ad2133e3aed": "Unbekannt",
4199 - "1a6f6154d1cb51a9": "Nebenchat in diesem Chat öffnen",
4203 + "000646e27e304b8b": "Nebenchat öffnen",
4204 "56567586cbe00c86": "Kontextübergabe in diesem Chat öffnen",
4201 - "7fe7d5ae5fb4a655": "Subagent in diesem Chat öffnen",
4205 + "405e76cdd602bbcf": "Subagent öffnen",
4206 "520c15dbd507b804": "Übergeordneten Agenten in diesem Chat öffnen",
4207 "309b160785f6c473": "Fork in diesem Chat öffnen",
4208 "6676cd4b8299663f": "Übergeordneten Thread in diesem Chat öffnen",
@@ -9833,6 +9837,7 @@
9837 "2407d5d61e7f7206": "Rich-Text-Eingabefeld",
9838 "64b8fd2c284c3137": "Tastenkürzel zum Senden",
9839 "6163f91bddf474ae": "Verhalten bei Folgenachrichten",
9840 + "425021487583cf8a": "Subagenten und Nebenchats öffnen in",
9841 "856812e7e1fc445e": "Tool-Aufrufe im Chat",
9842 "216ed20b6f40fa6f": "Screenreader-Ansagen",
9843 "0ce04933a7047deb": "Fenstertitel für Screenreader",
@@ -9890,6 +9895,12 @@
9895 "1ea00f7b1a88ee2e": "Verhalten bei Folgenachrichten auf Standard zurücksetzen",
9896 "845e7f34c156ffd4": "Einreihen",
9897 "81a74689d0319316": "Umlenken",
9898 + "6dc57547546cbe96": "Subagenten und Nebenchats",
9899 + "ffbc33f6b6ddc689": "Wo ein Klick einen Subagenten, einen Nebenchat oder einen Thread in einer verknüpften Umgebung öffnet. {modifier}-Klick oder Mittelklick öffnet ihn stattdessen in der Hauptansicht.",
9900 + "7b7062c4b277e235": "Wo ein Klick einen Subagenten, einen Nebenchat oder einen Thread in einer verknüpften Umgebung öffnet. {modifier}-Klick oder Mittelklick öffnet ihn stattdessen in der Seitenleiste.",
9901 + "1eba4b1f5ae00974": "Öffnungsort für Subagenten und Nebenchats auf Standard zurücksetzen",
9902 + "f8062ccf65d4bb2a": "Seitenleiste",
9903 + "a8072bdf7ae4a288": "Hauptansicht",
9904 "162108e16ed96771": "Screenreader",
9905 "18807e775248380c": "Die Befehle, Bearbeitungen und Suchen ausblenden, die Agenten ausführen. „Erfolgreiche ausblenden“ behält Fehler. „Zen“ zeigt nur endgültige Antworten. Genehmigungen, Fragen und Fehler werden immer angezeigt.",
9906 "5848a9c1d77f45b2": "Tool-Aufrufe im Chat auf Standard zurücksetzen",
@@ -9973,6 +9984,8 @@
9984 "b9ebecdb8db71466": "Systemstandard folgt dem Uhrzeitformat deines Browsers oder Betriebssystems.",
9985 "62f8a7774dc1ffb7": "Einreihen",
9986 "c711b55bc1500f08": "Umlenken",
9987 + "e79128045796685d": "Seitenleiste",
9988 + "d81dc62319ba223e": "Hauptansicht",
9989 "54139af0114a2729": "Rot & Grün (Standard)",
9990 "8d4a851d370639e4": "Blau & Orange",
9991 "b1d7c1ea891b7db5": "Ausgeklappt",
@@ -11603,6 +11616,7 @@
11616 "ade91c8927c48175": "eingabefeld rich text tiptap fett kursiv markdown formatiert wysiwyg",
11617 "34d74827c2a8b009": "enter return befehl strg ctrl mehrzeilig prompt neue zeile eingabefeld",
11618 "9d1013084c46ecce": "warteschlange einreihen umlenken laufende runde senden standardverhalten eingabefeld",
11619 + "e5e7f5e1fb1f2e4c": "subagent nebenchat verknüpfter thread klick rechte leiste seitenleiste hauptansicht befehl strg mittelklick",
11620 "5b8b854de7ee6f4d": "installierte cli versionen neuer verfügbar codex claude cursor grok fx kiro opencode",
11621 "64f12530d55d2ad1": "fortsetzen laufende aktive unterbrochene arbeit neustart rechner absturz desktop update automatisch",
11622 "214a98497c4ed05d": "caffeinate ruhezustand verhindern wach bleiben energie laptop deckel inhibit",
apps/web/src/i18n/translations/en.json
+19 -5
@@ -2367,6 +2367,7 @@
2367 "566810ac726b119a": "Mute {title}",
2368 "f6d1af395ae7bfcb": "Device tab name",
2369 "e7ba2fded155ecdd": "{title}, {state}",
2370 + "2906d1220b6a2872": "Open in main view",
2371 "69ba5155e6e2ef95": "Rename",
2372 "44c90f8f19346bfb": "Close others",
2373 "e6cd4726a7513754": "Close to the right",
@@ -2843,6 +2844,7 @@
2844 "276c7fa42a15a542": "Update older servers to save this setting.",
2845 "52163ddccc1eb594": "Setting saved on some environments",
2846 "fee07035b4a2a1c3": "Saved on {environments}.",
2847 + "2a1ecf7863e204aa": "Open in side panel",
2848 "8a7ee5752bb91550": "Could not copy. Type {command} instead.",
2849 "7dfdfa116c6a9d86": "Could not start triage",
2850 "25fe0f5f3ef3bb02": "{description} Run {command} in a terminal on that machine instead.",
@@ -3617,11 +3619,10 @@
3619 ". The agent can use that link as it is; change its access in Settings → Environments."
3620 ],
3621 "000b0df227182d39": "Another address…",
3622 + "fd07b24350a7643f": "a linked environment",
3623 "6bb5b1b35b2796ae": "On {label} via {via} · Working",
3624 "a73b7ab25d6e9bdf": "On {label} via {via}",
3625 "009e2ca841fdc1ef": "this environment",
3623 - "8cb2e5692c4f05ab": "Open this thread on {label} to see this visual.",
3624 - "745a0b899008618c": "Could not load earlier turns. Try again.",
3626 "4ab24e2807a0d82f": "Connected to {label}",
3627 "b797c7beccf2dc46": "This device is paired with it and can use its threads.",
3628 "d8c4a71a728fcf68": "Connecting to {label}…",
@@ -3629,8 +3630,11 @@
3630 "a5424a5a76e10aa3": "Join a network it is on, such as its Tailscale network, and try again. You can keep reading here.",
3631 "1942567fd95da447": "{label} needs a pairing code",
3632 "0f62d432499e13f9": "Create one on it, then add it to this device as an environment.",
3633 + "8cb2e5692c4f05ab": "Open this thread on {label} to see this visual.",
3634 + "745a0b899008618c": "Could not load earlier turns. Try again.",
3635 "0014ce0aaf1bd68a": "Read-only",
3636 "10ca916def8211d4": "Enter code",
3637 + "a446e3bda256c2b3": "Connect to interact",
3638 "d0bda35aeec66684": [
3639 "Reading from ",
3640 {
@@ -3641,7 +3645,6 @@
3645 "…"
3646 ],
3647 "c3e8cd9bf44e2f43": "Showing what was read before.",
3644 - "a446e3bda256c2b3": "Connect to interact",
3648 "eb6e0584cf4a2a1d": "Language: {language}",
3649 "d76c606a3c519b78": "Disable line wrap",
3650 "2b683498cee8c8a7": "Wrap lines",
@@ -3969,6 +3972,7 @@
3972 "6a116665c8d9ad75": "Close side chat",
3973 "a5e57fdfde50aade": "Add to chat",
3974 "492a438bf9dbd45d": "This side chat was deleted.",
3975 + "255a537ab23ddd2d": "This thread is no longer available.",
3976 "7350aa3df15b9802": "Skill {label}",
3977 "9ff9f24d1568fbaf": "No description is available for this skill.",
3978 "274e087f814611a7": "View instructions",
@@ -4195,9 +4199,9 @@
4199 "5e7eb0f2952de1b2": "Superseded",
4200 "59bcb9db3f0f59ea": "Idle",
4201 "94124ad2133e3aed": "Unknown",
4198 - "1a6f6154d1cb51a9": "Open side chat in this chat",
4202 + "000646e27e304b8b": "Open side chat",
4203 "56567586cbe00c86": "Open context transfer in this chat",
4200 - "7fe7d5ae5fb4a655": "Open subagent in this chat",
4204 + "405e76cdd602bbcf": "Open subagent",
4205 "520c15dbd507b804": "Open parent agent in this chat",
4206 "309b160785f6c473": "Open fork in this chat",
4207 "6676cd4b8299663f": "Open parent thread in this chat",
@@ -9842,6 +9846,7 @@
9846 "2407d5d61e7f7206": "Rich text composer",
9847 "64b8fd2c284c3137": "Send shortcut",
9848 "6163f91bddf474ae": "Follow-up behavior",
9849 + "425021487583cf8a": "Open subagents and side chats in",
9850 "856812e7e1fc445e": "Tool calls in chat",
9851 "216ed20b6f40fa6f": "Screen reader announcements",
9852 "0ce04933a7047deb": "Screen reader window title",
@@ -9899,6 +9904,12 @@
9904 "1ea00f7b1a88ee2e": "Reset follow-up behavior to default",
9905 "845e7f34c156ffd4": "Queue",
9906 "81a74689d0319316": "Steer",
9907 + "6dc57547546cbe96": "Subagents and side chats",
9908 + "ffbc33f6b6ddc689": "Where a click opens a subagent, a side chat, or a thread on a linked environment. {modifier}-click or middle-click opens it in the main view instead.",
9909 + "7b7062c4b277e235": "Where a click opens a subagent, a side chat, or a thread on a linked environment. {modifier}-click or middle-click opens it in the side panel instead.",
9910 + "1eba4b1f5ae00974": "Reset where subagents and side chats open to default",
9911 + "f8062ccf65d4bb2a": "Side panel",
9912 + "a8072bdf7ae4a288": "Main view",
9913 "162108e16ed96771": "Screen reader",
9914 "18807e775248380c": "Hide the commands, edits, and searches agents run. Hide successful keeps failures. Zen shows only final answers. Approvals, questions, and errors always show.",
9915 "5848a9c1d77f45b2": "Reset tool calls in chat to default",
@@ -9982,6 +9993,8 @@
9993 "b9ebecdb8db71466": "System default follows your browser or OS clock preference.",
9994 "62f8a7774dc1ffb7": "Queue",
9995 "c711b55bc1500f08": "Steer",
9996 + "e79128045796685d": "Side panel",
9997 + "d81dc62319ba223e": "Main view",
9998 "54139af0114a2729": "Red & green (default)",
9999 "8d4a851d370639e4": "Blue & orange",
10000 "b1d7c1ea891b7db5": "Expanded",
@@ -11611,6 +11624,7 @@
11624 "ade91c8927c48175": "composer rich text tiptap bold italic markdown styled wysiwyg",
11625 "34d74827c2a8b009": "enter return command ctrl multiline prompt new line composer",
11626 "9d1013084c46ecce": "queue steer running turn send default behavior composer",
11627 + "e5e7f5e1fb1f2e4c": "subagent side chat linked thread click right panel side panel main view command ctrl middle click",
11628 "5b8b854de7ee6f4d": "installed cli versions newer available codex claude cursor grok fx kiro opencode",
11629 "64f12530d55d2ad1": "resume running active interrupted work restart reboot machine crash desktop update automatically",
11630 "214a98497c4ed05d": "caffeinate sleep prevent stay awake power laptop lid inhibit",
apps/web/src/i18n/translations/es.json
+19 -5
@@ -2367,6 +2367,7 @@
2367 "566810ac726b119a": "Silenciar {title}",
2368 "f6d1af395ae7bfcb": "Nombre de la pestaña del dispositivo",
2369 "e7ba2fded155ecdd": "{title}, {state}",
2370 + "2906d1220b6a2872": "Abrir en la vista principal",
2371 "69ba5155e6e2ef95": "Cambiar nombre",
2372 "44c90f8f19346bfb": "Cerrar las demás",
2373 "e6cd4726a7513754": "Cerrar las de la derecha",
@@ -2843,6 +2844,7 @@
2844 "276c7fa42a15a542": "Actualiza los servidores antiguos para guardar este ajuste.",
2845 "52163ddccc1eb594": "Ajuste guardado en algunos entornos",
2846 "fee07035b4a2a1c3": "Guardado en {environments}.",
2847 + "2a1ecf7863e204aa": "Abrir en el panel lateral",
2848 "8a7ee5752bb91550": "No se pudo copiar. Escribe {command} en su lugar.",
2849 "7dfdfa116c6a9d86": "No se pudo iniciar el análisis",
2850 "25fe0f5f3ef3bb02": "{description} Ejecuta {command} en una terminal de esa máquina en su lugar.",
@@ -3617,11 +3619,10 @@
3619 ". El agente puede usar ese vínculo tal cual; cambia su acceso en Ajustes → Entornos."
3620 ],
3621 "000b0df227182d39": "Otra dirección…",
3622 + "fd07b24350a7643f": "un entorno vinculado",
3623 "6bb5b1b35b2796ae": "En {label} a través de {via} · Trabajando",
3624 "a73b7ab25d6e9bdf": "En {label} a través de {via}",
3625 "009e2ca841fdc1ef": "este entorno",
3623 - "8cb2e5692c4f05ab": "Abre este hilo en {label} para ver este elemento visual.",
3624 - "745a0b899008618c": "No se pudieron cargar los turnos anteriores. Vuelve a intentarlo.",
3626 "4ab24e2807a0d82f": "Conectado a {label}",
3627 "b797c7beccf2dc46": "Este dispositivo está emparejado con él y puede usar sus hilos.",
3628 "d8c4a71a728fcf68": "Conectando con {label}…",
@@ -3629,8 +3630,11 @@
3630 "a5424a5a76e10aa3": "Únete a una red en la que esté, como su red de Tailscale, y vuelve a intentarlo. Puedes seguir leyendo aquí.",
3631 "1942567fd95da447": "{label} necesita un código de emparejamiento",
3632 "0f62d432499e13f9": "Crea uno allí y añádelo a este dispositivo como entorno.",
3633 + "8cb2e5692c4f05ab": "Abre este hilo en {label} para ver este elemento visual.",
3634 + "745a0b899008618c": "No se pudieron cargar los turnos anteriores. Vuelve a intentarlo.",
3635 "0014ce0aaf1bd68a": "Solo lectura",
3636 "10ca916def8211d4": "Introducir código",
3637 + "a446e3bda256c2b3": "Conectar para interactuar",
3638 "d0bda35aeec66684": [
3639 "Leyendo desde ",
3640 {
@@ -3641,7 +3645,6 @@
3645 "…"
3646 ],
3647 "c3e8cd9bf44e2f43": "Se muestra lo que se leyó antes.",
3644 - "a446e3bda256c2b3": "Conectar para interactuar",
3648 "eb6e0584cf4a2a1d": "Lenguaje: {language}",
3649 "d76c606a3c519b78": "Desactivar ajuste de línea",
3650 "2b683498cee8c8a7": "Ajustar líneas",
@@ -3967,6 +3970,7 @@
3970 "6a116665c8d9ad75": "Cerrar chat lateral",
3971 "a5e57fdfde50aade": "Añadir al chat",
3972 "492a438bf9dbd45d": "Este chat lateral se eliminó.",
3973 + "255a537ab23ddd2d": "Este hilo ya no está disponible.",
3974 "7350aa3df15b9802": "Skill {label}",
3975 "9ff9f24d1568fbaf": "No hay descripción disponible para esta skill.",
3976 "274e087f814611a7": "Ver instrucciones",
@@ -4193,9 +4197,9 @@
4197 "5e7eb0f2952de1b2": "Reemplazado",
4198 "59bcb9db3f0f59ea": "Inactivo",
4199 "94124ad2133e3aed": "Desconocido",
4196 - "1a6f6154d1cb51a9": "Abrir el chat lateral en este chat",
4200 + "000646e27e304b8b": "Abrir chat lateral",
4201 "56567586cbe00c86": "Abrir la transferencia de contexto en este chat",
4198 - "7fe7d5ae5fb4a655": "Abrir el subagente en este chat",
4202 + "405e76cdd602bbcf": "Abrir subagente",
4203 "520c15dbd507b804": "Abrir el agente principal en este chat",
4204 "309b160785f6c473": "Abrir la bifurcación en este chat",
4205 "6676cd4b8299663f": "Abrir el hilo principal en este chat",
@@ -9830,6 +9834,7 @@
9834 "2407d5d61e7f7206": "Cuadro de mensaje con texto enriquecido",
9835 "64b8fd2c284c3137": "Atajo de envío",
9836 "6163f91bddf474ae": "Comportamiento de los seguimientos",
9837 + "425021487583cf8a": "Abrir subagentes y chats laterales en",
9838 "856812e7e1fc445e": "Llamadas a herramientas en el chat",
9839 "216ed20b6f40fa6f": "Anuncios del lector de pantalla",
9840 "0ce04933a7047deb": "Título de ventana para el lector de pantalla",
@@ -9887,6 +9892,12 @@
9892 "1ea00f7b1a88ee2e": "Restablecer el comportamiento de los seguimientos al valor predeterminado",
9893 "845e7f34c156ffd4": "Poner en cola",
9894 "81a74689d0319316": "Redirigir",
9895 + "6dc57547546cbe96": "Subagentes y chats laterales",
9896 + "ffbc33f6b6ddc689": "Dónde abre un clic un subagente, un chat lateral o un hilo de un entorno vinculado. {modifier}-clic o el clic central lo abren en la vista principal.",
9897 + "7b7062c4b277e235": "Dónde abre un clic un subagente, un chat lateral o un hilo de un entorno vinculado. {modifier}-clic o el clic central lo abren en el panel lateral.",
9898 + "1eba4b1f5ae00974": "Restablecer dónde se abren los subagentes y chats laterales al valor predeterminado",
9899 + "f8062ccf65d4bb2a": "Panel lateral",
9900 + "a8072bdf7ae4a288": "Vista principal",
9901 "162108e16ed96771": "Lector de pantalla",
9902 "18807e775248380c": "Oculta los comandos, ediciones y búsquedas que ejecutan los agentes. Ocultar las correctas mantiene los fallos. Zen solo muestra las respuestas finales. Las aprobaciones, preguntas y errores siempre se muestran.",
9903 "5848a9c1d77f45b2": "Restablecer las llamadas a herramientas en el chat al valor predeterminado",
@@ -9970,6 +9981,8 @@
9981 "b9ebecdb8db71466": "Con «Del sistema» se usa el formato de hora de tu navegador o sistema operativo.",
9982 "62f8a7774dc1ffb7": "Poner en cola",
9983 "c711b55bc1500f08": "Redirigir",
9984 + "e79128045796685d": "Panel lateral",
9985 + "d81dc62319ba223e": "Vista principal",
9986 "54139af0114a2729": "Rojo y verde (predeterminado)",
9987 "8d4a851d370639e4": "Azul y naranja",
9988 "b1d7c1ea891b7db5": "Expandidos",
@@ -11596,6 +11609,7 @@
11609 "ade91c8927c48175": "cuadro mensaje compositor texto enriquecido tiptap negrita cursiva markdown con estilo wysiwyg",
11610 "34d74827c2a8b009": "enter intro comando ctrl multilínea prompt nueva línea cuadro mensaje compositor",
11611 "9d1013084c46ecce": "cola redirigir turno en ejecución enviar comportamiento predeterminado cuadro mensaje compositor",
11612 + "e5e7f5e1fb1f2e4c": "subagente chat lateral hilo vinculado clic panel derecho panel lateral vista principal comando ctrl clic central",
11613 "5b8b854de7ee6f4d": "instalado cli versiones más recientes disponibles codex claude cursor grok fx kiro opencode",
11614 "64f12530d55d2ad1": "reanudar en ejecución activo interrumpido trabajo reiniciar máquina fallo actualización de escritorio automáticamente",
11615 "214a98497c4ed05d": "caffeinate reposo evitar mantener activo energía portátil tapa inhibir",
apps/web/src/i18n/translations/fr.json
+19 -5
@@ -2367,6 +2367,7 @@
2367 "566810ac726b119a": "Couper le son de {title}",
2368 "f6d1af395ae7bfcb": "Nom de l’onglet de l’appareil",
2369 "e7ba2fded155ecdd": "{title}, {state}",
2370 + "2906d1220b6a2872": "Ouvrir dans la vue principale",
2371 "69ba5155e6e2ef95": "Renommer",
2372 "44c90f8f19346bfb": "Fermer les autres",
2373 "e6cd4726a7513754": "Fermer les onglets à droite",
@@ -2843,6 +2844,7 @@
2844 "276c7fa42a15a542": "Mettez à jour les anciens serveurs pour enregistrer ce paramètre.",
2845 "52163ddccc1eb594": "Paramètre enregistré sur certains environnements",
2846 "fee07035b4a2a1c3": "Enregistré sur {environments}.",
2847 + "2a1ecf7863e204aa": "Ouvrir dans le panneau latéral",
2848 "8a7ee5752bb91550": "Copie impossible. Saisissez plutôt {command}.",
2849 "7dfdfa116c6a9d86": "Impossible de lancer le tri",
2850 "25fe0f5f3ef3bb02": "{description} Exécutez plutôt {command} dans un terminal sur cette machine.",
@@ -3617,11 +3619,10 @@
3619 ". L’agent peut utiliser cette association telle quelle ; modifiez son accès dans Paramètres → Environnements."
3620 ],
3621 "000b0df227182d39": "Autre adresse…",
3622 + "fd07b24350a7643f": "un environnement associé",
3623 "6bb5b1b35b2796ae": "Sur {label} via {via} · En cours",
3624 "a73b7ab25d6e9bdf": "Sur {label} via {via}",
3625 "009e2ca841fdc1ef": "cet environnement",
3623 - "8cb2e5692c4f05ab": "Ouvrez ce fil sur {label} pour voir ce visuel.",
3624 - "745a0b899008618c": "Impossible de charger les tours précédents. Réessayez.",
3626 "4ab24e2807a0d82f": "Connecté à {label}",
3627 "b797c7beccf2dc46": "Cet appareil y est appairé et peut utiliser ses fils.",
3628 "d8c4a71a728fcf68": "Connexion à {label}…",
@@ -3629,8 +3630,11 @@
3630 "a5424a5a76e10aa3": "Rejoignez un réseau sur lequel il se trouve, comme son réseau Tailscale, puis réessayez. Vous pouvez continuer à lire ici.",
3631 "1942567fd95da447": "{label} nécessite un code d’appairage",
3632 "0f62d432499e13f9": "Créez-en un dessus, puis ajoutez-le à cet appareil comme environnement.",
3633 + "8cb2e5692c4f05ab": "Ouvrez ce fil sur {label} pour voir ce visuel.",
3634 + "745a0b899008618c": "Impossible de charger les tours précédents. Réessayez.",
3635 "0014ce0aaf1bd68a": "Lecture seule",
3636 "10ca916def8211d4": "Saisir le code",
3637 + "a446e3bda256c2b3": "Se connecter pour interagir",
3638 "d0bda35aeec66684": [
3639 "Lecture depuis ",
3640 {
@@ -3641,7 +3645,6 @@
3645 "…"
3646 ],
3647 "c3e8cd9bf44e2f43": "Affichage de ce qui a été lu auparavant.",
3644 - "a446e3bda256c2b3": "Se connecter pour interagir",
3648 "eb6e0584cf4a2a1d": "Langage : {language}",
3649 "d76c606a3c519b78": "Désactiver le retour à la ligne",
3650 "2b683498cee8c8a7": "Retour à la ligne",
@@ -3968,6 +3971,7 @@
3971 "6a116665c8d9ad75": "Fermer la discussion annexe",
3972 "a5e57fdfde50aade": "Ajouter à la discussion",
3973 "492a438bf9dbd45d": "Cette discussion annexe a été supprimée.",
3974 + "255a537ab23ddd2d": "Ce fil n’est plus disponible.",
3975 "7350aa3df15b9802": "Skill {label}",
3976 "9ff9f24d1568fbaf": "Aucune description n’est disponible pour ce skill.",
3977 "274e087f814611a7": "Voir les instructions",
@@ -4194,9 +4198,9 @@
4198 "5e7eb0f2952de1b2": "Remplacé",
4199 "59bcb9db3f0f59ea": "Inactif",
4200 "94124ad2133e3aed": "Inconnu",
4197 - "1a6f6154d1cb51a9": "Ouvrir la discussion annexe dans cette discussion",
4201 + "000646e27e304b8b": "Ouvrir la discussion annexe",
4202 "56567586cbe00c86": "Ouvrir le transfert de contexte dans cette discussion",
4199 - "7fe7d5ae5fb4a655": "Ouvrir le sous-agent dans cette discussion",
4203 + "405e76cdd602bbcf": "Ouvrir le sous-agent",
4204 "520c15dbd507b804": "Ouvrir l’agent parent dans cette discussion",
4205 "309b160785f6c473": "Ouvrir le fork dans cette discussion",
4206 "6676cd4b8299663f": "Ouvrir le fil parent dans cette discussion",
@@ -9832,6 +9836,7 @@
9836 "2407d5d61e7f7206": "Zone de saisie en texte enrichi",
9837 "64b8fd2c284c3137": "Raccourci d’envoi",
9838 "6163f91bddf474ae": "Comportement des relances",
9839 + "425021487583cf8a": "Ouvrir les sous-agents et discussions annexes dans",
9840 "856812e7e1fc445e": "Appels d’outils dans la discussion",
9841 "216ed20b6f40fa6f": "Annonces du lecteur d’écran",
9842 "0ce04933a7047deb": "Titre de fenêtre pour le lecteur d’écran",
@@ -9889,6 +9894,12 @@
9894 "1ea00f7b1a88ee2e": "Réinitialiser le comportement des relances à la valeur par défaut",
9895 "845e7f34c156ffd4": "File d’attente",
9896 "81a74689d0319316": "Réorienter",
9897 + "6dc57547546cbe96": "Sous-agents et discussions annexes",
9898 + "ffbc33f6b6ddc689": "Où un clic ouvre un sous-agent, une discussion annexe ou un fil d’un environnement associé. {modifier}-clic ou un clic du milieu l’ouvre plutôt dans la vue principale.",
9899 + "7b7062c4b277e235": "Où un clic ouvre un sous-agent, une discussion annexe ou un fil d’un environnement associé. {modifier}-clic ou un clic du milieu l’ouvre plutôt dans le panneau latéral.",
9900 + "1eba4b1f5ae00974": "Réinitialiser l’emplacement d’ouverture des sous-agents et discussions annexes à la valeur par défaut",
9901 + "f8062ccf65d4bb2a": "Panneau latéral",
9902 + "a8072bdf7ae4a288": "Vue principale",
9903 "162108e16ed96771": "Lecteur d’écran",
9904 "18807e775248380c": "Masque les commandes, modifications et recherches lancées par les agents. Masquer les réussis garde les échecs. Zen n’affiche que les réponses finales. Les approbations, questions et erreurs s’affichent toujours.",
9905 "5848a9c1d77f45b2": "Réinitialiser les appels d’outils dans la discussion à la valeur par défaut",
@@ -9972,6 +9983,8 @@
9983 "b9ebecdb8db71466": "L’option Système suit le format de l’heure de votre navigateur ou de votre OS.",
9984 "62f8a7774dc1ffb7": "File d’attente",
9985 "c711b55bc1500f08": "Réorienter",
9986 + "e79128045796685d": "Panneau latéral",
9987 + "d81dc62319ba223e": "Vue principale",
9988 "54139af0114a2729": "Rouge et vert (par défaut)",
9989 "8d4a851d370639e4": "Bleu et orange",
9990 "b1d7c1ea891b7db5": "Développés",
@@ -11601,6 +11614,7 @@
11614 "ade91c8927c48175": "zone de saisie texte enrichi tiptap gras italique markdown stylé wysiwyg",
11615 "34d74827c2a8b009": "entrée retour commande ctrl multiligne prompt nouvelle ligne zone de saisie",
11616 "9d1013084c46ecce": "file d’attente réorienter tour en cours envoyer comportement par défaut zone de saisie",
11617 + "e5e7f5e1fb1f2e4c": "sous-agent discussion annexe fil associé clic panneau droit panneau latéral vue principale commande ctrl clic du milieu",
11618 "5b8b854de7ee6f4d": "installé cli versions plus récentes disponibles codex claude cursor grok fx kiro opencode",
11619 "64f12530d55d2ad1": "reprendre en cours actif interrompu travail redémarrer redémarrage machine plantage mise à jour bureau automatiquement",
11620 "214a98497c4ed05d": "caffeinate veille empêcher rester éveillé alimentation portable capot inhiber",
apps/web/src/i18n/translations/ja.json
+19 -5
@@ -2365,6 +2365,7 @@
2365 "566810ac726b119a": "{title} をミュート",
2366 "f6d1af395ae7bfcb": "デバイスタブの名前",
2367 "e7ba2fded155ecdd": "{title}、{state}",
2368 + "2906d1220b6a2872": "メインビューで開く",
2369 "69ba5155e6e2ef95": "名前を変更",
2370 "44c90f8f19346bfb": "その他を閉じる",
2371 "e6cd4726a7513754": "右側を閉じる",
@@ -2841,6 +2842,7 @@
2842 "276c7fa42a15a542": "この設定を保存するには古いサーバーを更新してください。",
2843 "52163ddccc1eb594": "一部の環境で設定を保存しました",
2844 "fee07035b4a2a1c3": "{environments} に保存しました。",
2845 + "2a1ecf7863e204aa": "サイドパネルで開く",
2846 "8a7ee5752bb91550": "コピーできませんでした。代わりに {command} と入力してください。",
2847 "7dfdfa116c6a9d86": "トリアージを開始できませんでした",
2848 "25fe0f5f3ef3bb02": "{description} 代わりに、そのマシンのターミナルで {command} を実行してください。",
@@ -3612,11 +3614,10 @@
3614 " にリンクされています。エージェントはそのリンクをそのまま使用できます。アクセス権は [設定] → [環境] で変更してください。"
3615 ],
3616 "000b0df227182d39": "別のアドレス…",
3617 + "fd07b24350a7643f": "リンクされた環境",
3618 "6bb5b1b35b2796ae": "{label}({via} 経由) · 作業中",
3619 "a73b7ab25d6e9bdf": "{label}({via} 経由)",
3620 "009e2ca841fdc1ef": "この環境",
3618 - "8cb2e5692c4f05ab": "このビジュアルを見るには、{label} でこのスレッドを開いてください。",
3619 - "745a0b899008618c": "以前のターンを読み込めませんでした。もう一度お試しください。",
3621 "4ab24e2807a0d82f": "{label} に接続しました",
3622 "b797c7beccf2dc46": "このデバイスはペアリング済みで、そのスレッドを利用できます。",
3623 "d8c4a71a728fcf68": "{label} に接続しています…",
@@ -3624,8 +3625,11 @@
3625 "a5424a5a76e10aa3": "Tailscale ネットワークなど、そのマシンが接続しているネットワークに参加してから、もう一度お試しください。ここでは引き続き閲覧できます。",
3626 "1942567fd95da447": "{label} にはペアリングコードが必要です",
3627 "0f62d432499e13f9": "そのマシンで作成し、このデバイスに環境として追加してください。",
3628 + "8cb2e5692c4f05ab": "このビジュアルを見るには、{label} でこのスレッドを開いてください。",
3629 + "745a0b899008618c": "以前のターンを読み込めませんでした。もう一度お試しください。",
3630 "0014ce0aaf1bd68a": "読み取り専用",
3631 "10ca916def8211d4": "コードを入力",
3632 + "a446e3bda256c2b3": "接続して操作する",
3633 "d0bda35aeec66684": [
3634 "読み取り中: ",
3635 {
@@ -3636,7 +3640,6 @@
3640 "…"
3641 ],
3642 "c3e8cd9bf44e2f43": "以前に読み取った内容を表示しています。",
3639 - "a446e3bda256c2b3": "接続して操作する",
3643 "eb6e0584cf4a2a1d": "言語: {language}",
3644 "d76c606a3c519b78": "行の折り返しを無効にする",
3645 "2b683498cee8c8a7": "行を折り返す",
@@ -3958,6 +3961,7 @@
3961 "6a116665c8d9ad75": "サイドチャットを閉じる",
3962 "a5e57fdfde50aade": "チャットに追加",
3963 "492a438bf9dbd45d": "このサイドチャットは削除されました。",
3964 + "255a537ab23ddd2d": "このスレッドは利用できなくなりました。",
3965 "7350aa3df15b9802": "スキル {label}",
3966 "9ff9f24d1568fbaf": "このスキルには説明がありません。",
3967 "274e087f814611a7": "指示を表示",
@@ -4184,9 +4188,9 @@
4188 "5e7eb0f2952de1b2": "置き換え済み",
4189 "59bcb9db3f0f59ea": "アイドル",
4190 "94124ad2133e3aed": "不明",
4187 - "1a6f6154d1cb51a9": "このチャットでサイドチャットを開く",
4191 + "000646e27e304b8b": "サイドチャットを開く",
4192 "56567586cbe00c86": "このチャットでコンテキストの引き継ぎを開く",
4189 - "7fe7d5ae5fb4a655": "このチャットでサブエージェントを開く",
4193 + "405e76cdd602bbcf": "サブエージェントを開く",
4194 "520c15dbd507b804": "このチャットで親エージェントを開く",
4195 "309b160785f6c473": "このチャットでフォークを開く",
4196 "6676cd4b8299663f": "このチャットで親スレッドを開く",
@@ -9784,6 +9788,7 @@
9788 "2407d5d61e7f7206": "リッチテキスト入力欄",
9789 "64b8fd2c284c3137": "送信ショートカット",
9790 "6163f91bddf474ae": "フォローアップの動作",
9791 + "425021487583cf8a": "サブエージェントとサイドチャットを開く場所",
9792 "856812e7e1fc445e": "チャット内のツール呼び出し",
9793 "216ed20b6f40fa6f": "スクリーンリーダーの読み上げ",
9794 "0ce04933a7047deb": "スクリーンリーダー用のウィンドウタイトル",
@@ -9841,6 +9846,12 @@
9846 "1ea00f7b1a88ee2e": "フォローアップの動作をデフォルトにリセット",
9847 "845e7f34c156ffd4": "キュー",
9848 "81a74689d0319316": "軌道修正",
9849 + "6dc57547546cbe96": "サブエージェントとサイドチャット",
9850 + "ffbc33f6b6ddc689": "クリックでサブエージェント、サイドチャット、リンクされた環境のスレッドを開く場所です。{modifier} を押しながらクリックするか中クリックすると、代わりにメインビューで開きます。",
9851 + "7b7062c4b277e235": "クリックでサブエージェント、サイドチャット、リンクされた環境のスレッドを開く場所です。{modifier} を押しながらクリックするか中クリックすると、代わりにサイドパネルで開きます。",
9852 + "1eba4b1f5ae00974": "サブエージェントとサイドチャットを開く場所をデフォルトにリセット",
9853 + "f8062ccf65d4bb2a": "サイドパネル",
9854 + "a8072bdf7ae4a288": "メインビュー",
9855 "162108e16ed96771": "スクリーンリーダー",
9856 "18807e775248380c": "エージェントが実行するコマンド、編集、検索を非表示にします。「成功したものを非表示」では失敗は表示されます。Zen では最終的な回答だけを表示します。承認、質問、エラーは常に表示されます。",
9857 "5848a9c1d77f45b2": "チャット内のツール呼び出しをデフォルトにリセット",
@@ -9924,6 +9935,8 @@
9935 "b9ebecdb8db71466": "「システムのデフォルト」を選ぶと、ブラウザーまたは OS の時刻形式に従います。",
9936 "62f8a7774dc1ffb7": "キュー",
9937 "c711b55bc1500f08": "軌道修正",
9938 + "e79128045796685d": "サイドパネル",
9939 + "d81dc62319ba223e": "メインビュー",
9940 "54139af0114a2729": "赤と緑 (デフォルト)",
9941 "8d4a851d370639e4": "青とオレンジ",
9942 "b1d7c1ea891b7db5": "展開",
@@ -11551,6 +11564,7 @@
11564 "ade91c8927c48175": "入力欄 リッチテキスト Tiptap 太字 斜体 Markdown スタイル WYSIWYG rich text",
11565 "34d74827c2a8b009": "Enter Return Command Ctrl 複数行 プロンプト 改行 入力欄 shortcut",
11566 "9d1013084c46ecce": "キュー 軌道修正 実行中 ターン 送信 デフォルト 動作 入力欄 queue steer",
11567 + "e5e7f5e1fb1f2e4c": "サブエージェント サイドチャット リンクされたスレッド クリック 右パネル サイドパネル メインビュー コマンド ctrl 中クリック",
11568 "5b8b854de7ee6f4d": "インストール済み CLI バージョン 新しい 利用可能 Codex Claude Cursor Grok fx Kiro OpenCode update",
11569 "64f12530d55d2ad1": "再開 実行中 アクティブ 中断 作業 再起動 マシン クラッシュ デスクトップ 更新 自動 resume",
11570 "214a98497c4ed05d": "caffeinate スリープ 防止 スリープしない 電源 ノートパソコン 蓋 inhibit sleep",
apps/web/src/i18n/translations/ko.json
+19 -5
@@ -2366,6 +2366,7 @@
2366 "566810ac726b119a": "{title} 음소거",
2367 "f6d1af395ae7bfcb": "기기 탭 이름",
2368 "e7ba2fded155ecdd": "{title}, {state}",
2369 + "2906d1220b6a2872": "메인 보기에서 열기",
2370 "69ba5155e6e2ef95": "이름 바꾸기",
2371 "44c90f8f19346bfb": "다른 탭 닫기",
2372 "e6cd4726a7513754": "오른쪽 탭 닫기",
@@ -2842,6 +2843,7 @@
2843 "276c7fa42a15a542": "이 설정을 저장하려면 이전 서버를 업데이트하세요.",
2844 "52163ddccc1eb594": "일부 환경에만 설정이 저장됨",
2845 "fee07035b4a2a1c3": "{environments}에 저장되었습니다.",
2846 + "2a1ecf7863e204aa": "사이드 패널에서 열기",
2847 "8a7ee5752bb91550": "복사할 수 없습니다. 대신 {command}을(를) 입력하세요.",
2848 "7dfdfa116c6a9d86": "분류를 시작할 수 없습니다",
2849 "25fe0f5f3ef3bb02": "{description} 대신 해당 머신의 터미널에서 {command}을(를) 실행하세요.",
@@ -3612,11 +3614,10 @@
3614 "에 연결되어 있습니다. 에이전트는 이 연결을 그대로 사용할 수 있으며, 액세스는 설정 → 환경에서 변경하세요."
3615 ],
3616 "000b0df227182d39": "다른 주소…",
3617 + "fd07b24350a7643f": "연결된 환경",
3618 "6bb5b1b35b2796ae": "{label} ({via} 경유) · 작업 중",
3619 "a73b7ab25d6e9bdf": "{label} ({via} 경유)",
3620 "009e2ca841fdc1ef": "이 환경",
3618 - "8cb2e5692c4f05ab": "이 시각 자료를 보려면 {label}에서 이 스레드를 여세요.",
3619 - "745a0b899008618c": "이전 턴을 불러올 수 없습니다. 다시 시도하세요.",
3621 "4ab24e2807a0d82f": "{label}에 연결됨",
3622 "b797c7beccf2dc46": "이 기기가 페어링되어 해당 스레드를 사용할 수 있습니다.",
3623 "d8c4a71a728fcf68": "{label}에 연결하는 중…",
@@ -3624,8 +3625,11 @@
3625 "a5424a5a76e10aa3": "Tailscale 네트워크처럼 해당 머신이 연결된 네트워크에 참여한 후 다시 시도하세요. 여기에서 계속 읽을 수 있습니다.",
3626 "1942567fd95da447": "{label}에 페어링 코드가 필요합니다",
3627 "0f62d432499e13f9": "해당 머신에서 코드를 만든 다음 이 기기에 환경으로 추가하세요.",
3628 + "8cb2e5692c4f05ab": "이 시각 자료를 보려면 {label}에서 이 스레드를 여세요.",
3629 + "745a0b899008618c": "이전 턴을 불러올 수 없습니다. 다시 시도하세요.",
3630 "0014ce0aaf1bd68a": "읽기 전용",
3631 "10ca916def8211d4": "코드 입력",
3632 + "a446e3bda256c2b3": "연결하여 상호작용",
3633 "d0bda35aeec66684": [
3634 "읽는 중: ",
3635 {
@@ -3636,7 +3640,6 @@
3640 "…"
3641 ],
3642 "c3e8cd9bf44e2f43": "이전에 읽은 내용을 표시하고 있습니다.",
3639 - "a446e3bda256c2b3": "연결하여 상호작용",
3643 "eb6e0584cf4a2a1d": "언어: {language}",
3644 "d76c606a3c519b78": "줄 바꿈 끄기",
3645 "2b683498cee8c8a7": "줄 바꿈",
@@ -3956,6 +3959,7 @@
3959 "6a116665c8d9ad75": "사이드 채팅 닫기",
3960 "a5e57fdfde50aade": "채팅에 추가",
3961 "492a438bf9dbd45d": "이 사이드 채팅은 삭제되었습니다.",
3962 + "255a537ab23ddd2d": "이 스레드를 더 이상 사용할 수 없습니다.",
3963 "7350aa3df15b9802": "스킬 {label}",
3964 "9ff9f24d1568fbaf": "이 스킬에 대한 설명이 없습니다.",
3965 "274e087f814611a7": "지침 보기",
@@ -4181,9 +4185,9 @@
4185 "5e7eb0f2952de1b2": "대체됨",
4186 "59bcb9db3f0f59ea": "유휴",
4187 "94124ad2133e3aed": "알 수 없음",
4184 - "1a6f6154d1cb51a9": "이 채팅에서 사이드 채팅 열기",
4188 + "000646e27e304b8b": "사이드 채팅 열기",
4189 "56567586cbe00c86": "이 채팅에서 컨텍스트 전달 열기",
4186 - "7fe7d5ae5fb4a655": "이 채팅에서 서브에이전트 열기",
4190 + "405e76cdd602bbcf": "서브에이전트 열기",
4191 "520c15dbd507b804": "이 채팅에서 상위 에이전트 열기",
4192 "309b160785f6c473": "이 채팅에서 포크 열기",
4193 "6676cd4b8299663f": "이 채팅에서 상위 스레드 열기",
@@ -9787,6 +9791,7 @@
9791 "2407d5d61e7f7206": "서식 있는 텍스트 입력창",
9792 "64b8fd2c284c3137": "보내기 단축키",
9793 "6163f91bddf474ae": "후속 메시지 동작",
9794 + "425021487583cf8a": "서브에이전트와 사이드 채팅을 여는 위치",
9795 "856812e7e1fc445e": "채팅의 도구 호출",
9796 "216ed20b6f40fa6f": "화면 낭독기 알림",
9797 "0ce04933a7047deb": "화면 낭독기 창 제목",
@@ -9844,6 +9849,12 @@
9849 "1ea00f7b1a88ee2e": "후속 메시지 동작 기본값으로 재설정",
9850 "845e7f34c156ffd4": "대기열",
9851 "81a74689d0319316": "방향 조정",
9852 + "6dc57547546cbe96": "서브에이전트와 사이드 채팅",
9853 + "ffbc33f6b6ddc689": "클릭했을 때 서브에이전트, 사이드 채팅 또는 연결된 환경의 스레드가 열리는 위치입니다. {modifier}-클릭 또는 가운데 클릭은 대신 메인 보기에서 엽니다.",
9854 + "7b7062c4b277e235": "클릭했을 때 서브에이전트, 사이드 채팅 또는 연결된 환경의 스레드가 열리는 위치입니다. {modifier}-클릭 또는 가운데 클릭은 대신 사이드 패널에서 엽니다.",
9855 + "1eba4b1f5ae00974": "서브에이전트와 사이드 채팅을 여는 위치 기본값으로 재설정",
9856 + "f8062ccf65d4bb2a": "사이드 패널",
9857 + "a8072bdf7ae4a288": "메인 보기",
9858 "162108e16ed96771": "화면 낭독기",
9859 "18807e775248380c": "에이전트가 실행하는 명령, 편집, 검색을 숨깁니다. 성공한 항목 숨기기는 실패를 남겨 둡니다. Zen은 최종 답변만 표시합니다. 승인, 질문, 오류는 항상 표시됩니다.",
9860 "5848a9c1d77f45b2": "채팅의 도구 호출 기본값으로 재설정",
@@ -9927,6 +9938,8 @@
9938 "b9ebecdb8db71466": "시스템 기본값은 브라우저 또는 OS의 시간 형식 설정을 따릅니다.",
9939 "62f8a7774dc1ffb7": "대기열",
9940 "c711b55bc1500f08": "방향 조정",
9941 + "e79128045796685d": "사이드 패널",
9942 + "d81dc62319ba223e": "메인 보기",
9943 "54139af0114a2729": "빨강 및 초록(기본값)",
9944 "8d4a851d370639e4": "파랑 및 주황",
9945 "b1d7c1ea891b7db5": "펼침",
@@ -11548,6 +11561,7 @@
11561 "ade91c8927c48175": "입력창 서식 있는 텍스트 tiptap 굵게 기울임 마크다운 스타일 wysiwyg",
11562 "34d74827c2a8b009": "enter return command ctrl 여러 줄 프롬프트 새 줄 입력창",
11563 "9d1013084c46ecce": "대기열 방향 조정 실행 중 턴 보내기 기본 동작 입력창",
11564 + "e5e7f5e1fb1f2e4c": "서브에이전트 사이드 채팅 연결된 스레드 클릭 오른쪽 패널 사이드 패널 메인 보기 커맨드 ctrl 가운데 클릭",
11565 "5b8b854de7ee6f4d": "설치된 CLI 버전 최신 사용 가능 Codex Claude Cursor Grok fx Kiro OpenCode",
11566 "64f12530d55d2ad1": "재개 실행 중 활성 중단된 작업 다시 시작 재부팅 머신 충돌 데스크톱 업데이트 자동",
11567 "214a98497c4ed05d": "caffeinate 절전 방지 깨어 있기 전원 노트북 덮개 inhibit",
apps/web/src/i18n/translations/pt-BR.json
+19 -5
@@ -2367,6 +2367,7 @@
2367 "566810ac726b119a": "Silenciar {title}",
2368 "f6d1af395ae7bfcb": "Nome da aba do dispositivo",
2369 "e7ba2fded155ecdd": "{title}, {state}",
2370 + "2906d1220b6a2872": "Abrir na visualização principal",
2371 "69ba5155e6e2ef95": "Renomear",
2372 "44c90f8f19346bfb": "Fechar as outras",
2373 "e6cd4726a7513754": "Fechar à direita",
@@ -2843,6 +2844,7 @@
2844 "276c7fa42a15a542": "Atualize os servidores mais antigos para salvar esta configuração.",
2845 "52163ddccc1eb594": "Configuração salva em alguns ambientes",
2846 "fee07035b4a2a1c3": "Salvo em {environments}.",
2847 + "2a1ecf7863e204aa": "Abrir no painel lateral",
2848 "8a7ee5752bb91550": "Não foi possível copiar. Digite {command}.",
2849 "7dfdfa116c6a9d86": "Não foi possível iniciar a triagem",
2850 "25fe0f5f3ef3bb02": "{description} Execute {command} em um terminal naquela máquina.",
@@ -3617,11 +3619,10 @@
3619 ". O agente pode usar esse vínculo como está; altere o acesso em Configurações → Ambientes."
3620 ],
3621 "000b0df227182d39": "Outro endereço…",
3622 + "fd07b24350a7643f": "um ambiente vinculado",
3623 "6bb5b1b35b2796ae": "Em {label} via {via} · Trabalhando",
3624 "a73b7ab25d6e9bdf": "Em {label} via {via}",
3625 "009e2ca841fdc1ef": "este ambiente",
3623 - "8cb2e5692c4f05ab": "Abra este thread em {label} para ver este visual.",
3624 - "745a0b899008618c": "Não foi possível carregar os turnos anteriores. Tente novamente.",
3626 "4ab24e2807a0d82f": "Conectado a {label}",
3627 "b797c7beccf2dc46": "Este dispositivo está pareado com ele e pode usar suas threads.",
3628 "d8c4a71a728fcf68": "Conectando a {label}…",
@@ -3629,8 +3630,11 @@
3630 "a5424a5a76e10aa3": "Entre em uma rede em que ele esteja, como a rede Tailscale dele, e tente novamente. Você pode continuar lendo aqui.",
3631 "1942567fd95da447": "{label} precisa de um código de pareamento",
3632 "0f62d432499e13f9": "Crie um nele e adicione-o a este dispositivo como ambiente.",
3633 + "8cb2e5692c4f05ab": "Abra este thread em {label} para ver este visual.",
3634 + "745a0b899008618c": "Não foi possível carregar os turnos anteriores. Tente novamente.",
3635 "0014ce0aaf1bd68a": "Somente leitura",
3636 "10ca916def8211d4": "Inserir código",
3637 + "a446e3bda256c2b3": "Conectar para interagir",
3638 "d0bda35aeec66684": [
3639 "Lendo de ",
3640 {
@@ -3641,7 +3645,6 @@
3645 "…"
3646 ],
3647 "c3e8cd9bf44e2f43": "Mostrando o que foi lido antes.",
3644 - "a446e3bda256c2b3": "Conectar para interagir",
3648 "eb6e0584cf4a2a1d": "Linguagem: {language}",
3649 "d76c606a3c519b78": "Desativar quebra de linha",
3650 "2b683498cee8c8a7": "Quebrar linhas",
@@ -3968,6 +3971,7 @@
3971 "6a116665c8d9ad75": "Fechar chat paralelo",
3972 "a5e57fdfde50aade": "Adicionar ao chat",
3973 "492a438bf9dbd45d": "Este chat paralelo foi excluído.",
3974 + "255a537ab23ddd2d": "Esta thread não está mais disponível.",
3975 "7350aa3df15b9802": "Skill {label}",
3976 "9ff9f24d1568fbaf": "Não há descrição disponível para esta skill.",
3977 "274e087f814611a7": "Ver instruções",
@@ -4193,9 +4197,9 @@
4197 "5e7eb0f2952de1b2": "Substituído",
4198 "59bcb9db3f0f59ea": "Ocioso",
4199 "94124ad2133e3aed": "Desconhecido",
4196 - "1a6f6154d1cb51a9": "Abrir o chat paralelo neste chat",
4200 + "000646e27e304b8b": "Abrir chat paralelo",
4201 "56567586cbe00c86": "Abrir a transferência de contexto neste chat",
4198 - "7fe7d5ae5fb4a655": "Abrir o subagente neste chat",
4202 + "405e76cdd602bbcf": "Abrir subagente",
4203 "520c15dbd507b804": "Abrir o agente principal neste chat",
4204 "309b160785f6c473": "Abrir o fork neste chat",
4205 "6676cd4b8299663f": "Abrir a thread principal neste chat",
@@ -9831,6 +9835,7 @@
9835 "2407d5d61e7f7206": "Editor de texto formatado",
9836 "64b8fd2c284c3137": "Atalho de envio",
9837 "6163f91bddf474ae": "Comportamento de mensagens de acompanhamento",
9838 + "425021487583cf8a": "Abrir subagentes e chats paralelos em",
9839 "856812e7e1fc445e": "Chamadas de ferramentas no chat",
9840 "216ed20b6f40fa6f": "Anúncios do leitor de tela",
9841 "0ce04933a7047deb": "Título da janela para leitor de tela",
@@ -9888,6 +9893,12 @@
9893 "1ea00f7b1a88ee2e": "Redefinir o comportamento das mensagens de acompanhamento para o padrão",
9894 "845e7f34c156ffd4": "Enfileirar",
9895 "81a74689d0319316": "Direcionar",
9896 + "6dc57547546cbe96": "Subagentes e chats paralelos",
9897 + "ffbc33f6b6ddc689": "Onde um clique abre um subagente, um chat paralelo ou uma thread de um ambiente vinculado. {modifier}-clique ou o clique do meio abre na visualização principal.",
9898 + "7b7062c4b277e235": "Onde um clique abre um subagente, um chat paralelo ou uma thread de um ambiente vinculado. {modifier}-clique ou o clique do meio abre no painel lateral.",
9899 + "1eba4b1f5ae00974": "Redefinir onde subagentes e chats paralelos abrem para o padrão",
9900 + "f8062ccf65d4bb2a": "Painel lateral",
9901 + "a8072bdf7ae4a288": "Visualização principal",
9902 "162108e16ed96771": "Leitor de tela",
9903 "18807e775248380c": "Oculta os comandos, edições e pesquisas que os agentes executam. \"Ocultar bem-sucedidas\" mantém as falhas. Zen mostra só as respostas finais. Aprovações, perguntas e erros sempre aparecem.",
9904 "5848a9c1d77f45b2": "Redefinir as chamadas de ferramentas no chat para o padrão",
@@ -9971,6 +9982,8 @@
9982 "b9ebecdb8db71466": "\"Padrão do sistema\" usa o formato de horário do navegador ou do sistema operacional.",
9983 "62f8a7774dc1ffb7": "Enfileirar",
9984 "c711b55bc1500f08": "Direcionar",
9985 + "e79128045796685d": "Painel lateral",
9986 + "d81dc62319ba223e": "Visualização principal",
9987 "54139af0114a2729": "Vermelho e verde (padrão)",
9988 "8d4a851d370639e4": "Azul e laranja",
9989 "b1d7c1ea891b7db5": "Expandido",
@@ -11600,6 +11613,7 @@
11613 "ade91c8927c48175": "editor de mensagens rich text tiptap negrito itálico markdown estilizado wysiwyg",
11614 "34d74827c2a8b009": "enter return command ctrl várias linhas prompt nova linha editor de mensagens",
11615 "9d1013084c46ecce": "fila enfileirar direcionar turno em execução enviar comportamento padrão editor de mensagens",
11616 + "e5e7f5e1fb1f2e4c": "subagente chat paralelo thread vinculada clique painel direito painel lateral visualização principal comando ctrl clique do meio",
11617 "5b8b854de7ee6f4d": "cli instaladas versões mais novas disponíveis codex claude cursor grok fx kiro opencode",
11618 "64f12530d55d2ad1": "retomar em execução ativo interrompido trabalho reiniciar reboot máquina falha atualização do desktop automaticamente",
11619 "214a98497c4ed05d": "caffeinate repouso impedir manter acordado energia notebook tampa inibir",
apps/web/src/i18n/translations/ru.json
+19 -5
@@ -2367,6 +2367,7 @@
2367 "566810ac726b119a": "Выключить звук: {title}",
2368 "f6d1af395ae7bfcb": "Название вкладки устройства",
2369 "e7ba2fded155ecdd": "{title}, {state}",
2370 + "2906d1220b6a2872": "Открыть в основном окне",
2371 "69ba5155e6e2ef95": "Переименовать",
2372 "44c90f8f19346bfb": "Закрыть остальные",
2373 "e6cd4726a7513754": "Закрыть справа",
@@ -2843,6 +2844,7 @@
2844 "276c7fa42a15a542": "Обновите старые серверы, чтобы сохранить эту настройку.",
2845 "52163ddccc1eb594": "Настройка сохранена в некоторых окружениях",
2846 "fee07035b4a2a1c3": "Сохранено на {environments}.",
2847 + "2a1ecf7863e204aa": "Открыть в боковой панели",
2848 "8a7ee5752bb91550": "Не удалось скопировать. Введите {command} вручную.",
2849 "7dfdfa116c6a9d86": "Не удалось начать разбор проблемы",
2850 "25fe0f5f3ef3bb02": "{description} Вместо этого выполните {command} в терминале на той машине.",
@@ -3617,11 +3619,10 @@
3619 ". Агент может использовать эту привязку как есть; изменить её доступ можно в «Настройки → Окружения»."
3620 ],
3621 "000b0df227182d39": "Другой адрес…",
3622 + "fd07b24350a7643f": "привязанном окружении",
3623 "6bb5b1b35b2796ae": "На {label} через {via} · Работает",
3624 "a73b7ab25d6e9bdf": "На {label} через {via}",
3625 "009e2ca841fdc1ef": "это окружение",
3623 - "8cb2e5692c4f05ab": "Откройте этот тред на {label}, чтобы увидеть это визуальное представление.",
3624 - "745a0b899008618c": "Не удалось загрузить более ранние ходы. Повторите попытку.",
3626 "4ab24e2807a0d82f": "Подключено к {label}",
3627 "b797c7beccf2dc46": "Это устройство сопряжено с ним и может работать с его тредами.",
3628 "d8c4a71a728fcf68": "Подключение к {label}…",
@@ -3629,8 +3630,11 @@
3630 "a5424a5a76e10aa3": "Подключитесь к сети, в которой оно находится, например к его сети Tailscale, и повторите попытку. Здесь можно продолжать чтение.",
3631 "1942567fd95da447": "Для {label} нужен код сопряжения",
3632 "0f62d432499e13f9": "Создайте его там и добавьте эту машину на устройство как окружение.",
3633 + "8cb2e5692c4f05ab": "Откройте этот тред на {label}, чтобы увидеть это визуальное представление.",
3634 + "745a0b899008618c": "Не удалось загрузить более ранние ходы. Повторите попытку.",
3635 "0014ce0aaf1bd68a": "Только чтение",
3636 "10ca916def8211d4": "Ввести код",
3637 + "a446e3bda256c2b3": "Подключиться для взаимодействия",
3638 "d0bda35aeec66684": [
3639 "Чтение с ",
3640 {
@@ -3641,7 +3645,6 @@
3645 "…"
3646 ],
3647 "c3e8cd9bf44e2f43": "Показано то, что было прочитано раньше.",
3644 - "a446e3bda256c2b3": "Подключиться для взаимодействия",
3648 "eb6e0584cf4a2a1d": "Язык: {language}",
3649 "d76c606a3c519b78": "Отключить перенос строк",
3650 "2b683498cee8c8a7": "Переносить строки",
@@ -3968,6 +3971,7 @@
3971 "6a116665c8d9ad75": "Закрыть боковой чат",
3972 "a5e57fdfde50aade": "Добавить в чат",
3973 "492a438bf9dbd45d": "Этот боковой чат удалён.",
3974 + "255a537ab23ddd2d": "Этот тред больше недоступен.",
3975 "7350aa3df15b9802": "Навык {label}",
3976 "9ff9f24d1568fbaf": "У этого навыка нет описания.",
3977 "274e087f814611a7": "Показать инструкции",
@@ -4193,9 +4197,9 @@
4197 "5e7eb0f2952de1b2": "Заменён",
4198 "59bcb9db3f0f59ea": "Простаивает",
4199 "94124ad2133e3aed": "Неизвестно",
4196 - "1a6f6154d1cb51a9": "Открыть боковой чат в этом чате",
4200 + "000646e27e304b8b": "Открыть боковой чат",
4201 "56567586cbe00c86": "Открыть передачу контекста в этом чате",
4198 - "7fe7d5ae5fb4a655": "Открыть субагента в этом чате",
4202 + "405e76cdd602bbcf": "Открыть субагента",
4203 "520c15dbd507b804": "Открыть родительского агента в этом чате",
4204 "309b160785f6c473": "Открыть ответвление в этом чате",
4205 "6676cd4b8299663f": "Открыть родительский тред в этом чате",
@@ -9834,6 +9838,7 @@
9838 "2407d5d61e7f7206": "Поле ввода с форматированием",
9839 "64b8fd2c284c3137": "Сочетание для отправки",
9840 "6163f91bddf474ae": "Поведение дополнительных сообщений",
9841 + "425021487583cf8a": "Открывать субагентов и боковые чаты в",
9842 "856812e7e1fc445e": "Вызовы инструментов в чате",
9843 "216ed20b6f40fa6f": "Объявления для экранного диктора",
9844 "0ce04933a7047deb": "Заголовок окна для экранного диктора",
@@ -9891,6 +9896,12 @@
9896 "1ea00f7b1a88ee2e": "Сбросить поведение дополнительных сообщений к значению по умолчанию",
9897 "845e7f34c156ffd4": "Очередь",
9898 "81a74689d0319316": "Корректировка",
9899 + "6dc57547546cbe96": "Субагенты и боковые чаты",
9900 + "ffbc33f6b6ddc689": "Где по щелчку открывается субагент, боковой чат или тред в привязанном окружении. {modifier}-щелчок или щелчок средней кнопкой открывает его в основном окне.",
9901 + "7b7062c4b277e235": "Где по щелчку открывается субагент, боковой чат или тред в привязанном окружении. {modifier}-щелчок или щелчок средней кнопкой открывает его в боковой панели.",
9902 + "1eba4b1f5ae00974": "Сбросить место открытия субагентов и боковых чатов к значению по умолчанию",
9903 + "f8062ccf65d4bb2a": "Боковая панель",
9904 + "a8072bdf7ae4a288": "Основное окно",
9905 "162108e16ed96771": "Экранный диктор",
9906 "18807e775248380c": "Скрывать команды, правки и поиски, которые выполняют агенты. «Скрывать успешные» оставляет ошибки. «Дзен» показывает только итоговые ответы. Запросы подтверждения, вопросы и ошибки показываются всегда.",
9907 "5848a9c1d77f45b2": "Сбросить вызовы инструментов в чате к значению по умолчанию",
@@ -9974,6 +9985,8 @@
9985 "b9ebecdb8db71466": "«Как в системе» использует формат времени браузера или ОС.",
9986 "62f8a7774dc1ffb7": "Очередь",
9987 "c711b55bc1500f08": "Корректировка",
9988 + "e79128045796685d": "Боковая панель",
9989 + "d81dc62319ba223e": "Основное окно",
9990 "54139af0114a2729": "Красный и зелёный (по умолчанию)",
9991 "8d4a851d370639e4": "Синий и оранжевый",
9992 "b1d7c1ea891b7db5": "Развёрнуты",
@@ -11601,6 +11614,7 @@
11614 "ade91c8927c48175": "поле ввода форматирование tiptap жирный курсив markdown стили wysiwyg",
11615 "34d74827c2a8b009": "enter return command ctrl многострочный промпт новая строка поле ввода",
11616 "9d1013084c46ecce": "очередь корректировка выполняющийся ход отправить поведение по умолчанию поле ввода",
11617 + "e5e7f5e1fb1f2e4c": "субагент боковой чат привязанный тред щелчок правая панель боковая панель основное окно command ctrl средняя кнопка",
11618 "5b8b854de7ee6f4d": "установленные cli версии новее доступно codex claude cursor grok fx kiro opencode",
11619 "64f12530d55d2ad1": "возобновить выполняющаяся активная прерванная работа перезапуск перезагрузка компьютер сбой обновление десктоп автоматически",
11620 "214a98497c4ed05d": "caffeinate сон не давать уснуть бодрствование питание ноутбук крышка блокировать",
apps/web/src/i18n/translations/sv.json
+19 -5
@@ -2367,6 +2367,7 @@
2367 "566810ac726b119a": "Stäng av ljudet för {title}",
2368 "f6d1af395ae7bfcb": "Namn på enhetsflik",
2369 "e7ba2fded155ecdd": "{title}, {state}",
2370 + "2906d1220b6a2872": "Öppna i huvudvyn",
2371 "69ba5155e6e2ef95": "Byt namn",
2372 "44c90f8f19346bfb": "Stäng andra",
2373 "e6cd4726a7513754": "Stäng till höger",
@@ -2843,6 +2844,7 @@
2844 "276c7fa42a15a542": "Uppdatera äldre servrar för att spara den här inställningen.",
2845 "52163ddccc1eb594": "Inställningen sparades i vissa miljöer",
2846 "fee07035b4a2a1c3": "Sparat på {environments}.",
2847 + "2a1ecf7863e204aa": "Öppna i sidopanelen",
2848 "8a7ee5752bb91550": "Kunde inte kopiera. Skriv {command} i stället.",
2849 "7dfdfa116c6a9d86": "Kunde inte starta felsökningen",
2850 "25fe0f5f3ef3bb02": "{description} Kör {command} i en terminal på den datorn i stället.",
@@ -3617,11 +3619,10 @@
3619 ". Agenten kan använda den länken som den är; ändra dess åtkomst under Inställningar → Miljöer."
3620 ],
3621 "000b0df227182d39": "En annan adress…",
3622 + "fd07b24350a7643f": "en länkad miljö",
3623 "6bb5b1b35b2796ae": "På {label} via {via} · Arbetar",
3624 "a73b7ab25d6e9bdf": "På {label} via {via}",
3625 "009e2ca841fdc1ef": "den här miljön",
3623 - "8cb2e5692c4f05ab": "Öppna den här tråden på {label} för att se den här visualiseringen.",
3624 - "745a0b899008618c": "Kunde inte läsa in tidigare omgångar. Försök igen.",
3626 "4ab24e2807a0d82f": "Ansluten till {label}",
3627 "b797c7beccf2dc46": "Den här enheten är parkopplad med den och kan använda dess trådar.",
3628 "d8c4a71a728fcf68": "Ansluter till {label}…",
@@ -3629,8 +3630,11 @@
3630 "a5424a5a76e10aa3": "Anslut till ett nätverk som den finns på, till exempel dess Tailscale-nätverk, och försök igen. Du kan fortsätta läsa här.",
3631 "1942567fd95da447": "{label} behöver en parkopplingskod",
3632 "0f62d432499e13f9": "Skapa en där och lägg till den på den här enheten som en miljö.",
3633 + "8cb2e5692c4f05ab": "Öppna den här tråden på {label} för att se den här visualiseringen.",
3634 + "745a0b899008618c": "Kunde inte läsa in tidigare omgångar. Försök igen.",
3635 "0014ce0aaf1bd68a": "Skrivskyddad",
3636 "10ca916def8211d4": "Ange kod",
3637 + "a446e3bda256c2b3": "Anslut för att interagera",
3638 "d0bda35aeec66684": [
3639 "Läser från ",
3640 {
@@ -3641,7 +3645,6 @@
3645 "…"
3646 ],
3647 "c3e8cd9bf44e2f43": "Visar det som lästes tidigare.",
3644 - "a446e3bda256c2b3": "Anslut för att interagera",
3648 "eb6e0584cf4a2a1d": "Språk: {language}",
3649 "d76c606a3c519b78": "Inaktivera radbrytning",
3650 "2b683498cee8c8a7": "Bryt rader",
@@ -3968,6 +3971,7 @@
3971 "6a116665c8d9ad75": "Stäng sidochatt",
3972 "a5e57fdfde50aade": "Lägg till i chatten",
3973 "492a438bf9dbd45d": "Den här sidochatten togs bort.",
3974 + "255a537ab23ddd2d": "Den här tråden är inte längre tillgänglig.",
3975 "7350aa3df15b9802": "Färdighet {label}",
3976 "9ff9f24d1568fbaf": "Ingen beskrivning finns för den här färdigheten.",
3977 "274e087f814611a7": "Visa instruktioner",
@@ -4194,9 +4198,9 @@
4198 "5e7eb0f2952de1b2": "Ersatt",
4199 "59bcb9db3f0f59ea": "Inaktiv",
4200 "94124ad2133e3aed": "Okänd",
4197 - "1a6f6154d1cb51a9": "Öppna sidochatten i den här chatten",
4201 + "000646e27e304b8b": "Öppna sidochatt",
4202 "56567586cbe00c86": "Öppna kontextöverföringen i den här chatten",
4199 - "7fe7d5ae5fb4a655": "Öppna subagenten i den här chatten",
4203 + "405e76cdd602bbcf": "Öppna subagent",
4204 "520c15dbd507b804": "Öppna den överordnade agenten i den här chatten",
4205 "309b160785f6c473": "Öppna forken i den här chatten",
4206 "6676cd4b8299663f": "Öppna den överordnade tråden i den här chatten",
@@ -9840,6 +9844,7 @@
9844 "2407d5d61e7f7206": "Inmatningsfält med formaterad text",
9845 "64b8fd2c284c3137": "Kortkommando för att skicka",
9846 "6163f91bddf474ae": "Beteende för uppföljningar",
9847 + "425021487583cf8a": "Öppna subagenter och sidochattar i",
9848 "856812e7e1fc445e": "Verktygsanrop i chatten",
9849 "216ed20b6f40fa6f": "Uppläsningar för skärmläsare",
9850 "0ce04933a7047deb": "Fönstertitel för skärmläsare",
@@ -9897,6 +9902,12 @@
9902 "1ea00f7b1a88ee2e": "Återställ beteende för uppföljningar till standard",
9903 "845e7f34c156ffd4": "Köa",
9904 "81a74689d0319316": "Styr om",
9905 + "6dc57547546cbe96": "Subagenter och sidochattar",
9906 + "ffbc33f6b6ddc689": "Var ett klick öppnar en subagent, en sidochatt eller en tråd i en länkad miljö. {modifier}-klick eller mittenklick öppnar den i huvudvyn i stället.",
9907 + "7b7062c4b277e235": "Var ett klick öppnar en subagent, en sidochatt eller en tråd i en länkad miljö. {modifier}-klick eller mittenklick öppnar den i sidopanelen i stället.",
9908 + "1eba4b1f5ae00974": "Återställ var subagenter och sidochattar öppnas till standard",
9909 + "f8062ccf65d4bb2a": "Sidopanel",
9910 + "a8072bdf7ae4a288": "Huvudvy",
9911 "162108e16ed96771": "Skärmläsare",
9912 "18807e775248380c": "Dölj kommandon, redigeringar och sökningar som agenter kör. Dölj lyckade behåller misslyckanden. Zen visar bara slutliga svar. Godkännanden, frågor och fel visas alltid.",
9913 "5848a9c1d77f45b2": "Återställ verktygsanrop i chatten till standard",
@@ -9980,6 +9991,8 @@
9991 "b9ebecdb8db71466": "Systemstandard följer webbläsarens eller operativsystemets klockinställning.",
9992 "62f8a7774dc1ffb7": "Köa",
9993 "c711b55bc1500f08": "Styr om",
9994 + "e79128045796685d": "Sidopanel",
9995 + "d81dc62319ba223e": "Huvudvy",
9996 "54139af0114a2729": "Rött och grönt (standard)",
9997 "8d4a851d370639e4": "Blått och orange",
9998 "b1d7c1ea891b7db5": "Utfällda",
@@ -11609,6 +11622,7 @@
11622 "ade91c8927c48175": "inmatningsfält formaterad text tiptap fet kursiv markdown formaterad wysiwyg",
11623 "34d74827c2a8b009": "enter retur command ctrl flera rader prompt ny rad inmatningsfält",
11624 "9d1013084c46ecce": "kö styr om pågående omgång skicka standardbeteende inmatningsfält",
11625 + "e5e7f5e1fb1f2e4c": "subagent sidochatt länkad tråd klick högerpanel sidopanel huvudvy kommando ctrl mittenklick",
11626 "5b8b854de7ee6f4d": "installerade cli versioner nyare tillgänglig codex claude cursor grok fx kiro opencode",
11627 "64f12530d55d2ad1": "återuppta pågående aktiv avbrutet arbete omstart starta om dator krasch skrivbord uppdatering automatiskt",
11628 "214a98497c4ed05d": "caffeinate viloläge förhindra håll vaken ström laptop lock förhindra",
apps/web/src/i18n/translations/zh.json
+19 -5
@@ -2371,6 +2371,7 @@
2371 "566810ac726b119a": "将 {title} 静音",
2372 "f6d1af395ae7bfcb": "设备标签名",
2373 "e7ba2fded155ecdd": "{title},{state}",
2374 + "2906d1220b6a2872": "在主视图中打开",
2375 "69ba5155e6e2ef95": "重命名",
2376 "44c90f8f19346bfb": "关闭其他标签",
2377 "e6cd4726a7513754": "关闭右侧标签",
@@ -2847,6 +2848,7 @@
2848 "276c7fa42a15a542": "请更新旧版服务器后再保存此设置。",
2849 "52163ddccc1eb594": "部分环境已保存设置",
2850 "fee07035b4a2a1c3": "已在 {environments} 上保存。",
2851 + "2a1ecf7863e204aa": "在侧边面板中打开",
2852 "8a7ee5752bb91550": "无法复制。请改为输入 {command}。",
2853 "7dfdfa116c6a9d86": "无法开始问题排查",
2854 "25fe0f5f3ef3bb02": "{description} 请改为在那台机器的终端中运行 {command}。",
@@ -3622,11 +3624,10 @@
3624 "。智能体可以直接使用该关联;请在“设置 → 环境”中更改其访问权限。"
3625 ],
3626 "000b0df227182d39": "其他地址…",
3627 + "fd07b24350a7643f": "关联环境",
3628 "6bb5b1b35b2796ae": "位于 {label},经由 {via} · 运行中",
3629 "a73b7ab25d6e9bdf": "位于 {label},经由 {via}",
3630 "009e2ca841fdc1ef": "此环境",
3628 - "8cb2e5692c4f05ab": "在 {label} 上打开此会话即可查看此可视内容。",
3629 - "745a0b899008618c": "无法加载更早的对话。请重试。",
3631 "4ab24e2807a0d82f": "已连接到 {label}",
3632 "b797c7beccf2dc46": "此设备已与其配对,可以使用其中的会话。",
3633 "d8c4a71a728fcf68": "正在连接 {label}…",
@@ -3634,8 +3635,11 @@
3635 "a5424a5a76e10aa3": "请加入它所在的网络(例如其 Tailscale 网络),然后重试。你仍可在此继续阅读。",
3636 "1942567fd95da447": "{label} 需要配对码",
3637 "0f62d432499e13f9": "在该机器上创建配对码,然后将其作为环境添加到此设备。",
3638 + "8cb2e5692c4f05ab": "在 {label} 上打开此会话即可查看此可视内容。",
3639 + "745a0b899008618c": "无法加载更早的对话。请重试。",
3640 "0014ce0aaf1bd68a": "只读",
3641 "10ca916def8211d4": "输入配对码",
3642 + "a446e3bda256c2b3": "连接以进行交互",
3643 "d0bda35aeec66684": [
3644 "正在从 ",
3645 {
@@ -3646,7 +3650,6 @@
3650 " 读取…"
3651 ],
3652 "c3e8cd9bf44e2f43": "正在显示之前读取的内容。",
3649 - "a446e3bda256c2b3": "连接以进行交互",
3653 "eb6e0584cf4a2a1d": "语言:{language}",
3654 "d76c606a3c519b78": "取消自动换行",
3655 "2b683498cee8c8a7": "自动换行",
@@ -3973,6 +3976,7 @@
3976 "6a116665c8d9ad75": "关闭侧聊",
3977 "a5e57fdfde50aade": "添加到对话",
3978 "492a438bf9dbd45d": "这段侧聊已删除。",
3979 + "255a537ab23ddd2d": "这个会话已不可用。",
3980 "7350aa3df15b9802": "技能 {label}",
3981 "9ff9f24d1568fbaf": "这个技能没有描述。",
3982 "274e087f814611a7": "查看说明",
@@ -4200,9 +4204,9 @@
4204 "5e7eb0f2952de1b2": "已被替代",
4205 "59bcb9db3f0f59ea": "闲置",
4206 "94124ad2133e3aed": "未知",
4203 - "1a6f6154d1cb51a9": "在此对话中打开侧聊",
4207 + "000646e27e304b8b": "打开侧聊",
4208 "56567586cbe00c86": "在此对话中打开上下文转移",
4205 - "7fe7d5ae5fb4a655": "在此对话中打开子智能体",
4209 + "405e76cdd602bbcf": "打开子智能体",
4210 "520c15dbd507b804": "在此对话中打开父智能体",
4211 "309b160785f6c473": "在此对话中打开分叉",
4212 "6676cd4b8299663f": "在此对话中打开父会话",
@@ -9847,6 +9851,7 @@
9851 "2407d5d61e7f7206": "富文本输入框",
9852 "64b8fd2c284c3137": "发送快捷键",
9853 "6163f91bddf474ae": "追加消息行为",
9854 + "425021487583cf8a": "子智能体和侧聊的打开位置",
9855 "856812e7e1fc445e": "聊天中的工具调用",
9856 "216ed20b6f40fa6f": "屏幕阅读器播报",
9857 "0ce04933a7047deb": "屏幕阅读器窗口标题",
@@ -9904,6 +9909,12 @@
9909 "1ea00f7b1a88ee2e": "重置后续消息行为为默认值",
9910 "845e7f34c156ffd4": "加入队列",
9911 "81a74689d0319316": "引导当前执行",
9912 + "6dc57547546cbe96": "子智能体和侧聊",
9913 + "ffbc33f6b6ddc689": "单击时子智能体、侧聊或关联环境中的会话在哪里打开。按住 {modifier} 单击或中键单击会改为在主视图中打开。",
9914 + "7b7062c4b277e235": "单击时子智能体、侧聊或关联环境中的会话在哪里打开。按住 {modifier} 单击或中键单击会改为在侧边面板中打开。",
9915 + "1eba4b1f5ae00974": "将子智能体和侧聊的打开位置重置为默认值",
9916 + "f8062ccf65d4bb2a": "侧边面板",
9917 + "a8072bdf7ae4a288": "主视图",
9918 "162108e16ed96771": "屏幕阅读器",
9919 "18807e775248380c": "隐藏智能体执行的命令、编辑和搜索。“隐藏成功的调用”仍保留失败项;“专注模式”仅显示最终回答。审批、提问和错误始终显示。",
9920 "5848a9c1d77f45b2": "重置聊天中的工具调用为默认值",
@@ -9987,6 +9998,8 @@
9998 "b9ebecdb8db71466": "系统默认使用浏览器或操作系统的时钟偏好。",
9999 "62f8a7774dc1ffb7": "加入队列",
10000 "c711b55bc1500f08": "引导当前执行",
10001 + "e79128045796685d": "侧边面板",
10002 + "d81dc62319ba223e": "主视图",
10003 "54139af0114a2729": "红色与绿色(默认)",
10004 "8d4a851d370639e4": "蓝色与橙色",
10005 "b1d7c1ea891b7db5": "展开",
@@ -11625,6 +11638,7 @@
11638 "ade91c8927c48175": "输入框 富文本 tiptap 粗体 斜体 markdown 样式 所见即所得",
11639 "34d74827c2a8b009": "enter 回车 command ctrl 多行 提示词 换行 输入框",
11640 "9d1013084c46ecce": "排队 引导 运行中 轮次 发送 默认行为 输入框",
11641 + "e5e7f5e1fb1f2e4c": "子智能体 侧聊 关联会话 单击 右侧面板 侧边面板 主视图 command ctrl 中键单击",
11642 "5b8b854de7ee6f4d": "已安装 cli 版本 更新 可用 codex claude cursor grok fx kiro opencode",
11643 "64f12530d55d2ad1": "恢复 运行中 活跃 中断 工作 重启 重新启动 机器 崩溃 桌面 更新 自动",
11644 "214a98497c4ed05d": "caffeinate 睡眠 阻止 保持唤醒 电源 笔记本 盖子 抑制",
apps/web/src/lib/assistantCitationNavigation.test.ts
+1 -1
@@ -175,5 +175,5 @@ function expectSideChatRevealedOnParent(router: ReturnType<typeof createCitation
175 useRightPanelStore.getState().byThreadKey,
176 scopeThreadRef(citation.environmentId, parentThreadId),
177 ),
178 - ).toMatchObject({ kind: "side-chat", threadId: sideChatCitation.threadId });
178 + ).toMatchObject({ kind: "thread", threadId: sideChatCitation.threadId });
179 }
apps/web/src/lib/assistantCitationNavigation.ts
+1 -1
@@ -109,7 +109,7 @@ export function revealSideChatCitation(
109 }
110 useRightPanelStore
111 .getState()
112 - .openSideChat(scopeThreadRef(citation.environmentId, parentThreadId), citation.threadId);
112 + .openThread(scopeThreadRef(citation.environmentId, parentThreadId), citation.threadId);
113 if (routeThreadRef.threadId === parentThreadId) return;
114 return router.navigate({
115 to: "/$environmentId/$threadId",
apps/web/src/lib/sideChatPane.test.ts
+28 -2
@@ -3,7 +3,8 @@ import { EnvironmentId, ThreadId } from "@t3tools/contracts";
3 import { expect, it } from "vite-plus/test";
4
5 import { selectActiveRightPanelSurface, useRightPanelStore } from "../rightPanelStore";
6 -import { resolveThreadOpenRoute } from "./sideChatPane";
6 +import { selectThreadRightPanelState } from "../rightPanelStore";
7 +import { openSideThread, resolveThreadOpenRoute } from "./sideChatPane";
8
9 const environmentId = EnvironmentId.make("environment:test");
10 const mainRef = scopeThreadRef(environmentId, ThreadId.make("main"));
@@ -18,10 +19,35 @@ it("routes a side chat to its parent with the side chat tab active", () => {
19 expect(route).toEqual(mainRef);
20 expect(
21 selectActiveRightPanelSurface(useRightPanelStore.getState().byThreadKey, mainRef)?.id,
21 - ).toBe("side-chat:side-chat");
22 + ).toBe("thread:side-chat");
23 expect(
24 resolveThreadOpenRoute(mainRef, {
25 lineage: { sideChat: false, parentThreadId: null } as never,
26 }),
27 ).toBe(mainRef);
28 });
29 +
30 +it("opens a side thread beside the thread the click was in, or in its place", () => {
31 + useRightPanelStore.setState(useRightPanelStore.getInitialState());
32 + const navigated: unknown[] = [];
33 + const open = (
34 + input: Pick<Parameters<typeof openSideThread>[0], "threadRef" | "panelRef" | "intent">,
35 + ) => openSideThread({ ...input, navigate: (ref) => void navigated.push(ref) });
36 + const surfaces = () =>
37 + selectThreadRightPanelState(useRightPanelStore.getState().byThreadKey, mainRef).surfaces;
38 +
39 + expect(open({ threadRef: sideChatRef, panelRef: mainRef, intent: "primary" })).toBe("panel");
40 + expect(surfaces().map((surface) => surface.id)).toEqual(["thread:side-chat"]);
41 + expect(navigated).toEqual([]);
42 +
43 + expect(open({ threadRef: sideChatRef, panelRef: mainRef, intent: "alternate" })).toBe("main");
44 + expect(navigated).toEqual([sideChatRef]);
45 +
46 + // No panel shows a thread beside itself, of another environment, or where there is none.
47 + const elsewhere = scopeThreadRef(EnvironmentId.make("environment:other"), sideChatRef.threadId);
48 + expect(open({ threadRef: mainRef, panelRef: mainRef, intent: "panel" })).toBe("main");
49 + expect(open({ threadRef: elsewhere, panelRef: mainRef, intent: "panel" })).toBe("main");
50 + expect(open({ threadRef: sideChatRef, panelRef: null, intent: "panel" })).toBe("main");
51 + expect(navigated).toEqual([sideChatRef, mainRef, elsewhere, sideChatRef]);
52 + expect(surfaces()).toHaveLength(1);
53 +});
apps/web/src/lib/sideChatPane.ts
+82 -4
@@ -1,8 +1,21 @@
1 import { scopeThreadRef } from "@t3tools/client-runtime/environment";
2 -import type { OrchestrationV2ThreadShell, ScopedThreadRef } from "@t3tools/contracts";
2 +import {
3 + resolveSideThreadOpenTarget,
4 + type SideThreadOpenIntent,
5 +} from "@t3tools/client-runtime/side-thread";
6 +import type {
7 + OrchestrationV2ThreadShell,
8 + ScopedThreadRef,
9 + SideThreadOpenTarget,
10 +} from "@t3tools/contracts";
11
12 import type { ToolCallDiffTarget } from "../diffPanelStore";
5 -import { useRightPanelStore } from "../rightPanelStore";
13 +import type { LinkedThreadTarget } from "@t3tools/client-runtime/linked-thread";
14 +import type { useNavigate } from "@tanstack/react-router";
15 +
16 +import { getClientSettings } from "../hooks/useSettings";
17 +import { linkedThreadRouteParams } from "../linkedThreadSurface";
18 +import { rightPanelHostRef, useRightPanelStore } from "../rightPanelStore";
19
20 /** Whether an event started in the side chat pane (`data-side-chat-pane`), which the main chat ignores. */
21 export function isInSideChatPane(target: EventTarget | null): boolean {
@@ -10,11 +23,13 @@ export function isInSideChatPane(target: EventTarget | null): boolean {
23 }
24
25 /**
13 - * Opens an embedded side chat's tool diffs in its parent's diff panel and runs its shell commands
26 + * Opens an embedded side thread's tool diffs in its parent's diff panel and runs its shell commands
27 * in the parent's terminal drawer, since the embedded view hides its own. Other panel actions reach
28 * the parent through `hostRightPanel`; diff selection and the drawer are not panel state.
29 */
30 export interface SideChatParentPanel {
31 + /** The thread whose panel shows the embedded one. */
32 + readonly hostRef: ScopedThreadRef;
33 readonly openToolDiff: (target: ToolCallDiffTarget) => void;
34 readonly runShellCommand: (command: string) => void;
35 }
@@ -30,6 +45,69 @@ export function resolveThreadOpenRoute(
45 const parentThreadId = thread?.lineage.sideChat === true ? thread.lineage.parentThreadId : null;
46 if (parentThreadId === null) return threadRef;
47 const parentRef = scopeThreadRef(threadRef.environmentId, parentThreadId);
33 - useRightPanelStore.getState().openSideChat(parentRef, threadRef.threadId);
48 + useRightPanelStore.getState().openThread(parentRef, threadRef.threadId);
49 return parentRef;
50 }
51 +
52 +/**
53 + * Whether `panelRef`'s right panel can show `threadRef` as a tab: a thread of the same environment
54 + * that is not the one the panel belongs to.
55 + */
56 +function canOpenThreadInPanel(
57 + threadRef: ScopedThreadRef,
58 + panelRef: ScopedThreadRef | null,
59 +): panelRef is ScopedThreadRef {
60 + if (panelRef === null) return false;
61 + const host = rightPanelHostRef(panelRef);
62 + return host.environmentId === threadRef.environmentId && host.threadId !== threadRef.threadId;
63 +}
64 +
65 +/**
66 + * Opens a side chat or subagent where the click asked: as a tab beside `panelRef`, the thread the
67 + * click happened in, or on the main screen through `navigate`. Returns where it went.
68 + */
69 +export function openSideThread(input: {
70 + readonly threadRef: ScopedThreadRef;
71 + readonly panelRef: ScopedThreadRef | null;
72 + readonly intent: SideThreadOpenIntent;
73 + readonly navigate: (threadRef: ScopedThreadRef) => void;
74 +}): SideThreadOpenTarget {
75 + const { threadRef, panelRef } = input;
76 + const target = resolveSideThreadOpenTarget({
77 + preference: getClientSettings().sideThreadOpenTarget,
78 + intent: input.intent,
79 + panelAvailable: canOpenThreadInPanel(threadRef, panelRef),
80 + });
81 + if (target === "panel" && panelRef !== null) {
82 + useRightPanelStore.getState().openThread(panelRef, threadRef.threadId);
83 + } else {
84 + input.navigate(threadRef);
85 + }
86 + return target;
87 +}
88 +
89 +/**
90 + * Opens the read-only view of a linked environment's thread where the click asked: as a tab in
91 + * `panelRef`'s right panel, or on the main screen, which is also where it goes without a panel.
92 + */
93 +export function openLinkedThreadRead(input: {
94 + readonly panelRef: ScopedThreadRef | null;
95 + readonly target: LinkedThreadTarget;
96 + readonly intent: SideThreadOpenIntent;
97 + readonly navigate: ReturnType<typeof useNavigate>;
98 +}) {
99 + const { panelRef, target } = input;
100 + const place = resolveSideThreadOpenTarget({
101 + preference: getClientSettings().sideThreadOpenTarget,
102 + intent: input.intent,
103 + panelAvailable: panelRef !== null,
104 + });
105 + if (place === "panel" && panelRef !== null) {
106 + useRightPanelStore.getState().openLinkedThread(panelRef, target);
107 + return;
108 + }
109 + void input.navigate({
110 + to: "/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId",
111 + params: linkedThreadRouteParams(target),
112 + });
113 +}
apps/web/src/linkedThreadSurface.ts
+11
@@ -53,3 +53,14 @@ export function linkedThreadTitle(
53 ): string {
54 return surface.title?.trim() || fallback;
55 }
56 +
57 +/** The main-screen route of a linked environment's thread, read through `viaEnvironmentId`. */
58 +export function linkedThreadRouteParams(
59 + target: Pick<LinkedThreadTarget, "viaEnvironmentId" | "environmentId" | "threadId">,
60 +) {
61 + return {
62 + viaEnvironmentId: target.viaEnvironmentId,
63 + linkedEnvironmentId: target.environmentId,
64 + linkedThreadId: target.threadId,
65 + };
66 +}
apps/web/src/reopenClosedView.ts
+2 -2
@@ -161,8 +161,8 @@ export async function reopenClosedView(
161 case "issue":
162 panels.openIssue(ref, surface);
163 break;
164 - case "side-chat":
165 - panels.openSideChat(ref, surface.threadId);
164 + case "thread":
165 + panels.openThread(ref, surface.threadId);
166 break;
167 case "linked-thread":
168 panels.openLinkedThread(ref, surface);
apps/web/src/rightPanelStore.test.ts
+38
@@ -595,6 +595,44 @@ describe("rightPanelStore", () => {
595 });
596 });
597
598 + it("opens a side chat or subagent once per thread, and never the panel's own thread", () => {
599 + const store = useRightPanelStore.getState();
600 + const child = ThreadId.make("child");
601 + store.openThread(refA, child);
602 + store.open(refA, "diff");
603 + store.openThread(refA, child);
604 + store.openThread(refA, refA.threadId);
605 + const panel = selectThreadRightPanelState(useRightPanelStore.getState().byThreadKey, refA);
606 + expect(panel.surfaces.map((surface) => surface.id)).toEqual(["thread:child", "diff"]);
607 + expect(panel.activeSurfaceId).toBe("thread:child");
608 + });
609 +
610 + it("keeps side chat tabs saved before they became thread surfaces", () => {
611 + const migrated = migratePersistedRightPanelState({
612 + byThreadKey: {
613 + "env-1:thread-A": {
614 + isOpen: true,
615 + activeSurfaceId: "side-chat:side",
616 + surfaces: [
617 + { id: "diff", kind: "diff" },
618 + { id: "side-chat:side", kind: "side-chat", threadId: "side" },
619 + { id: "side-chat:gone", kind: "side-chat" },
620 + { id: "thread:stale", kind: "thread", threadId: "sub" },
621 + ],
622 + },
623 + },
624 + });
625 + expect(selectThreadRightPanelState(migrated.byThreadKey, refA)).toEqual({
626 + isOpen: true,
627 + activeSurfaceId: "thread:side",
628 + surfaces: [
629 + { id: "diff", kind: "diff" },
630 + { id: "thread:side", kind: "thread", threadId: "side" },
631 + { id: "thread:sub", kind: "thread", threadId: "sub" },
632 + ],
633 + });
634 + });
635 +
636 it("drops the legacy singleton terminal surface during migration", () => {
637 expect(
638 migratePersistedRightPanelState({
apps/web/src/rightPanelStore.ts
+46 -12
@@ -30,7 +30,7 @@ const RIGHT_PANEL_KINDS = [
30 "pull-request",
31 "pull-requests",
32 "issue",
33 - "side-chat",
33 + "thread",
34 "linked-thread",
35 ] as const;
36 export type RightPanelKind = (typeof RIGHT_PANEL_KINDS)[number];
@@ -103,12 +103,34 @@ export type RightPanelSurface =
103 key: string;
104 url?: string;
105 }
106 - | { id: `side-chat:${string}`; kind: "side-chat"; threadId: ThreadId }
106 + /**
107 + * A thread of the panel's environment shown beside it: a side chat or a subagent. Which one is
108 + * the thread's own lineage, so the surface only names it.
109 + */
110 + | ThreadSurface
111 /** A linked environment's thread, read through `viaEnvironmentId`; it has no thread here. */
112 | LinkedThreadSurface;
113
114 +export type ThreadSurface = { id: `thread:${string}`; kind: "thread"; threadId: ThreadId };
115 +
116 +const threadSurface = (threadId: ThreadId): ThreadSurface => ({
117 + id: `thread:${threadId}`,
118 + kind: "thread",
119 + threadId,
120 +});
121 +
122 +/**
123 + * A saved thread surface with its id rebuilt, or null when it names no thread. Builds before
124 + * subagents opened here saved it as `side-chat`.
125 + */
126 +export function decodeThreadSurface(surface: object): ThreadSurface | null {
127 + const { kind, threadId } = surface as Record<string, unknown>;
128 + if ((kind !== "thread" && kind !== "side-chat") || typeof threadId !== "string") return null;
129 + return threadId === "" ? null : threadSurface(ThreadId.make(threadId));
130 +}
131 +
132 const RIGHT_PANEL_STORAGE_KEY = "t3code:right-panel-state:v2";
111 -const RIGHT_PANEL_STORAGE_VERSION = 15;
133 +const RIGHT_PANEL_STORAGE_VERSION = 16;
134
135 export const PULL_REQUESTS_PANEL_REF = scopeThreadRef(
136 EnvironmentId.make("pull-requests-panel"),
@@ -165,10 +187,11 @@ interface RightPanelStoreState {
187 ref: ScopedThreadRef,
188 kind: Exclude<
189 RightPanelKind,
168 - "file" | "terminal" | "pull-request" | "issue" | "side-chat" | "linked-thread"
190 + "file" | "terminal" | "pull-request" | "issue" | "thread" | "linked-thread"
191 >,
192 ) => void;
171 - openSideChat: (ref: ScopedThreadRef, threadId: ThreadId) => void;
193 + /** Opens a side chat or subagent of `ref`'s environment as a tab; `ref` itself has no tab. */
194 + openThread: (ref: ScopedThreadRef, threadId: ThreadId) => void;
195 openLinkedThread: (ref: ScopedThreadRef, target: LinkedThreadTarget) => void;
196 /** Records the title the linked environment gave, so the tab and a reopened one show it. */
197 setLinkedThreadTitle: (ref: ScopedThreadRef, surfaceId: string, title: string) => void;
@@ -238,7 +261,7 @@ interface RightPanelStoreState {
261 ref: ScopedThreadRef,
262 kind: Exclude<
263 RightPanelKind,
241 - "file" | "terminal" | "pull-request" | "issue" | "side-chat" | "linked-thread"
264 + "file" | "terminal" | "pull-request" | "issue" | "thread" | "linked-thread"
265 >,
266 ) => void;
267 setThreadPanelOpen: (
@@ -264,7 +287,7 @@ const DEFAULT_THREAD_PANEL_VISIBILITY: ThreadPanelVisibility = {
287 const singletonSurface = (
288 kind: Exclude<
289 RightPanelKind,
267 - "file" | "preview" | "terminal" | "pull-request" | "issue" | "side-chat" | "linked-thread"
290 + "file" | "preview" | "terminal" | "pull-request" | "issue" | "thread" | "linked-thread"
291 >,
292 ): RightPanelSurface => {
293 switch (kind) {
@@ -587,6 +610,10 @@ export function migratePersistedRightPanelState(persistedState: unknown): {
610 ? validThreadState.surfaces.flatMap<RightPanelSurface>((surface) => {
611 if (!surface || typeof surface !== "object") return [];
612 const kind = (surface as { kind?: string }).kind;
613 + if (kind === "thread" || kind === "side-chat") {
614 + const decoded = decodeThreadSurface(surface);
615 + return decoded === null ? [] : [decoded];
616 + }
617 // Also drops kinds this build does not know, such as one a newer build saved.
618 if (!(RIGHT_PANEL_KINDS as ReadonlyArray<unknown>).includes(kind)) return [];
619 if (surface.kind === "linked-thread") {
@@ -684,7 +711,12 @@ export function migratePersistedRightPanelState(persistedState: unknown): {
711 ];
712 })
713 : [];
687 - const rawActiveSurfaceId = validThreadState?.activeSurfaceId;
714 + const savedActiveSurfaceId = validThreadState?.activeSurfaceId;
715 + const rawActiveSurfaceId =
716 + typeof savedActiveSurfaceId === "string" &&
717 + savedActiveSurfaceId.startsWith("side-chat:")
718 + ? `thread:${savedActiveSurfaceId.slice("side-chat:".length)}`
719 + : savedActiveSurfaceId;
720 const persistedActiveSurfaceId = surfaces.some(
721 (surface) => surface.id === rawActiveSurfaceId,
722 )
@@ -840,11 +872,13 @@ export const useRightPanelStore = create<RightPanelStoreState>()(
872 );
873 }),
874 ),
843 - openSideChat: (ref, threadId) =>
875 + openThread: (ref, threadId) =>
876 set((state) =>
845 - userAction(state, scopedThreadKey(ref), (current) =>
846 - upsertSurface(current, { id: `side-chat:${threadId}`, kind: "side-chat", threadId }),
847 - ),
877 + rightPanelHostRef(ref).threadId === threadId
878 + ? state
879 + : userAction(state, scopedThreadKey(ref), (current) =>
880 + upsertSurface(current, threadSurface(threadId)),
881 + ),
882 ),
883 openLinkedThread: (ref, target) =>
884 set((state) =>
apps/web/src/routeTree.gen.ts
+25
@@ -53,6 +53,7 @@ import { Route as ChatSettingsAccessRouteImport } from './routes/_chat.settings.
53 import { Route as ChatSettingsAboutRouteImport } from './routes/_chat.settings.about'
54 import { Route as ChatDraftDraftIdRouteImport } from './routes/_chat.draft.$draftId'
55 import { Route as ChatEnvironmentIdThreadIdRouteImport } from './routes/_chat.$environmentId.$threadId'
56 +import { Route as ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRouteImport } from './routes/_chat.linked.$viaEnvironmentId.$linkedEnvironmentId.$linkedThreadId'
57
58 const WelcomeRoute = WelcomeRouteImport.update({
59 id: '/welcome',
@@ -279,6 +280,14 @@ const ChatEnvironmentIdThreadIdRoute =
280 path: '/$environmentId/$threadId',
281 getParentRoute: () => ChatRoute,
282 } as any)
283 +const ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRoute =
284 + ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRouteImport.update(
285 + {
286 + id: '/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId',
287 + path: '/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId',
288 + getParentRoute: () => ChatRoute,
289 + } as any,
290 + )
291
292 export interface FileRoutesByFullPath {
293 '/': typeof ChatIndexRoute
@@ -324,6 +333,7 @@ export interface FileRoutesByFullPath {
333 '/settings/voice': typeof ChatSettingsVoiceRoute
334 '/settings/worktrees': typeof ChatSettingsWorktreesRoute
335 '/threads/$environmentId/$threadId': typeof ThreadsEnvironmentIdThreadIdRoute
336 + '/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId': typeof ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRoute
337 }
338 export interface FileRoutesByTo {
339 '/approve-agent': typeof ApproveAgentRoute
@@ -369,6 +379,7 @@ export interface FileRoutesByTo {
379 '/settings/voice': typeof ChatSettingsVoiceRoute
380 '/settings/worktrees': typeof ChatSettingsWorktreesRoute
381 '/threads/$environmentId/$threadId': typeof ThreadsEnvironmentIdThreadIdRoute
382 + '/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId': typeof ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRoute
383 }
384 export interface FileRoutesById {
385 __root__: typeof rootRouteImport
@@ -416,6 +427,7 @@ export interface FileRoutesById {
427 '/_chat/settings/voice': typeof ChatSettingsVoiceRoute
428 '/_chat/settings/worktrees': typeof ChatSettingsWorktreesRoute
429 '/threads/$environmentId/$threadId': typeof ThreadsEnvironmentIdThreadIdRoute
430 + '/_chat/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId': typeof ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRoute
431 }
432 export interface FileRouteTypes {
433 fileRoutesByFullPath: FileRoutesByFullPath
@@ -463,6 +475,7 @@ export interface FileRouteTypes {
475 | '/settings/voice'
476 | '/settings/worktrees'
477 | '/threads/$environmentId/$threadId'
478 + | '/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId'
479 fileRoutesByTo: FileRoutesByTo
480 to:
481 | '/approve-agent'
@@ -508,6 +521,7 @@ export interface FileRouteTypes {
521 | '/settings/voice'
522 | '/settings/worktrees'
523 | '/threads/$environmentId/$threadId'
524 + | '/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId'
525 id:
526 | '__root__'
527 | '/_chat'
@@ -554,6 +568,7 @@ export interface FileRouteTypes {
568 | '/_chat/settings/voice'
569 | '/_chat/settings/worktrees'
570 | '/threads/$environmentId/$threadId'
571 + | '/_chat/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId'
572 fileRoutesById: FileRoutesById
573 }
574 export interface RootRouteChildren {
@@ -878,6 +893,13 @@ declare module '@tanstack/react-router' {
893 preLoaderRoute: typeof ChatEnvironmentIdThreadIdRouteImport
894 parentRoute: typeof ChatRoute
895 }
896 + '/_chat/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId': {
897 + id: '/_chat/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId'
898 + path: '/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId'
899 + fullPath: '/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId'
900 + preLoaderRoute: typeof ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRouteImport
901 + parentRoute: typeof ChatRoute
902 + }
903 }
904 }
905
@@ -954,6 +976,7 @@ interface ChatRouteChildren {
976 ChatIndexRoute: typeof ChatIndexRoute
977 ChatEnvironmentIdThreadIdRoute: typeof ChatEnvironmentIdThreadIdRoute
978 ChatDraftDraftIdRoute: typeof ChatDraftDraftIdRoute
979 + ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRoute: typeof ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRoute
980 }
981
982 const ChatRouteChildren: ChatRouteChildren = {
@@ -965,6 +988,8 @@ const ChatRouteChildren: ChatRouteChildren = {
988 ChatIndexRoute: ChatIndexRoute,
989 ChatEnvironmentIdThreadIdRoute: ChatEnvironmentIdThreadIdRoute,
990 ChatDraftDraftIdRoute: ChatDraftDraftIdRoute,
991 + ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRoute:
992 + ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRoute,
993 }
994
995 const ChatRouteWithChildren = ChatRoute._addFileChildren(ChatRouteChildren)
apps/web/src/routes/_chat.linked.$viaEnvironmentId.$linkedEnvironmentId.$linkedThreadId.tsx new
+21
@@ -0,0 +1,21 @@
1 +import { EnvironmentId, ThreadId } from "@t3tools/contracts";
2 +import { createFileRoute } from "@tanstack/react-router";
3 +
4 +import { LinkedThreadPage } from "../components/chat/LinkedThreadPage";
5 +
6 +// A thread on a linked environment this client is not connected to, read through `viaEnvironmentId`.
7 +// Its params are not named `environmentId` and `threadId`: those mean a thread this client can open.
8 +export const Route = createFileRoute(
9 + "/_chat/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId",
10 +)({
11 + component: function LinkedThreadRoute() {
12 + const params = Route.useParams();
13 + return (
14 + <LinkedThreadPage
15 + viaEnvironmentId={EnvironmentId.make(params.viaEnvironmentId)}
16 + environmentId={EnvironmentId.make(params.linkedEnvironmentId)}
17 + threadId={ThreadId.make(params.linkedThreadId)}
18 + />
19 + );
20 + },
21 +});
apps/web/src/state/linkedThreadView.ts
+54 -28
@@ -1,17 +1,19 @@
1 import { useAtom, useAtomSet, useAtomValue } from "@effect/atom-react";
2 import { scopedThreadKey, scopeThreadRef } from "@t3tools/client-runtime/environment";
3 +import type { SideThreadOpenIntent } from "@t3tools/client-runtime/side-thread";
4 import {
5 connectLinkedEnvironment,
6 type LinkedThreadOpen,
7 resolveLinkedThreadOpen,
8 } from "@t3tools/client-runtime/linked-thread";
9 import type { EnvironmentId, ScopedThreadRef, ThreadId } from "@t3tools/contracts";
9 -import { useNavigate } from "@tanstack/react-router";
10 +import { useNavigate, useRouter } from "@tanstack/react-router";
11 import { AsyncResult, Atom } from "effect/reactivity";
12
13 import type { TurnItemSource } from "../components/chat/timelineRowContext";
14 import { useRightPanelStore } from "../rightPanelStore";
15 import { connectPairing, reachesEnvironment } from "../connection/onboarding";
16 +import { openLinkedThreadRead } from "../lib/sideChatPane";
17 import type { LinkedThreadSurface } from "../linkedThreadSurface";
18 import { buildThreadRouteParams } from "../threadRoutes";
19 import { useEnvironment } from "./environments";
@@ -20,10 +22,9 @@ import { useEnvironmentQuery } from "./query";
22 import { useAtomCommand } from "./use-atom-command";
23
24 /**
23 - * How a click opens a thread that the thread `panelRef` says is on a linked environment: in place
24 - * when this client is connected there itself, else as a read-only tab in that thread's right
25 - * panel, read through its environment. Once the link is gone a saved environment opens in place,
26 - * where the client can reconnect to it; with neither, the tab says what to link again.
25 + * How a click opens a thread `panelRef` says is on a linked environment: in place when this client
26 + * is connected there, else read-only through `panelRef`'s environment, in its right panel or on
27 + * the main screen as the click asks. A saved environment whose link is gone opens in place.
28 */
29 export function useLinkedThreadOpener(
30 panelRef: ScopedThreadRef,
@@ -35,7 +36,10 @@ export function useLinkedThreadOpener(
36 }
37 | undefined,
38 title: string | null,
38 -): { readonly mode: Exclude<LinkedThreadOpen, "unavailable">; readonly open: () => void } | null {
39 +): {
40 + readonly mode: Exclude<LinkedThreadOpen, "unavailable">;
41 + readonly open: (intent: SideThreadOpenIntent) => void;
42 +} | null {
43 const navigate = useNavigate();
44 const viaEnvironmentId = panelRef.environmentId;
45 const own = useEnvironment(thread?.environmentId ?? null);
@@ -51,14 +55,19 @@ export function useLinkedThreadOpener(
55 const mode = resolved === "direct" ? "direct" : "linked";
56 return {
57 mode,
54 - open: () => {
58 + open: (intent) => {
59 if (mode === "linked") {
56 - useRightPanelStore.getState().openLinkedThread(panelRef, {
57 - viaEnvironmentId,
58 - environmentId: thread.environmentId,
59 - threadId: thread.threadId,
60 - label: own?.label ?? thread.label,
61 - title,
60 + openLinkedThreadRead({
61 + panelRef,
62 + target: {
63 + viaEnvironmentId,
64 + environmentId: thread.environmentId,
65 + threadId: thread.threadId,
66 + label: own?.label ?? thread.label,
67 + title,
68 + },
69 + intent,
70 + navigate,
71 });
72 return;
73 }
@@ -71,8 +80,9 @@ export function useLinkedThreadOpener(
80 }
81
82 type TabKey = readonly [
74 - panelEnvironmentId: EnvironmentId,
75 - panelThreadId: ThreadId,
83 + /** Null on the main screen, where no tab shows the title. */
84 + panelEnvironmentId: EnvironmentId | null,
85 + panelThreadId: ThreadId | null,
86 surfaceId: string,
87 viaEnvironmentId: EnvironmentId,
88 environmentId: EnvironmentId,
@@ -90,30 +100,36 @@ const targetOf = (
100 const tabViewAtom = Atom.family((key: string) => {
101 const [panelEnvironmentId, panelThreadId, surfaceId, viaEnvironmentId, environmentId, threadId] =
102 JSON.parse(key) as TabKey;
93 - const panelRef = scopeThreadRef(panelEnvironmentId, panelThreadId);
103 + const panelRef =
104 + panelEnvironmentId === null || panelThreadId === null
105 + ? null
106 + : scopeThreadRef(panelEnvironmentId, panelThreadId);
107 const view = peerLinkEnvironment.threadView(
108 targetOf({ viaEnvironmentId, environmentId, threadId }),
109 );
110 return Atom.make((get) => {
111 const live = get(view);
112 const title = AsyncResult.getOrElse(live, () => null)?.thread.projection?.thread.title;
100 - if (title) useRightPanelStore.getState().setLinkedThreadTitle(panelRef, surfaceId, title);
113 + if (title && panelRef !== null) {
114 + useRightPanelStore.getState().setLinkedThreadTitle(panelRef, surfaceId, title);
115 + }
116 return live;
117 }).pipe(Atom.setIdleTTL(0), Atom.withLabel(`linked-thread-tab-view:${key}`));
118 });
119
120 /**
106 - * The thread of `surface`, streamed through the environment that links to it for the tab in
107 - * `panelRef`'s panel. The stream runs only while `visible`; what it last showed stays.
121 + * The thread of `surface`, streamed through the environment that links to it, for the tab in
122 + * `panelRef`'s panel or, with null, the main screen. The stream runs only while `visible`; what
123 + * it last showed stays.
124 */
125 export function useLinkedThreadView(
110 - panelRef: ScopedThreadRef,
126 + panelRef: ScopedThreadRef | null,
127 surface: Pick<LinkedThreadSurface, "id" | "viaEnvironmentId" | "environmentId" | "threadId">,
128 visible: boolean,
129 ) {
130 const key: TabKey = [
115 - panelRef.environmentId,
116 - panelRef.threadId,
131 + panelRef?.environmentId ?? null,
132 + panelRef?.threadId ?? null,
133 surface.id,
134 surface.viaEnvironmentId,
135 surface.environmentId,
@@ -157,14 +173,16 @@ const linkedEnvironmentConnectAtom = Atom.family((key: string) =>
173
174 /**
175 * Connects this client to the environment `surface`'s thread lives in. One step when the linking
160 - * environment can get a pairing for this client: the thread then opens there and the tab closes.
161 - * Otherwise the add-environment dialog opens for that machine.
176 + * environment can get a pairing for this client: the thread then opens there, in place of the
177 + * read-only view. Otherwise the add-environment dialog opens for that machine. `panelRef` is the
178 + * thread whose panel shows the read, or null on the main screen.
179 */
180 export function useConnectLinkedEnvironment(
164 - panelRef: ScopedThreadRef,
181 + panelRef: ScopedThreadRef | null,
182 surface: LinkedThreadSurface,
183 ) {
184 const navigate = useNavigate();
185 + const router = useRouter();
186 const setPrefill = useAtomSet(addEnvironmentPrefillAtom);
187 const mayPair = useAtomValue(
188 peerLinkEnvironment.pairClient.permissionAtom(surface.viaEnvironmentId),
@@ -174,7 +192,9 @@ export function useConnectLinkedEnvironment(
192 const reaches = useAtomCommand(reachesEnvironment, quiet);
193 const pair = useAtomCommand(connectPairing, quiet);
194 const [state, setState] = useAtom(
177 - linkedEnvironmentConnectAtom(`${scopedThreadKey(panelRef)}:${surface.id}`),
195 + linkedEnvironmentConnectAtom(
196 + `${panelRef === null ? "main" : scopedThreadKey(panelRef)}:${surface.id}`,
197 + ),
198 );
199 const addWithCode = (prefill: AddEnvironmentPrefill) => {
200 setPrefill(prefill);
@@ -182,6 +202,9 @@ export function useConnectLinkedEnvironment(
202 };
203 const connect = async () => {
204 setState({ phase: "connecting" });
205 + const startedOn = router.state.location.href;
206 + // Pairing takes a moment; a user who has gone elsewhere since is not moved again.
207 + const stayed = () => router.state.location.href === startedOn;
208 const outcome = await connectLinkedEnvironment({
209 label: surface.label,
210 requestPairing: async () => {
@@ -213,10 +236,13 @@ export function useConnectLinkedEnvironment(
236 if (outcome.type === "connected") {
237 setState({ phase: "idle" });
238 // The thread opens where every thread on a connected environment does, so its tab is done.
216 - useRightPanelStore.getState().closeSurface(panelRef, surface.id);
239 + if (panelRef !== null) useRightPanelStore.getState().closeSurface(panelRef, surface.id);
240 + if (!stayed()) return outcome;
241 void navigate({
242 to: "/$environmentId/$threadId",
243 params: buildThreadRouteParams(scopeThreadRef(surface.environmentId, surface.threadId)),
244 + // The read-only page has nothing left to go back to.
245 + replace: panelRef === null,
246 });
247 return outcome;
248 }
@@ -226,7 +252,7 @@ export function useConnectLinkedEnvironment(
252 host: outcome.host,
253 };
254 setState({ phase: "manual", prefill });
229 - addWithCode(prefill);
255 + if (stayed()) addWithCode(prefill);
256 return outcome;
257 };
258 return { state, connect, addWithCode };
apps/web/src/threadRoutes.test.ts
+12
@@ -10,6 +10,7 @@ import { EMPTY_ENVIRONMENT_THREAD_STATE } from "@t3tools/client-runtime/state/th
10 import { ThreadId } from "@t3tools/contracts";
11 import * as DateTime from "effect/DateTime";
12 import * as Option from "effect/Option";
13 +import { linkedThreadRouteParams } from "./linkedThreadSurface";
14 import { makeThreadProjectionFixture } from "./test-fixtures";
15
16 import {
@@ -70,6 +71,17 @@ describe("threadRoutes", () => {
71 expect(isThreadRoutePathname(router.state.location.pathname, ref)).toBe(false);
72 });
73
74 + it("does not take a linked environment's thread route for a thread this client can open", () => {
75 + // The layout reads every match's params untyped, as here.
76 + const params: Record<string, string> = linkedThreadRouteParams({
77 + viaEnvironmentId: "env-1" as never,
78 + environmentId: "env-2" as never,
79 + threadId: ThreadId.make("thread-there"),
80 + });
81 +
82 + expect(resolveThreadRouteTarget(params)).toBeNull();
83 + });
84 +
85 it("resolves the backing thread while a draft route is being promoted", () => {
86 const target = resolveThreadRouteTarget({ draftId: "draft-1" });
87
apps/web/test/appScenarios.renders.tsx
+2 -2
@@ -443,7 +443,7 @@ it("app-switch-settings-section", async () => {
443 // Keep git scenarios last: the status they leave cached adds renders to later scenarios.
444 it("app-git-file-counts-with-side-chat", async () => {
445 using _clock = frozenClock();
446 - useRightPanelStore.getState().openSideChat(scopeThreadRef(ENVIRONMENT_ID, WARM), SIDE_CHAT.id);
446 + useRightPanelStore.getState().openThread(scopeThreadRef(ENVIRONMENT_ID, WARM), SIDE_CHAT.id);
447 await using _app = (await openThread(WARM)).screen;
448 await expect.element(lastAnswer(SIDE_CHAT.id)).toBeVisible();
449 const gitStatus = vcsEnvironment.status({
@@ -485,7 +485,7 @@ it("app-git-file-counts-with-side-chat", async () => {
485 // ChatView re-renders when the tree goes dirty or clean; the composer and side chat timeline should not.
486 it("app-git-status-updates-with-side-chat", async () => {
487 using _clock = frozenClock();
488 - useRightPanelStore.getState().openSideChat(scopeThreadRef(ENVIRONMENT_ID, WARM), SIDE_CHAT.id);
488 + useRightPanelStore.getState().openThread(scopeThreadRef(ENVIRONMENT_ID, WARM), SIDE_CHAT.id);
489 await using _app = (await openThread(WARM)).screen;
490 await expect.element(lastAnswer(SIDE_CHAT.id)).toBeVisible();
491 const local = (insertions: number) => ({
apps/web/test/fakeEnvironment.ts
+12 -8
@@ -227,6 +227,8 @@ function run(
227 export interface FakeThread {
228 /** Makes this a side chat of that thread. */
229 readonly sideChatOf?: ThreadId;
230 + /** Makes this a subagent the provider started under that thread, which takes no messages. */
231 + readonly providerSubagentOf?: ThreadId;
232 /** Makes this an older settled thread the shell leaves out; only its family read returns it. */
233 readonly olderSettled?: true;
234 readonly id: ThreadId;
@@ -309,6 +311,8 @@ export function threadWithQuestion(name: string, question: string): FakeThread {
311 };
312 }
313
314 +const parentOf = (thread: FakeThread) => thread.sideChatOf ?? thread.providerSubagentOf;
315 +
316 function shellOf(thread: FakeThread): OrchestrationV2ThreadShell {
317 const latest = thread.runs.at(-1);
318 const modelSelection = thread.modelSelection ?? MODEL;
@@ -325,14 +329,14 @@ function shellOf(thread: FakeThread): OrchestrationV2ThreadShell {
329 activeProviderThreadId: thread.providerThreads?.[0]?.id ?? null,
330 ...(thread.issues === undefined ? {} : { issues: thread.issues }),
331 lineage: {
328 - rootThreadId: thread.sideChatOf ?? thread.id,
329 - parentThreadId: thread.sideChatOf ?? null,
330 - relationshipToParent: null,
332 + rootThreadId: parentOf(thread) ?? thread.id,
333 + parentThreadId: parentOf(thread) ?? null,
334 + relationshipToParent: thread.providerSubagentOf ? "subagent" : null,
335 ...(thread.sideChatOf ? { sideChat: true } : {}),
336 },
337 forkedFrom: null,
334 - createdBy: "user",
335 - creationSource: "web",
338 + createdBy: thread.providerSubagentOf ? "agent" : "user",
339 + creationSource: thread.providerSubagentOf ? "provider" : "web",
340 latestRunId: latest?.id ?? null,
341 activeRunId: null,
342 // Idle reads as waiting on the user, which shows a per-second duration in the sidebar.
@@ -378,8 +382,8 @@ function projectionOf(thread: FakeThread): OrchestrationV2ThreadProjection {
382 activeProviderThreadId: shell.activeProviderThreadId,
383 lineage: shell.lineage,
384 forkedFrom: null,
381 - createdBy: "user",
382 - creationSource: "web",
385 + createdBy: shell.createdBy,
386 + creationSource: shell.creationSource,
387 createdAt: AT,
388 updatedAt: AT,
389 archivedAt: null,
@@ -525,7 +529,7 @@ const handlers: Record<string, (input: never) => unknown> = {
529 );
530 },
531 [ORCHESTRATION_V2_WS_METHODS.getThreadFamily]: (input: { readonly threadId: ThreadId }) => {
528 - const rootOf = (thread: FakeThread) => thread.sideChatOf ?? thread.id;
532 + const rootOf = (thread: FakeThread) => parentOf(thread) ?? thread.id;
533 const requested = threads.find((candidate) => candidate.id === input.threadId);
534 return Effect.succeed({
535 snapshotSequence: sequence,
docs/user/remote-access.md
+6 -2
@@ -483,8 +483,12 @@ You can read a thread on a linked machine without connecting this app to it. Ope
483 a task that was delegated there from the thread's agents, or a thread link that
484 points there, and the thread opens read-only, streamed through the machine you
485 are connected to over its link. It follows the thread live. On web and desktop
486 -it opens as a tab in the right panel, beside the thread you are in, and shows
487 -the same timeline as any other thread.
486 +it opens as a tab in the right panel, beside the thread you are in, or in the
487 +main view with ⌘/Ctrl-click, like
488 +[subagents and side chats](thread-sidebar.md#open-a-thread-beside-the-one-you-are-in).
489 +On mobile it opens in the inspector on layouts that have one, where Maximize
490 +fills the screen, and as its own screen elsewhere. It shows the same timeline as
491 +any other thread on web and desktop, and a shorter read-only list on mobile.
492
493 - The view is marked **Read-only** with both machines' names. To reply, approve
494 or stop the thread, choose **Connect to interact**. When the link has full
docs/user/thread-sidebar.md
+31 -2
@@ -269,7 +269,10 @@ the snooze. Enable **Snooze until limits reset** in thread behavior settings to
269 snooze limit stops by default. Providers without a reset time offer manual
270 retry and the normal snooze choices.
271
272 -On web and desktop, use **Agents** to follow work delegated to subagents.
272 +On web and desktop, use **Agents** to follow work delegated to subagents. Click
273 +a subagent there or on its conversation card to open it in the right panel,
274 +beside the thread you are in. See
275 +[Open a thread beside the one you are in](#open-a-thread-beside-the-one-you-are-in).
276 On mobile, open a subagent from its conversation card or **Agents**. On iOS
277 layouts with an inspector, its thread opens beside the parent. Maximize it to
278 fill the screen; close the full-screen view to return to the parent and inspector.
@@ -297,6 +300,31 @@ To choose what the thread details card shows, right-click the card or open
300 shortcuts, such as Open in editor and project scripts. **Reset to default** brings
301 back the standard rows.
302
303 +## Open a thread beside the one you are in
304 +
305 +On web and desktop, a subagent, a side chat, and a
306 +[thread on a linked machine](remote-access.md#read-a-linked-machines-threads)
307 +all open the same way. Click one to open it as a tab in the right panel, so the
308 +thread you are in stays in view. Hold ⌘ (Ctrl on Windows and Linux) while you
309 +click, or middle-click, to open it in the main view instead. With the keyboard,
310 +Enter and ⌘/Ctrl + Enter do the same. Right-click for **Open in side panel** and
311 +**Open in main view**.
312 +
313 +To make the main view the place a plain click opens them, set **Settings → Chat →
314 +Open subagents and side chats in** to **Main view**. The modifier then opens
315 +the side panel.
316 +
317 +From a tab, **Open in main view** at the top of the tab, or in the tab's
318 +right-click menu, moves it to the main view. The bottom of the view depends on
319 +the thread: a side chat or a subagent you delegated has a composer, a subagent
320 +the agent started is read-only, and a thread on a linked machine is read-only
321 +with **Connect to interact**.
322 +
323 +Other thread links open in the main view as before.
324 +
325 +On mobile these threads open in the inspector on layouts that have one, where
326 +Maximize fills the screen, and full screen everywhere else.
327 +
328 ## Side chats
329
330 A side chat lets you ask a question about a thread without adding to it. It starts
@@ -305,7 +333,8 @@ with what the thread knows, and the thread keeps working while you ask.
333 On web and desktop, start a message with `/side` or `/btw`, then your question.
334 You can also choose **Side chat** from the **+** menu in the right panel. The side
335 chat opens as a tab there, with its own composer. Side chats do not show in the
308 -sidebar. Find one again under **Side chats** in thread details.
336 +sidebar. Find one again under **Side chats** in thread details, where it opens
337 +[like a subagent does](#open-a-thread-beside-the-one-you-are-in).
338
339 A side chat works in the same folder as the thread and starts with the permissions,
340 model, and reasoning level shown in the thread's composer, including for its first
packages/client-runtime/package.json
+4
@@ -115,6 +115,10 @@
115 "types": "./src/linkedThread.ts",
116 "default": "./src/linkedThread.ts"
117 },
118 + "./side-thread": {
119 + "types": "./src/sideThread.ts",
120 + "default": "./src/sideThread.ts"
121 + },
122 "./scheduled-task-webhook": {
123 "types": "./src/scheduledTaskWebhook.ts",
124 "default": "./src/scheduledTaskWebhook.ts"
packages/client-runtime/src/sideThread.test.ts new
+108
@@ -0,0 +1,108 @@
1 +import { ThreadId } from "@t3tools/contracts";
2 +import { describe, expect, it } from "vite-plus/test";
3 +
4 +import {
5 + resolveMobileSideThreadPresentation,
6 + resolveSideThreadOpenTarget,
7 + sideThreadComposer,
8 + sideThreadKindOf,
9 + sideThreadOpenIntentOf,
10 +} from "./sideThread.ts";
11 +
12 +const parentThreadId = ThreadId.make("parent");
13 +const lineage = (
14 + overrides: Partial<{
15 + parentThreadId: ThreadId | null;
16 + relationshipToParent: "fork" | "subagent" | null;
17 + sideChat: boolean;
18 + }>,
19 +) => ({
20 + lineage: {
21 + rootThreadId: parentThreadId,
22 + parentThreadId,
23 + relationshipToParent: null,
24 + forkedFrom: null,
25 + ...overrides,
26 + },
27 +});
28 +
29 +describe("sideThreadKindOf", () => {
30 + it.each([
31 + ["a side chat", lineage({ relationshipToParent: "fork", sideChat: true }), "side-chat"],
32 + ["an app subagent", { ...lineage({ relationshipToParent: "subagent" }) }, "subagent"],
33 + [
34 + "a provider's own subagent",
35 + { ...lineage({ relationshipToParent: "subagent" }), creationSource: "provider" as const },
36 + "provider-subagent",
37 + ],
38 + ["a fork", lineage({ relationshipToParent: "fork" }), null],
39 + ["a top-level thread", lineage({ parentThreadId: null }), null],
40 + // The flag alone does not make a tab: a side chat is beside some thread.
41 + ["a side chat with no parent", lineage({ parentThreadId: null, sideChat: true }), null],
42 + ])("classifies %s", (_name, thread, kind) => {
43 + expect(sideThreadKindOf(thread as Parameters<typeof sideThreadKindOf>[0])).toBe(kind);
44 + });
45 +
46 + it("treats a thread that is not loaded as an ordinary one", () => {
47 + expect(sideThreadKindOf(null)).toBeNull();
48 + });
49 +});
50 +
51 +describe("sideThreadComposer", () => {
52 + it.each([
53 + ["side-chat", "composer"],
54 + ["subagent", "composer"],
55 + ["provider-subagent", "read-only"],
56 + ["linked", "read-only-connect"],
57 + ] as const)("gives %s the %s", (kind, composer) => {
58 + expect(sideThreadComposer(kind)).toBe(composer);
59 + });
60 +});
61 +
62 +describe("resolveSideThreadOpenTarget", () => {
63 + it.each([
64 + // preference, intent, panelAvailable, target
65 + ["panel", "primary", true, "panel"],
66 + ["panel", "alternate", true, "main"],
67 + ["main", "primary", true, "main"],
68 + ["main", "alternate", true, "panel"],
69 + // The context menu names a place, whatever the preference.
70 + ["panel", "main", true, "main"],
71 + ["main", "panel", true, "panel"],
72 + // With no panel to open in, every way of asking lands on the main view.
73 + ["panel", "primary", false, "main"],
74 + ["main", "alternate", false, "main"],
75 + ["main", "panel", false, "main"],
76 + ] as const)(
77 + "prefers %s, asked %s, panel %s: opens in %s",
78 + (preference, intent, panelAvailable, target) => {
79 + expect(resolveSideThreadOpenTarget({ preference, intent, panelAvailable })).toBe(target);
80 + },
81 + );
82 +});
83 +
84 +describe("sideThreadOpenIntentOf", () => {
85 + const plain = { metaKey: false, ctrlKey: false, button: 0 };
86 +
87 + it("takes the platform's modifier and the middle button as the other place", () => {
88 + expect(sideThreadOpenIntentOf(plain, true)).toBe("primary");
89 + expect(sideThreadOpenIntentOf({ ...plain, metaKey: true }, true)).toBe("alternate");
90 + expect(sideThreadOpenIntentOf({ ...plain, ctrlKey: true }, false)).toBe("alternate");
91 + expect(sideThreadOpenIntentOf({ ...plain, button: 1 }, false)).toBe("alternate");
92 + // A key press has no button.
93 + expect(sideThreadOpenIntentOf({ metaKey: true, ctrlKey: false }, true)).toBe("alternate");
94 + });
95 +
96 + it("ignores the other platform's modifier", () => {
97 + // Ctrl-click on macOS is the context menu, and the Windows key is not Ctrl.
98 + expect(sideThreadOpenIntentOf({ ...plain, ctrlKey: true }, true)).toBe("primary");
99 + expect(sideThreadOpenIntentOf({ ...plain, metaKey: true }, false)).toBe("primary");
100 + });
101 +});
102 +
103 +describe("resolveMobileSideThreadPresentation", () => {
104 + it("uses the inspector wherever the layout has one, else the full screen", () => {
105 + expect(resolveMobileSideThreadPresentation({ inspectorAvailable: true })).toBe("inspector");
106 + expect(resolveMobileSideThreadPresentation({ inspectorAvailable: false })).toBe("full-screen");
107 + });
108 +});
packages/client-runtime/src/sideThread.ts new
+94
@@ -0,0 +1,94 @@
1 +import type { OrchestrationV2AppThread, SideThreadOpenTarget } from "@t3tools/contracts";
2 +
3 +/**
4 + * A thread that opens beside the one you are in. `linked` lives on a linked environment this client
5 + * has no connection to; the others are threads of a connected environment.
6 + */
7 +export type SideThreadKind = "side-chat" | "subagent" | "provider-subagent" | "linked";
8 +
9 +/**
10 + * Which side thread `thread` is, or null for a thread that opens like any other. A row that does
11 + * not carry how the thread was created cannot tell a provider's own subagent from the app's.
12 + */
13 +export function sideThreadKindOf(
14 + thread:
15 + | (Pick<OrchestrationV2AppThread, "lineage"> &
16 + Partial<Pick<OrchestrationV2AppThread, "creationSource">>)
17 + | null
18 + | undefined,
19 +): Exclude<SideThreadKind, "linked"> | null {
20 + if (!thread) return null;
21 + if (thread.lineage.sideChat === true && thread.lineage.parentThreadId !== null) {
22 + return "side-chat";
23 + }
24 + if (thread.lineage.relationshipToParent !== "subagent") return null;
25 + return thread.creationSource === "provider" ? "provider-subagent" : "subagent";
26 +}
27 +
28 +export type SideThreadComposer =
29 + /** The normal composer. */
30 + | "composer"
31 + /** A bar that says the thread takes no messages. */
32 + | "read-only"
33 + /** The same bar, offering to connect to the environment the thread is on. */
34 + | "read-only-connect";
35 +
36 +/** What stands at the bottom of a side thread, in the panel and on the main screen alike. */
37 +export function sideThreadComposer(kind: SideThreadKind): SideThreadComposer {
38 + switch (kind) {
39 + case "linked":
40 + return "read-only-connect";
41 + case "provider-subagent":
42 + return "read-only";
43 + case "side-chat":
44 + case "subagent":
45 + return "composer";
46 + }
47 +}
48 +
49 +/**
50 + * How the user asked to open a side thread: a plain click or Enter, the same with the modifier
51 + * (or a middle click), or one of the two places named outright, as a context menu does.
52 + */
53 +export type SideThreadOpenIntent = "primary" | "alternate" | SideThreadOpenTarget;
54 +
55 +/**
56 + * Where a side thread opens. The preference names the plain click's place and the modifier takes
57 + * the other; without a panel to open in, everything goes to the main view.
58 + */
59 +export function resolveSideThreadOpenTarget(input: {
60 + readonly preference: SideThreadOpenTarget;
61 + readonly intent: SideThreadOpenIntent;
62 + readonly panelAvailable: boolean;
63 +}): SideThreadOpenTarget {
64 + if (!input.panelAvailable) return "main";
65 + switch (input.intent) {
66 + case "primary":
67 + return input.preference;
68 + case "alternate":
69 + return input.preference === "panel" ? "main" : "panel";
70 + default:
71 + return input.intent;
72 + }
73 +}
74 +
75 +/** The intent of a click, an auxiliary click or a key press on a side thread's row. */
76 +export function sideThreadOpenIntentOf(
77 + event: {
78 + readonly metaKey: boolean;
79 + readonly ctrlKey: boolean;
80 + /** Absent on key events. */
81 + readonly button?: number;
82 + },
83 + mac: boolean,
84 +): Extract<SideThreadOpenIntent, "primary" | "alternate"> {
85 + if (event.button === 1) return "alternate";
86 + return (mac ? event.metaKey : event.ctrlKey) ? "alternate" : "primary";
87 +}
88 +
89 +/** Where a side thread opens on mobile: the inspector pane where the layout has one. */
90 +export function resolveMobileSideThreadPresentation(input: {
91 + readonly inspectorAvailable: boolean;
92 +}): "inspector" | "full-screen" {
93 + return input.inspectorAvailable ? "inspector" : "full-screen";
94 +}
packages/contracts/src/settings.ts
+11
@@ -315,6 +315,13 @@ export {
315 export const BrowserLinkTarget = Schema.Literals(["system", "app"]);
316 export type BrowserLinkTarget = typeof BrowserLinkTarget.Type;
317 export const DEFAULT_BROWSER_LINK_TARGET: BrowserLinkTarget = "system";
318 +/**
319 + * Where a plain click opens a subagent, a side chat or a linked environment's thread: beside the
320 + * thread you are in, or in its place. A modified click opens it in the other one.
321 + */
322 +export const SideThreadOpenTarget = Schema.Literals(["panel", "main"]);
323 +export type SideThreadOpenTarget = typeof SideThreadOpenTarget.Type;
324 +const DEFAULT_SIDE_THREAD_OPEN_TARGET: SideThreadOpenTarget = "panel";
325 /**
326 * What the address bar searches with when the input is not an address.
327 * "custom" uses `browserCustomSearchUrl`, a template with `%s` for the query.
@@ -525,6 +532,9 @@ export const ClientSettingsSchema = Schema.Struct({
532 followUpBehavior: Schema.Literals(["queue", "steer"]).pipe(
533 Schema.withDecodingDefault(Effect.succeed("steer")),
534 ),
535 + sideThreadOpenTarget: SideThreadOpenTarget.pipe(
536 + Schema.withDecodingDefault(Effect.succeed(DEFAULT_SIDE_THREAD_OPEN_TARGET)),
537 + ),
538 proactivePanelsEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
539 showSkillsInSlashMenu: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
540 boringSidebarEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
@@ -2101,6 +2111,7 @@ export const ClientSettingsPatch = Schema.Struct({
2111 composerRichTextEnabled: Schema.optionalKey(Schema.Boolean),
2112 sendShortcut: Schema.optionalKey(Schema.Literals(["enter", "mod-enter-multiline", "mod-enter"])),
2113 followUpBehavior: Schema.optionalKey(Schema.Literals(["queue", "steer"])),
2114 + sideThreadOpenTarget: Schema.optionalKey(SideThreadOpenTarget),
2115 proactivePanelsEnabled: Schema.optionalKey(Schema.Boolean),
2116 showSkillsInSlashMenu: Schema.optionalKey(Schema.Boolean),
2117 boringSidebarEnabled: Schema.optionalKey(Schema.Boolean),