From a5d97b43e1f76a1c36f4a9440a7dd3571265277a Mon Sep 17 00:00:00 2001 From: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Date: Thu, 19 Nov 2026 19:51:59 -0800 Subject: [PATCH 1/4] feat(web): subagents, side chats and linked threads open the same way A plain click on a subagent, a side chat or a linked environment's read-only thread opens it as a tab in the right panel. The modifier, a middle click and the context menu open it on the main screen, and a client setting swaps the two. The side-chat panel surface becomes a general thread surface, shown by one pane with a shared header. A linked thread gets a read-only main-screen route. Co-Authored-By: Claude Fable 5.2 --- .../settings/DesktopClientSettings.test.ts | 1 + apps/web/src/closedViewStore.test.ts | 8 +- apps/web/src/closedViewStore.ts | 17 +- .../src/components/ChatView.browser.test.tsx | 50 +++- apps/web/src/components/ChatView.tsx | 19 +- .../components/ReopenClosedViewShortcut.tsx | 8 +- apps/web/src/components/RightPanelTabs.tsx | 43 ++- apps/web/src/components/ThreadRouteView.tsx | 2 +- .../src/components/chat/LinkedThreadPage.tsx | 65 +++++ .../src/components/chat/LinkedThreadPane.tsx | 106 ++++--- .../chat/MarkdownThreadLink.browser.test.tsx | 10 + .../components/chat/MarkdownThreadLink.tsx | 38 ++- .../chat/MessagesTimeline.browser.test.tsx | 3 +- .../src/components/chat/MessagesTimeline.tsx | 3 + .../chat/ReadOnlyThreadTimeline.tsx | 75 ++--- .../chat/RightPanelSurfaceContent.tsx | 9 +- apps/web/src/components/chat/SideChatPane.tsx | 166 ----------- .../src/components/chat/SideThreadPane.tsx | 261 ++++++++++++++++++ .../chat/ThreadLineageWorkflowRow.tsx | 9 +- ...hreadRelationshipsControl.browser.test.tsx | 22 +- .../chat/ThreadRelationshipsControl.tsx | 49 +++- .../chat/TimelineUserMessageRow.tsx | 4 +- .../src/components/chat/V2LifecycleRow.tsx | 35 ++- .../components/chat/WorkflowOpeningBlock.tsx | 9 +- .../src/components/chat/timelineRowContext.ts | 3 + .../components/chat/useRightPanelActions.ts | 2 +- apps/web/src/components/chat/useSideChat.ts | 2 +- .../components/chat/useThreadLifecycle.tsx | 20 +- .../components/settings/SettingsPanels.tsx | 61 ++++ .../settings/settingsSearch.test.ts | 6 + .../src/components/settings/settingsSearch.ts | 10 + .../web/src/hooks/useOpenSurfaceInMainView.ts | 30 ++ .../src/hooks/useRightPanelSurfaceClose.ts | 15 +- apps/web/src/hooks/useSideThreadTrigger.ts | 65 +++++ apps/web/src/i18n/translations/de.json | 29 +- apps/web/src/i18n/translations/en.json | 29 +- apps/web/src/i18n/translations/es.json | 29 +- apps/web/src/i18n/translations/fr.json | 29 +- apps/web/src/i18n/translations/ja.json | 29 +- apps/web/src/i18n/translations/ko.json | 29 +- apps/web/src/i18n/translations/pt-BR.json | 29 +- apps/web/src/i18n/translations/ru.json | 29 +- apps/web/src/i18n/translations/sv.json | 29 +- apps/web/src/i18n/translations/zh.json | 29 +- .../lib/assistantCitationNavigation.test.ts | 2 +- .../src/lib/assistantCitationNavigation.ts | 2 +- apps/web/src/lib/sideChatPane.test.ts | 30 +- apps/web/src/lib/sideChatPane.ts | 86 +++++- apps/web/src/linkedThreadSurface.ts | 11 + apps/web/src/reopenClosedView.ts | 4 +- apps/web/src/rightPanelStore.test.ts | 38 +++ apps/web/src/rightPanelStore.ts | 56 +++- apps/web/src/routeTree.gen.ts | 23 ++ ...EnvironmentId.$environmentId.$threadId.tsx | 18 ++ apps/web/src/state/linkedThreadView.ts | 73 +++-- apps/web/test/appScenarios.renders.tsx | 4 +- apps/web/test/fakeEnvironment.ts | 16 +- docs/user/remote-access.md | 6 +- docs/user/thread-sidebar.md | 33 ++- packages/client-runtime/package.json | 4 + .../client-runtime/src/sideThread.test.ts | 108 ++++++++ packages/client-runtime/src/sideThread.ts | 94 +++++++ packages/contracts/src/settings.ts | 11 + 63 files changed, 1696 insertions(+), 439 deletions(-) create mode 100644 apps/web/src/components/chat/LinkedThreadPage.tsx delete mode 100644 apps/web/src/components/chat/SideChatPane.tsx create mode 100644 apps/web/src/components/chat/SideThreadPane.tsx create mode 100644 apps/web/src/hooks/useOpenSurfaceInMainView.ts create mode 100644 apps/web/src/hooks/useSideThreadTrigger.ts create mode 100644 apps/web/src/routes/_chat.linked.$viaEnvironmentId.$environmentId.$threadId.tsx create mode 100644 packages/client-runtime/src/sideThread.test.ts create mode 100644 packages/client-runtime/src/sideThread.ts diff --git a/apps/desktop/src/settings/DesktopClientSettings.test.ts b/apps/desktop/src/settings/DesktopClientSettings.test.ts index 90c8740f83725..d66ca346aabb3 100644 --- a/apps/desktop/src/settings/DesktopClientSettings.test.ts +++ b/apps/desktop/src/settings/DesktopClientSettings.test.ts @@ -27,6 +27,7 @@ const clientSettings: ClientSettings = { browserDefaultAppearance: "dark", browserRecordingFrameRate: 60, browserLinkTarget: "app", + sideThreadOpenTarget: "main", browserAutoShowFloatingPreview: false, browserProfiles: [{ id: "work", name: "Work", kind: "persistent" }], browserDefaultProfileId: "work", diff --git a/apps/web/src/closedViewStore.test.ts b/apps/web/src/closedViewStore.test.ts index 6b12b53330825..59b36cda4ad7f 100644 --- a/apps/web/src/closedViewStore.test.ts +++ b/apps/web/src/closedViewStore.test.ts @@ -58,7 +58,7 @@ describe("closedViewStore", () => { id: "bad", kind: "panel-tab", threadRef: refA, - surface: { kind: "side-chat", id: "side-chat:x" }, + surface: { kind: "thread", id: "thread:x" }, }, { id: "bad", @@ -100,7 +100,8 @@ describe("closedViewStore", () => { const sideChatId = store.remember({ kind: "panel-tab", threadRef: refA, - surface: { id: "side-chat:side", kind: "side-chat", threadId: ThreadId.make("side") }, + // Saved before a side chat's tab became a `thread` surface. + surface: { id: "side-chat:side", kind: "side-chat", threadId: "side" } as never, }); const publicId = store.remember(diff(refA)); const browserId = store.remember({ @@ -134,6 +135,9 @@ describe("closedViewStore", () => { publicId, sideChatId, ]); + expect(useClosedViewStore.getState().entries.at(-1)).toMatchObject({ + surface: { id: "thread:side", kind: "thread", threadId: "side" }, + }); const saved = JSON.stringify(await storage!.getItem(name!)); expect(saved).not.toContain("private.example"); expect(saved).not.toContain("Private page"); diff --git a/apps/web/src/closedViewStore.ts b/apps/web/src/closedViewStore.ts index 12087195cc67b..6587eb3eddf0d 100644 --- a/apps/web/src/closedViewStore.ts +++ b/apps/web/src/closedViewStore.ts @@ -12,7 +12,7 @@ import { createJSONStorage, persist } from "zustand/middleware"; import { decodeLinkedThreadSurface } from "./linkedThreadSurface"; import { resolveStorage } from "./lib/storage"; import { randomUUID } from "./lib/utils"; -import { type RightPanelSurface } from "./rightPanelStore"; +import { decodeThreadSurface, type RightPanelSurface } from "./rightPanelStore"; export type ClosedView = | { @@ -84,8 +84,8 @@ const isClosedViewEntry = (entry: unknown): entry is ClosedViewEntry => { typeof surface.target.name === "string" && (surface.target.platform === "ios" || surface.target.platform === "android"))) ); - case "side-chat": - return typeof surface.threadId === "string" && surface.id === `side-chat:${surface.threadId}`; + case "thread": + return typeof surface.threadId === "string" && surface.id === `thread:${surface.threadId}`; case "linked-thread": return ( (surface.title === null || typeof surface.title === "string") && @@ -116,6 +116,13 @@ const isClosedViewEntry = (entry: unknown): entry is ClosedViewEntry => { } }; +/** A closed side chat tab saved before its surface became `thread`. */ +const renamedSideChatTab = (entry: unknown): unknown => { + const view = entry as { kind?: unknown; surface?: { kind?: unknown } | null } | null; + if (view?.kind !== "panel-tab" || view.surface?.kind !== "side-chat") return entry; + return { ...view, surface: decodeThreadSurface(view.surface) }; +}; + export const useClosedViewStore = create()( persist( (set) => ({ @@ -145,13 +152,13 @@ export const useClosedViewStore = create()( storage: createJSONStorage(() => resolveStorage(typeof window !== "undefined" ? window.localStorage : undefined), ), - version: 2, + version: 3, migrate: (persisted) => { const entries = (persisted as Partial> | null) ?.entries; return { entries: Array.isArray(entries) - ? entries.filter(isClosedViewEntry).filter(isPersistentView) + ? entries.map(renamedSideChatTab).filter(isClosedViewEntry).filter(isPersistentView) : [], }; }, diff --git a/apps/web/src/components/ChatView.browser.test.tsx b/apps/web/src/components/ChatView.browser.test.tsx index 96a870efeb9ea..66eed3d0158b3 100644 --- a/apps/web/src/components/ChatView.browser.test.tsx +++ b/apps/web/src/components/ChatView.browser.test.tsx @@ -32,7 +32,7 @@ import stylesheet from "~/index.css?inline"; import { environmentContextRecord } from "~/lib/composerContextRecords"; import { startWorkspaceFocus } from "~/lib/workspaceFocus"; import { usePromptStashStore } from "~/promptStashStore"; -import { useRightPanelStore } from "~/rightPanelStore"; +import { selectThreadRightPanelState, useRightPanelStore } from "~/rightPanelStore"; import { getRouter } from "~/router"; import { appAtomRegistry } from "~/rpc/atomRegistry"; import { environmentThreadDetails } from "~/state/threads"; @@ -774,8 +774,8 @@ it("selecting a side-chat tab focuses that side chat's composer", async () => { onboardingCompletedAt: "2026-01-01T00:00:00.000Z", }); const parentRef = scopeThreadRef(ENVIRONMENT_ID, parent.id); - useRightPanelStore.getState().openSideChat(parentRef, otherSide.id); - useRightPanelStore.getState().openSideChat(parentRef, side.id); + useRightPanelStore.getState().openThread(parentRef, otherSide.id); + useRightPanelStore.getState().openThread(parentRef, side.id); const router = getRouter( createMemoryHistory({ initialEntries: [`/${ENVIRONMENT_ID}/${parent.id}`] }), ); @@ -805,6 +805,50 @@ it("selecting a side-chat tab focuses that side chat's composer", async () => { await expect.element(mainEditor).toHaveTextContent("main draft"); }); +it("a subagent tab shows its read-only bar and moves to the main view", async () => { + const parent = threadWithHistory("subagent-parent", 1); + const subagent = { + ...threadWithHistory("subagent-child", 1), + providerSubagentOf: parent.id, + olderSettled: true as const, + }; + await page.viewport(1400, 900); + using _environment = installFakeEnvironment([parent, subagent]); + __setClientSettingsForTests({ + ...DEFAULT_CLIENT_SETTINGS, + onboardingCompletedAt: "2026-01-01T00:00:00.000Z", + }); + const parentRef = scopeThreadRef(ENVIRONMENT_ID, parent.id); + useRightPanelStore.getState().openThread(parentRef, subagent.id); + const router = getRouter( + createMemoryHistory({ initialEntries: [`/${ENVIRONMENT_ID}/${parent.id}`] }), + ); + await router.load(); + await using screen = await render(, { + // AppRoot brings its own router. + router: false, + }); + const pane = screen.getByTestId("side-thread-pane"); + // The same header as a side chat, without what only a side chat offers. + await expect.element(pane.getByRole("heading", { name: subagent.title })).toBeVisible(); + await expect.element(pane.getByText("Runs on its own")).toBeVisible(); + await expect.element(pane.getByRole("button", { name: "Add to chat" })).not.toBeInTheDocument(); + await expect + .element(screen.getByRole("textbox", { name: `Message ${subagent.title}`, exact: true })) + .not.toBeInTheDocument(); + await expect + .element(screen.getByRole("textbox", { name: `Message ${parent.title}`, exact: true })) + .toBeVisible(); + + await pane.getByRole("button", { name: "Open in main view" }).click(); + await vi.waitFor(() => + expect(router.state.location.pathname).toBe(`/${ENVIRONMENT_ID}/${subagent.id}`), + ); + expect( + selectThreadRightPanelState(useRightPanelStore.getState().byThreadKey, parentRef).surfaces, + ).toEqual([]); +}); + it("/side sends the draft's attachments and context, and keeps them when it does not start", async () => { await page.viewport(1400, 900); const thread = threadWithHistory("side-attachments", 1); diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 128f3b16d1dde..96e2529120600 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -72,7 +72,6 @@ import { type AssistantCitation, type ResponseContextRecord, type ChatFileAttachment, - isProviderNativeSubagentThread, type EnvironmentId, type MessageId, type ModelSelection, @@ -309,6 +308,8 @@ import { getTriggerDisplayModelName } from "./chat/providerIconUtils"; import { resolveScrollToEndClearance } from "./composerFooterLayout"; import { ChatHeader } from "./chat/ChatHeader"; import { useSideChat } from "./chat/useSideChat"; +import { sideThreadComposer, sideThreadKindOf } from "@t3tools/client-runtime/side-thread"; +import { useOpenSurfaceInMainView } from "../hooks/useOpenSurfaceInMainView"; import { useRemoteOpenState } from "~/remoteOpen"; import { shouldShowOpenInPicker } from "./chat/OpenInPicker.logic"; import { useOpenFavoriteEditorShortcut } from "./chat/OpenInPickerShortcut"; @@ -858,8 +859,9 @@ export default function ChatView(props: ChatViewProps) { serverProjection === null ? null : deriveRunlessWorkStartedAt(serverProjection); const providerSubagentStatus = serverProjection === null ? null : deriveProviderSubagentStatus(serverProjection); + const sideThreadKind = serverThread === null ? null : sideThreadKindOf(serverThread.source); const isProviderSubagent = - serverThread !== null && isProviderNativeSubagentThread(serverThread.source); + sideThreadKind !== null && sideThreadComposer(sideThreadKind) === "read-only"; const supportsProviderSwitchingViaHandoff = threadSupportsProviderHandoff(serverProjection); const activeLatestRun = isServerThread ? serverLatestRun : (activeThread?.latestRun ?? null); const activeActivityRun = isServerThread ? serverActivityRun : (activeThread?.latestRun ?? null); @@ -942,8 +944,16 @@ export default function ChatView(props: ChatViewProps) { }; } if (parentSubagentThreadRef !== null) { + const title = parentSubagentThread?.title ?? gt("Parent thread"); + // Embedded in its parent's panel, the parent is the view around it. + if ( + parentPanel !== undefined && + scopedThreadKey(parentPanel.hostRef) === scopedThreadKey(parentSubagentThreadRef) + ) { + return { title }; + } return { - title: parentSubagentThread?.title ?? gt("Parent thread"), + title, open: (): void => { void navigate({ to: "/$environmentId/$threadId", @@ -2913,6 +2923,7 @@ export default function ChatView(props: ChatViewProps) { ? gt("Available once the thread's worktree is set up.") : null; const openSideChatStable = useStableCallback(() => void sideChat.open()); + const openSurfaceInMainView = useOpenSurfaceInMainView(activeThreadRef); const sendSideChatStable = useStableCallback(sideChat.open); const { onConfirmRevertStable, onForkFromRunStable, onRevertTimelineTurnStable } = useTimelineRewind({ @@ -3290,6 +3301,7 @@ export default function ChatView(props: ChatViewProps) { ); // Above the early return, where React Compiler can cache it for the side chat pane. const sideChatParentPanel = { + hostRef: scopeThreadRef(environmentId, threadId), openToolDiff: onOpenToolDiffStable, runShellCommand: runSideChatShellCommandStable, }; @@ -4091,6 +4103,7 @@ export default function ChatView(props: ChatViewProps) { terminalLabelsById={activeTerminalLabelsById} onActivate={activateRightPanelSurfaceStable} onCloseSurface={closeRightPanelSurfaceStable} + onOpenInMainView={openSurfaceInMainView} onRenameDevice={(surfaceId, title) => { if (activeThreadRef) useRightPanelStore.getState().renameDevice(activeThreadRef, surfaceId, title); diff --git a/apps/web/src/components/ReopenClosedViewShortcut.tsx b/apps/web/src/components/ReopenClosedViewShortcut.tsx index 83e0d3deaf990..551dbc98d8abc 100644 --- a/apps/web/src/components/ReopenClosedViewShortcut.tsx +++ b/apps/web/src/components/ReopenClosedViewShortcut.tsx @@ -33,6 +33,7 @@ import { selectThreadRightPanelState, useRightPanelStore, } from "../rightPanelStore"; +import { serverEnvironment } from "../state/server"; import { appAtomRegistry } from "../rpc/atomRegistry"; import { readProject, readThreadShell } from "../state/entities"; import { previewEnvironment } from "../state/preview"; @@ -117,8 +118,11 @@ export function ReopenClosedViewShortcut() { ownerExists: readThreadShell(ref) !== null || drafts.getDraftThreadByRef(ref) !== null, sideChatExists: entry.kind !== "panel-tab" || - entry.surface.kind !== "side-chat" || - readThreadShell(scopeThreadRef(ref.environmentId, entry.surface.threadId)) !== null, + entry.surface.kind !== "thread" || + readThreadShell(scopeThreadRef(ref.environmentId, entry.surface.threadId)) !== null || + // The shell leaves idle subagents out, so one it does not list may still exist. + appAtomRegistry.get(serverEnvironment.configValueAtom(ref.environmentId)) + ?.shellThreadFamilies === true, shellLive: appAtomRegistry.get(environmentShell.stateValueAtom(ref.environmentId)).status === "live", panel, diff --git a/apps/web/src/components/RightPanelTabs.tsx b/apps/web/src/components/RightPanelTabs.tsx index c1ec9a53ca622..f076a2794c68f 100644 --- a/apps/web/src/components/RightPanelTabs.tsx +++ b/apps/web/src/components/RightPanelTabs.tsx @@ -27,6 +27,7 @@ import type { ThreadId, } from "@t3tools/contracts"; import { getTerminalLabel } from "@t3tools/shared/terminalLabelsCopy"; +import { formatSubagentDisplayTitle } from "@t3tools/client-runtime/state/subagent-display"; import { closestCenter, DndContext, @@ -39,6 +40,7 @@ import { restrictToFirstScrollableAncestor, restrictToHorizontalAxis } from "@dn import { horizontalListSortingStrategy, SortableContext, useSortable } from "@dnd-kit/sortable"; import { CSS } from "@dnd-kit/utilities"; import { + Bot, CircleDotIcon, Smartphone, ChevronDown, @@ -136,6 +138,10 @@ export interface RightPanelTabsProps { onActivate: (surface: RightPanelSurface) => void; onRenameDevice?: (surfaceId: string, title: string) => void; onCloseSurface: (surface: RightPanelSurface) => void; + /** Moves a subagent, side chat or linked thread tab to the main screen. */ + onOpenInMainView?: ( + surface: Extract, + ) => void; onCloseOtherSurfaces: (surface: RightPanelSurface) => void; onCloseSurfacesToRight: (surface: RightPanelSurface) => void; onCloseAllSurfaces: () => void; @@ -217,6 +223,7 @@ const SURFACE_UNAVAILABLE_HINTS = { } as const; type TabContextMenuAction = + | "open-in-main-view" | "rename" | "copy-path" | "toggle-mute" @@ -613,8 +620,9 @@ function surfaceTitle( return /^\d+$/.test(surface.key) ? `#${surface.key}` : surface.key; case "device": return surface.title ?? surface.target?.name ?? resolve(msg("Device")); - case "side-chat": - return resolve(msg("Side chat")); + case "thread": + // Until the thread's own title loads. + return resolve(msg("Thread")); case "linked-thread": return linkedThreadTitle( surface, @@ -710,7 +718,7 @@ function SurfaceIcon({ return ; case "issue": return ; - case "side-chat": + case "thread": return ; case "linked-thread": return ; @@ -743,16 +751,16 @@ function sideChatTabState(shell: EnvironmentThreadShell | null) { return threadRuntimeIsActive(shell.runtime) ? "running" : null; } -// Static dots: a side chat tab can stay open for a whole run. +// Static dots: a side chat or subagent tab can stay open for a whole run. function SideChatTabIcon(props: { environmentId: EnvironmentId | null; threadId: ThreadId }) { - const state = sideChatTabState( - useQuietThreadShell( - props.environmentId === null ? null : scopeThreadRef(props.environmentId, props.threadId), - ), + const shell = useQuietThreadShell( + props.environmentId === null ? null : scopeThreadRef(props.environmentId, props.threadId), ); + const state = sideChatTabState(shell); + const Icon = shell !== null && shell.lineage.sideChat !== true ? Bot : MessagesSquare; return ( <> - + {state === null ? null : ( @@ -1279,6 +1292,9 @@ export function RightPanelTabs(props: RightPanelTabsProps) { if (surfaceIndex < 0) return; const items: ContextMenuItem[] = []; + if ((surface.kind === "thread" || surface.kind === "linked-thread") && props.onOpenInMainView) { + items.push({ id: "open-in-main-view", label: gt("Open in main view") }); + } if (surface.kind === "device" && props.onRenameDevice) items.push({ id: "rename", label: gt("Rename") }); if (surface.kind === "file" && surface.attachment === undefined) { @@ -1320,6 +1336,11 @@ export function RightPanelTabs(props: RightPanelTabsProps) { const action = await api.contextMenu.show(items, { x: event.clientX, y: event.clientY }); switch (action) { + case "open-in-main-view": + if (surface.kind === "thread" || surface.kind === "linked-thread") { + props.onOpenInMainView?.(surface); + } + break; case "rename": setRenamingDevice(surface.id); break; diff --git a/apps/web/src/components/ThreadRouteView.tsx b/apps/web/src/components/ThreadRouteView.tsx index 5217b068f9a35..48b86b8ddfe56 100644 --- a/apps/web/src/components/ThreadRouteView.tsx +++ b/apps/web/src/components/ThreadRouteView.tsx @@ -31,7 +31,7 @@ import { * Keeps the family of an open thread the shell leaves out (an older settled thread) in the shell * rows until the route leaves it, so every reader of its shell row finds it. */ -function useOpenThreadFamily(threadRef: ScopedThreadRef | null, missing: boolean) { +export function useOpenThreadFamily(threadRef: ScopedThreadRef | null, missing: boolean) { const key = threadRef === null ? null : scopedThreadKey(threadRef); // Sticks to the route thread, so the row the family brings in does not release it. const [mountedKey, setMountedKey] = useState(null); diff --git a/apps/web/src/components/chat/LinkedThreadPage.tsx b/apps/web/src/components/chat/LinkedThreadPage.tsx new file mode 100644 index 0000000000000..08d216a212650 --- /dev/null +++ b/apps/web/src/components/chat/LinkedThreadPage.tsx @@ -0,0 +1,65 @@ +import { scopeThreadRef } from "@t3tools/client-runtime/environment"; +import type { EnvironmentId, ThreadId } from "@t3tools/contracts"; +import { Navigate } from "@tanstack/react-router"; +import { useGT } from "gt-react"; + +import { isElectron } from "~/env"; +import { linkedThreadSurface } from "../../linkedThreadSurface"; +import { useEnvironment } from "../../state/environments"; +import { useLinkedEnvironments } from "../../state/peerLinks"; +import { buildThreadRouteParams } from "../../threadRoutes"; +import { SidebarInset } from "../ui/sidebar"; +import { WorkspaceBreadcrumb, WorkspaceBreadcrumbItem } from "../WorkspaceBreadcrumb"; +import { WorkspacePageHeader } from "../WorkspacePageHeader"; +import { LinkedThread } from "./LinkedThreadPane"; + +/** + * A linked environment's thread on the main screen, read through `viaEnvironmentId`. Once this + * client is connected to the thread's own environment, the thread opens there instead. + */ +export function LinkedThreadPage(props: { + readonly viaEnvironmentId: EnvironmentId; + readonly environmentId: EnvironmentId; + readonly threadId: ThreadId; +}) { + const { viaEnvironmentId, environmentId, threadId } = props; + const gt = useGT(); + const own = useEnvironment(environmentId); + const connected = own?.connection.phase === "connected"; + const linkedLabel = useLinkedEnvironments(connected ? null : viaEnvironmentId).get(environmentId); + if (connected) { + return ( + + ); + } + const surface = linkedThreadSurface({ + viaEnvironmentId, + environmentId, + threadId, + label: own?.label ?? linkedLabel ?? gt("a linked environment"), + title: null, + }); + return ( + + ( + + + +

{title}

+
+
+
+ )} + /> +
+ ); +} diff --git a/apps/web/src/components/chat/LinkedThreadPane.tsx b/apps/web/src/components/chat/LinkedThreadPane.tsx index 514e75b3c1e34..00b0a8c226575 100644 --- a/apps/web/src/components/chat/LinkedThreadPane.tsx +++ b/apps/web/src/components/chat/LinkedThreadPane.tsx @@ -4,6 +4,7 @@ import { T, useGT, useMessages, Var } from "gt-react"; import { EyeIcon, PlugIcon } from "lucide-react"; import { useState, type ReactNode } from "react"; +import { useOpenSurfaceInMainView } from "../../hooks/useOpenSurfaceInMainView"; import { useStableCallback } from "../../hooks/useStableCallback"; import { type LinkedThreadSurface, linkedThreadTitle } from "../../linkedThreadSurface"; import { useEnvironment } from "../../state/environments"; @@ -21,6 +22,7 @@ import { ReadOnlyComposerLead, ReadOnlyComposerStatus, } from "./ReadOnlyComposerBar"; +import { SideThreadPaneHeader } from "./SideThreadPane"; import { Spinner } from "../ui/spinner"; import { toastManager } from "../ui/toast"; import type { MessagesTimelineHistoryControls } from "./MessagesTimeline"; @@ -42,7 +44,7 @@ function LinkedThreadComposer(props: { const { label, via } = props; const gt = useGT(); return ( -
+
{props.notice ? : null} @@ -76,12 +78,14 @@ const ignore = () => {}; * and drawn by the timeline every thread uses. The client never connects to the linked one, so * the view only reads: what would need that connection is absent. Key it by its surface id. */ -export function LinkedThreadPane(props: { - /** The thread whose panel shows the tab. */ - readonly panelRef: ScopedThreadRef; +export function LinkedThread(props: { + /** The thread whose panel shows it as a tab, or null on the main screen. */ + readonly panelRef: ScopedThreadRef | null; readonly surface: LinkedThreadSurface; - /** Whether the tab is showing; the stream runs only while it is. */ + /** Whether it is showing; the stream runs only while it is. */ readonly visible: boolean; + /** What sits above the timeline, given the thread's title once the stream or surface names it. */ + readonly renderHeader: (title: string) => ReactNode; }) { const { surface, panelRef } = props; const gt = useGT(); @@ -173,30 +177,36 @@ export function LinkedThreadPane(props: { onLoadEarlier: view.loadEarlier, }; return ( -
-

- {linkedThreadTitle( + // `data-chat-canvas` gives the timeline the side gutters it has in a thread's own chat. +
+ {props.renderHeader( + linkedThreadTitle( { title: projection?.thread.title || surface.title }, gt("Thread on {label}", { label }), - )} -

+ ), + )} {projection === null ? ( <> -
- {failure === null ? ( -
- - - Reading from {label}… - -
- ) : ( - - {failure.title} - {failure.detail} - {retryAction} - - )} +
+
+ {failure === null ? ( +
+ + + Reading from {label}… + +
+ ) : ( + + {failure.title} + {failure.detail} + {retryAction} + + )} +
( <> {failure === null ? null : ( -
- - {failure.title} - - {failure.detail} Showing what was read before. - - {retryAction} - +
+
+ + {failure.title} + + {failure.detail} Showing what was read before. + + {retryAction} + +
)} ); } + +/** A linked environment's thread as a right panel tab. Key it by its surface id. */ +export function LinkedThreadPane(props: { + /** The thread whose panel shows the tab. */ + readonly panelRef: ScopedThreadRef; + readonly surface: LinkedThreadSurface; + /** Whether the tab is showing. */ + readonly visible: boolean; + readonly onClose: () => void; +}) { + const { panelRef, surface } = props; + const openInMainView = useOpenSurfaceInMainView(panelRef); + return ( + ( + openInMainView(surface)} + onClose={props.onClose} + /> + )} + /> + ); +} diff --git a/apps/web/src/components/chat/MarkdownThreadLink.browser.test.tsx b/apps/web/src/components/chat/MarkdownThreadLink.browser.test.tsx index 4455c29c7ea1e..919420c838bce 100644 --- a/apps/web/src/components/chat/MarkdownThreadLink.browser.test.tsx +++ b/apps/web/src/components/chat/MarkdownThreadLink.browser.test.tsx @@ -6,6 +6,7 @@ import { AsyncResult, Atom, AtomRegistry } from "effect/reactivity"; import { expect, it, vi } from "vite-plus/test"; import { act, render } from "../../../test/render"; +import { isMacPlatform } from "../../lib/utils"; import { linkedThreadSurface } from "../../linkedThreadSurface"; import { selectThreadRightPanelState, useRightPanelStore } from "../../rightPanelStore"; import { MarkdownThreadLink } from "./MarkdownThreadLink"; @@ -35,6 +36,9 @@ vi.mock(import("../../state/entities"), () => ({ ref?.projectId === "essay-project" ? ({ title: "Essays" } as never) : null, })); vi.mock(import("../../state/environments"), () => ({ + // The click rule reads the client setting, whose module asks for these. + useEnvironments: (() => []) as never, + usePrimaryEnvironment: (() => null) as never, useEnvironmentIdentities: () => [ { environmentId: EnvironmentId.make("environment"), label: "Here" }, { environmentId: EnvironmentId.make("remote"), label: "Remote" }, @@ -211,6 +215,12 @@ it.for([ await chip.click(); expect(panel().surfaces).toHaveLength(1); expect(screen.router?.state.location.pathname).toBe("/"); + // The modifier reads it on the main screen instead, through the same environment. + await chip.click({ modifiers: [isMacPlatform(navigator.platform) ? "Meta" : "Control"] }); + await vi.waitFor(() => + expect(screen.router?.state.location.pathname).toBe(`/linked/environment/${linkedId}/there`), + ); + expect(panel().surfaces).toHaveLength(1); }); it("reads through the link when a disconnected machine's thread is only cached here", async () => { diff --git a/apps/web/src/components/chat/MarkdownThreadLink.tsx b/apps/web/src/components/chat/MarkdownThreadLink.tsx index 1e4c823b458b4..320951a9e312d 100644 --- a/apps/web/src/components/chat/MarkdownThreadLink.tsx +++ b/apps/web/src/components/chat/MarkdownThreadLink.tsx @@ -1,4 +1,5 @@ import type { EnvironmentId, ScopedThreadRef } from "@t3tools/contracts"; +import { useNavigate } from "@tanstack/react-router"; import { useGT, useMessages } from "gt-react"; import { MessagesSquareIcon } from "lucide-react"; import { @@ -13,7 +14,8 @@ import { resolveLinkedThreadOpen } from "@t3tools/client-runtime/linked-thread"; import { configuredHostedAppUrl } from "../../hostedPairing"; import { useThreadRefs, useThreadShell } from "../../state/entities"; import { useConnectedEnvironmentIds, useEnvironmentIdentities } from "../../state/environments"; -import { useRightPanelStore } from "../../rightPanelStore"; +import { useSideThreadTrigger } from "../../hooks/useSideThreadTrigger"; +import { openLinkedThreadRead } from "../../lib/sideChatPane"; import { useLinkedEnvironments } from "../../state/peerLinks"; import { orchestrationEnvironment } from "../../state/orchestration"; import { useEnvironmentQuery } from "../../state/query"; @@ -25,14 +27,16 @@ import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; /** `label` is the link's written text; an autolink has none. */ export function MarkdownThreadLink(props: { readonly environmentId: EnvironmentId; - /** The thread the link is written in; a linked environment's thread opens in its right panel. */ + /** The thread the link is written in; a linked environment's thread can open in its right panel. */ readonly threadRef?: ScopedThreadRef | undefined; readonly link: ThreadLink; readonly label: string | null; }) { const gt = useGT(); const messages = useMessages(); - const panelRef = props.threadRef; + const navigate = useNavigate(); + const trigger = useSideThreadTrigger(); + const panelRef = props.threadRef ?? null; const candidates = threadLinkCandidates(props.link, props.environmentId); const writtenRef = candidates[0]!; const written = useThreadShell(writtenRef); @@ -44,10 +48,8 @@ export function MarkdownThreadLink(props: { const linkedLabel = useLinkedEnvironments( connected || writtenRef.environmentId === props.environmentId ? null : props.environmentId, ).get(writtenRef.environmentId); - // A shell cached from an earlier connection does not make the thread open there now. Outside a - // thread there is no panel to read it in, so the link behaves as it does without one. + // A shell cached from an earlier connection does not make the thread open there now. const linked = - panelRef !== undefined && resolveLinkedThreadOpen({ environmentId: writtenRef.environmentId, viaEnvironmentId: props.environmentId, @@ -94,14 +96,22 @@ export function MarkdownThreadLink(props: { render={ - } - /> - - {canAddToChat - ? gt("Adds this side chat to the main thread's next message.") - : gt("Available after the first message.")} - - - - -
- {shell === null ? ( - snapshotLoaded ? ( -

- This side chat was deleted. -

- ) : null - ) : ( - - - - - - )} -
- ); -} diff --git a/apps/web/src/components/chat/SideThreadPane.tsx b/apps/web/src/components/chat/SideThreadPane.tsx new file mode 100644 index 0000000000000..80e2be31e1b4c --- /dev/null +++ b/apps/web/src/components/chat/SideThreadPane.tsx @@ -0,0 +1,261 @@ +import { scopeThreadRef } from "@t3tools/client-runtime/environment"; +import { sideThreadKindOf, type SideThreadKind } from "@t3tools/client-runtime/side-thread"; +import { formatSubagentDisplayTitle } from "@t3tools/client-runtime/state/subagent-display"; +import { + isAtomCommandInterrupted, + settlePromise, + squashAtomCommandFailure, +} from "@t3tools/client-runtime/state/runtime"; +import { AuthOrchestrationOperateScope, type ScopedThreadRef } from "@t3tools/contracts"; +import { threadContextRecord } from "@t3tools/shared/composerContextReferences"; +import { T, useGT } from "gt-react"; +import { SquareArrowOutUpLeftIcon, Trash2Icon, XIcon } from "lucide-react"; +import { type ReactNode, useEffect, useState } from "react"; + +import { useComposerDraftStore } from "../../composerDraftStore"; +import { ComposerHandleContext } from "../../composerHandleContext"; +import { useOpenSurfaceInMainView } from "../../hooks/useOpenSurfaceInMainView"; +import { useClientSettings } from "../../hooks/useSettings"; +import { releaseComposerDraftUploads } from "../../lib/composerDraftUploads"; +import type { SideChatParentPanel } from "../../lib/sideChatPane"; +import { readLocalApi } from "../../localApi"; +import { hostRightPanel, type ThreadSurface, useRightPanelStore } from "../../rightPanelStore"; +import { useQuietThreadProjection, useQuietThreadShell } from "../../state/entities"; +import { useEnvironmentScope } from "../../state/session"; +import { useEnvironmentShellStatus } from "../../state/shell"; +import { threadEnvironment, useEnvironmentThread } from "../../state/threads"; +import { + isThreadRouteSnapshotAuthoritative, + resolveThreadRouteRenderState, +} from "../../threadRoutes"; +import { useOpenThreadFamily } from "../ThreadRouteView"; +import { useAtomCommand } from "../../state/use-atom-command"; +import ChatView from "../ChatView"; +import { Button } from "../ui/button"; +import { toastManager } from "../ui/toast"; +import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; +import { BackgroundThreadContext } from "./backgroundThread"; + +/** + * The top of every side thread's tab: what the thread is, what its kind can do, then the way to + * the main view and Close, in the same place whichever kind it is. + */ +export function SideThreadPaneHeader(props: { + readonly title: string; + readonly kind: SideThreadKind; + /** What only this kind of thread offers, before the shared controls. */ + readonly children?: ReactNode; + readonly onOpenInMainView: () => void; + readonly onClose: () => void; +}) { + const gt = useGT(); + return ( +
+

{props.title}

+ {props.children} + + + + + } + /> + + Open in main view + + + +
+ ); +} + +/** + * A side chat or a subagent as a tab: the shared header over the thread's own chat. The chat + * decides its bottom, the composer or the read-only bar, as it does on the main screen. + */ +export default function SideThreadPane(props: { + /** The thread whose panel shows the tab. */ + readonly parentRef: ScopedThreadRef; + readonly surface: ThreadSurface; + readonly parentPanel: SideChatParentPanel; + readonly onClose: () => void; +}) { + const { parentRef, surface } = props; + const { threadId } = surface; + const gt = useGT(); + const openInMainView = useOpenSurfaceInMainView(parentRef); + const threadRef = scopeThreadRef(parentRef.environmentId, threadId); + // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- registers the parent panel as host in the panel store + useEffect( + () => hostRightPanel(scopeThreadRef(parentRef.environmentId, threadId), parentRef), + [parentRef, threadId], + ); + const shell = useQuietThreadShell(threadRef); + const bootstrapComplete = isThreadRouteSnapshotAuthoritative( + useEnvironmentShellStatus(parentRef.environmentId), + ); + // The shell can leave an idle subagent out, so its own detail says whether it still exists. + const unlistedDetail = useEnvironmentThread( + shell === null ? parentRef.environmentId : null, + shell === null ? threadId : null, + ); + useOpenThreadFamily(threadRef, bootstrapComplete && shell === null); + const renderState = resolveThreadRouteRenderState({ + bootstrapComplete, + serverThreadExists: shell !== null, + serverThreadDeleted: shell?.deletedAt != null, + unlistedThreadDetail: unlistedDetail, + draftThreadExists: false, + }); + const projection = useQuietThreadProjection(threadRef)?.projection; + const thread = shell ?? projection?.thread ?? null; + // A tab opens for side chats and subagents only, so an unloaded one is still one of them. + const kind = sideThreadKindOf(thread) ?? "subagent"; + const isSideChat = kind === "side-chat"; + const canOperate = useEnvironmentScope(parentRef.environmentId, AuthOrchestrationOperateScope); + const deleteThread = useAtomCommand(threadEnvironment.delete, { reportFailure: false }); + const confirmThreadDelete = useClientSettings((settings) => settings.confirmThreadDelete); + const [deleting, setDeleting] = useState(false); + // Closing an unused side chat deletes it, which would leave the link unreadable. + const canAddToChat = shell !== null && shell.latestUserMessageAt !== null; + const addToChat = () => { + if (!canAddToChat) return; + useComposerDraftStore + .getState() + .addThreadContexts(parentRef, [threadContextRecord(threadRef, shell.title)], { + insertAtCaret: false, + }); + }; + + const deleteSideChat = async () => { + if (!canOperate || shell === null || deleting) return; + if (confirmThreadDelete) { + const api = readLocalApi(); + if (!api) return; + const confirmed = await settlePromise(() => + api.dialogs.confirm( + [ + gt('Delete side chat "{title}"?', { title: shell.title }), + gt("This permanently clears its conversation history."), + ].join("\n"), + { variant: "destructive" }, + ), + ); + if (confirmed._tag === "Failure" || !confirmed.value) return; + } + setDeleting(true); + const result = await deleteThread({ + environmentId: parentRef.environmentId, + input: { threadId }, + }); + setDeleting(false); + if (result._tag === "Success") { + releaseComposerDraftUploads(threadRef); + useComposerDraftStore.getState().clearDraftThread(threadRef); + useRightPanelStore.getState().closeSurface(parentRef, surface.id); + } else if (!isAtomCommandInterrupted(result)) { + const error = squashAtomCommandFailure(result); + toastManager.add({ + type: "error", + title: gt("Could not delete the side chat"), + ...(error instanceof Error ? { description: error.message } : {}), + }); + } + }; + + const title = + thread === null + ? isSideChat + ? gt("Side chat") + : gt("Subagent") + : isSideChat + ? thread.title + : formatSubagentDisplayTitle(thread.title); + + return ( +
+ openInMainView(surface)} + onClose={props.onClose} + > + {isSideChat ? ( + <> + + + Add to chat + + } + /> + + {canAddToChat + ? gt("Adds this side chat to the main thread's next message.") + : gt("Available after the first message.")} + + + + + ) : null} + + {renderState === "missing" ? ( +

+ {isSideChat ? ( + This side chat was deleted. + ) : ( + This thread is no longer available. + )} +

+ ) : renderState === "loading" && thread === null ? null : ( + + + + + + )} +
+ ); +} diff --git a/apps/web/src/components/chat/ThreadLineageWorkflowRow.tsx b/apps/web/src/components/chat/ThreadLineageWorkflowRow.tsx index bb56a8a7d9bc9..5f47073bb965b 100644 --- a/apps/web/src/components/chat/ThreadLineageWorkflowRow.tsx +++ b/apps/web/src/components/chat/ThreadLineageWorkflowRow.tsx @@ -3,6 +3,8 @@ import { type SubagentWorkflowGroup, type RuntimeSubagent, } from "@t3tools/client-runtime/state/subagentRuntime"; +import type { SideThreadOpenIntent } from "@t3tools/client-runtime/side-thread"; +import { useSideThreadTrigger } from "../../hooks/useSideThreadTrigger"; import type { ProviderDriverKind, ProviderInstanceId, ServerProvider } from "@t3tools/contracts"; import { msg, T, useGT, useMessages } from "gt-react"; import { ChevronDownIcon, SquareIcon } from "lucide-react"; @@ -73,9 +75,10 @@ function WorkflowMemberRow({ providers: ReadonlyArray | undefined; providerEntries: ReadonlyArray; driver: ProviderDriverKind | undefined; - onOpen: (threadId: string) => void; + onOpen: (threadId: string, intent: SideThreadOpenIntent) => void; }) { const gt = useGT(); + const trigger = useSideThreadTrigger(); const threadId = member.childThreadId; const canOpen = threadId !== null; return ( @@ -88,7 +91,7 @@ function WorkflowMemberRow({ part="row" aria-label={gt("Open {title} chat", { title: member.title })} disabled={!canOpen} - onClick={() => canOpen && onOpen(threadId)} + {...(canOpen ? trigger((intent) => onOpen(threadId, intent)) : {})} /> } > @@ -147,7 +150,7 @@ export function ThreadLineageWorkflowRow({ readonly providers: ReadonlyArray | undefined; readonly providerEntries: ReadonlyArray; readonly driver: ProviderDriverKind | undefined; - readonly onOpenThread: (threadId: string) => void; + readonly onOpenThread: (threadId: string, intent: SideThreadOpenIntent) => void; readonly onStop?: (() => void) | undefined; readonly stopping: boolean; readonly stopDisabled: boolean; diff --git a/apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx b/apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx index 914adf19777ad..052a5742b7aab 100644 --- a/apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx +++ b/apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx @@ -42,6 +42,9 @@ vi.mock(import("../../state/entities"), () => ({ useAnyEnvironmentHiding: (() => false) as never, })); vi.mock(import("../../state/environments"), () => ({ + // The click rule reads the client setting, whose module asks for these. + useEnvironments: (() => []) as never, + usePrimaryEnvironment: (() => null) as never, useEnvironment: (() => null) as never, useEnvironmentProviders: (() => new Map()) as never, })); @@ -61,7 +64,11 @@ vi.mock(import("../../state/use-atom-command"), () => ({ : AsyncResult.failure(Cause.fail(new Error("Connection lost")))) as never, })); +import { scopeThreadRef } from "@t3tools/client-runtime/environment"; + import { render } from "../../../test/render"; +import { isMacPlatform } from "../../lib/utils"; +import { selectThreadRightPanelState, useRightPanelStore } from "../../rightPanelStore"; import { makeThreadProjectionFixture } from "../../test-fixtures"; import { ScrollArea } from "../ui/scroll-area"; import { ToastProvider } from "../ui/toast"; @@ -71,6 +78,7 @@ const environmentId = EnvironmentId.make("environment"); const threadId = ThreadId.make("fork"); function setup() { + useRightPanelStore.setState(useRightPanelStore.getInitialState()); state.commandSucceeds = false; state.relatedShells = []; state.threadTitles = { source: "Source" }; @@ -168,7 +176,7 @@ it.each([ } }); -it("opens an idle child from Lineage when its shell has not been loaded", async () => { +it("opens an idle child beside the thread, and in its place with the modifier", async () => { setup(); const projection = makeThreadProjectionFixture(); 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 await screen.getByRole("button", { name: /Previous agents/ }).click(); const child = screen.getByRole("button", { name: /Idle child/ }); await expect.element(child).toBeEnabled(); + const panelRef = scopeThreadRef(environmentId, projection.thread.id); + const panel = () => + selectThreadRightPanelState(useRightPanelStore.getState().byThreadKey, panelRef); await child.click(); + expect(panel()).toMatchObject({ + isOpen: true, + activeSurfaceId: "thread:omitted-child", + surfaces: [{ kind: "thread", threadId: childId }], + }); + expect(screen.router?.state.location.pathname).toBe("/"); + // Idle children can be omitted from the shell; the route loads the child's own detail. + await child.click({ modifiers: [isMacPlatform(navigator.platform) ? "Meta" : "Control"] }); await vi.waitFor(() => expect(screen.router?.state.location.pathname).toBe("/local/omitted-child"), ); + expect(panel().surfaces).toHaveLength(1); }); it("shows a lineage thread's full title in its tooltip", async () => { diff --git a/apps/web/src/components/chat/ThreadRelationshipsControl.tsx b/apps/web/src/components/chat/ThreadRelationshipsControl.tsx index 1c29eb147fce4..9675a21620d32 100644 --- a/apps/web/src/components/chat/ThreadRelationshipsControl.tsx +++ b/apps/web/src/components/chat/ThreadRelationshipsControl.tsx @@ -63,6 +63,7 @@ import type { MessageResolver } from "~/i18n/messages"; import { useArchivedThreadSnapshots } from "../../lib/archivedThreadsState"; import { buildThreadRouteParams } from "../../threadRoutes"; +import type { SideThreadOpenIntent } from "@t3tools/client-runtime/side-thread"; import { useLinkedThreadOpener } from "../../state/linkedThreadView"; import { useProjects, @@ -86,7 +87,8 @@ import { useEnvironmentQuery } from "../../state/query"; import { AgentElapsed } from "./AgentElapsed"; import { ThreadRelationshipIcon, threadRelationshipStatusLabel } from "./ThreadRelationshipIcon"; import { ThreadLineageWorkflowRow } from "./ThreadLineageWorkflowRow"; -import { resolveThreadOpenRoute } from "../../lib/sideChatPane"; +import { useSideThreadTrigger } from "../../hooks/useSideThreadTrigger"; +import { openSideThread, resolveThreadOpenRoute } from "../../lib/sideChatPane"; import { Menu, MenuItem, MenuPopup, MenuTrigger } from "../ui/menu"; import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; @@ -219,11 +221,11 @@ function relationshipHint( sideChat: boolean, resolve: MessageResolver, ) { - if (sideChat) return resolve(msg("Open side chat in this chat")); + if (sideChat) return resolve(msg("Open side chat")); if (edge.kind === "transfer") return resolve(msg("Open context transfer in this chat")); if (edge.kind === "subagent") { return edge.sourceThreadId === currentThreadId - ? resolve(msg("Open subagent in this chat")) + ? resolve(msg("Open subagent")) : resolve(msg("Open parent agent in this chat")); } return edge.sourceThreadId === currentThreadId @@ -301,13 +303,19 @@ function RemoteSubagentRow(props: { isSubagent: true, }); const opener = useLinkedThreadOpener(props.parentRef, remoteChild, title); + const trigger = useSideThreadTrigger(); return (
  • + } > { + openSideThread({ + threadRef: scopeThreadRef(props.environmentId, threadId), + panelRef: ref, + intent, + navigate: (threadRef) => + void navigate({ + to: "/$environmentId/$threadId", + params: buildThreadRouteParams(threadRef), + }), + }); + }; + const merge = async () => { if (!latestMergeBackRun || mergeTargetThreadId === null || busyAction !== null) return; if (mergeErrorToastId.current !== null) { @@ -817,12 +840,12 @@ export function ThreadRelationshipsPanel(props: { ? "group-hover:opacity-0 group-focus-within:opacity-0 pointer-coarse:opacity-0 [@media(hover:none)]:opacity-0" : ""; const project = projects.find((project) => project.id === node?.thread?.projectId); - const hint = relationshipHint( - edge, - props.threadId, - node?.thread?.lineage.sideChat === true && !isParent, - m, - ); + const isSideChat = node?.thread?.lineage.sideChat === true && !isParent; + const hint = relationshipHint(edge, props.threadId, isSideChat, m); + const openProps = + isSideChat || (isSubagent && !isParent) + ? trigger((intent) => openSideThreadRow(threadId, intent)) + : { onClick: () => openThread(threadId) }; const RelationshipPopup = agent ? ThreadHoverCardPopup : TooltipPopup; const relationshipTooltip = agent ? ( openThread(threadId)} + {...openProps} /> } > @@ -910,7 +933,9 @@ export function ThreadRelationshipsPanel(props: { providers={providers} providerEntries={providerEntries} driver={providerDriver} - onOpenThread={(memberThreadId) => openThread(memberThreadId as ThreadId)} + onOpenThread={(memberThreadId, intent) => + openSideThreadRow(memberThreadId as ThreadId, intent) + } onStop={canStopWorkflow ? () => void stopWorkflow(agent.id) : undefined} stopping={stoppingId === agent.id} stopDisabled={stoppingId !== null} diff --git a/apps/web/src/components/chat/TimelineUserMessageRow.tsx b/apps/web/src/components/chat/TimelineUserMessageRow.tsx index 6fc9ccc790e62..dc17bfcf95a72 100644 --- a/apps/web/src/components/chat/TimelineUserMessageRow.tsx +++ b/apps/web/src/components/chat/TimelineUserMessageRow.tsx @@ -288,7 +288,9 @@ function UserMessageContent({ row }: { row: Extract ctx.onOpenThread(ThreadId.make(threadId))} + onOpenThread={(threadId, intent) => + ctx.onOpenThread(ThreadId.make(threadId), undefined, intent) + } /> ) : resolveUserMessagePresentation(row.message).attribution === "automation" ? ( diff --git a/apps/web/src/components/chat/V2LifecycleRow.tsx b/apps/web/src/components/chat/V2LifecycleRow.tsx index 6e09415faf91a..44d578ee19b73 100644 --- a/apps/web/src/components/chat/V2LifecycleRow.tsx +++ b/apps/web/src/components/chat/V2LifecycleRow.tsx @@ -2,8 +2,10 @@ import { T, Var, msg, useGT, useMessages } from "gt-react"; import { ThreadHoverCardPopup } from "../ThreadHoverCard"; import { AgentElapsed } from "./AgentElapsed"; import { projectedSubagentsToRuntime } from "@t3tools/client-runtime/state/subagentRuntime"; -import type { ReactNode } from "react"; +import { use, type ReactNode } from "react"; import { useThreadShell, useProject } from "../../state/entities"; +import type { SideThreadOpenIntent } from "@t3tools/client-runtime/side-thread"; +import { SideThreadsOpenContext, useSideThreadTrigger } from "../../hooks/useSideThreadTrigger"; import { useLinkedThreadOpener } from "../../state/linkedThreadView"; import { SubagentTooltipContent } from "./SubagentTooltipContent"; import { useAtomValue } from "@effect/atom-react"; @@ -75,7 +77,11 @@ export function V2LifecycleRow(props: { readonly environmentId: EnvironmentId; readonly resourceSummary?: boolean | undefined; readonly runs: ReadonlyArray; - readonly onOpenThread: (threadId: ThreadId) => void; + readonly onOpenThread: ( + threadId: ThreadId, + environmentId?: EnvironmentId, + intent?: SideThreadOpenIntent, + ) => void; }) { const { item } = props; const gt = useGT(); @@ -375,7 +381,11 @@ export function SubagentNotificationLink(props: { readonly outcome: OrchestrationV2Notification["outcome"]; readonly createdAt: string; readonly timestampFormat: TimestampFormat; - readonly onOpenThread: (threadId: ThreadId) => void; + readonly onOpenThread: ( + threadId: ThreadId, + environmentId?: EnvironmentId, + intent?: SideThreadOpenIntent, + ) => void; readonly fallback: ReactNode; }) { const gt = useGT(); @@ -437,7 +447,11 @@ function SubagentTimelineLink(props: { readonly threadId: ThreadId | null; /** The thread in a linked environment that runs this task, when it runs there. */ readonly remote?: OrchestrationV2RemoteTaskChild | undefined; - readonly onOpenThread: (threadId: ThreadId) => void; + readonly onOpenThread: ( + threadId: ThreadId, + environmentId?: EnvironmentId, + intent?: SideThreadOpenIntent, + ) => void; readonly event?: { readonly status: OrchestrationV2TurnItem["status"] | null; readonly label: string; @@ -454,8 +468,15 @@ function SubagentTimelineLink(props: { const threadId = props.threadId; // A task in a linked environment opens there, or read-only through this one. const remoteOpener = useLinkedThreadOpener(props.parentRef, remote, props.title); - const open = - threadId !== null ? () => props.onOpenThread(threadId) : (remoteOpener?.open ?? null); + const trigger = useSideThreadTrigger(); + const canOpen = use(SideThreadsOpenContext); + const open = !canOpen + ? null + : threadId !== null + ? (intent: SideThreadOpenIntent) => props.onOpenThread(threadId, undefined, intent) + : (remoteOpener?.open ?? null); + // A task on a connected linked environment opens there, on the main screen only. + const panel = threadId !== null || remoteOpener?.mode === "linked"; const liveStatus = agent?.status ?? props.status; const status = props.event ? props.event.status : liveStatus; const statusLabel = props.event?.label ?? m(subagentStatusVisual(liveStatus).label); @@ -540,7 +561,7 @@ function SubagentTimelineLink(props: { data-v2-item-type="subagent" aria-label={gt("Open {title}", { title: props.title })} aria-description={statusLabel} - onClick={open} + {...trigger(open, { panel })} className={cn( className, "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", diff --git a/apps/web/src/components/chat/WorkflowOpeningBlock.tsx b/apps/web/src/components/chat/WorkflowOpeningBlock.tsx index bc2955e0aabc9..19b0a97df033b 100644 --- a/apps/web/src/components/chat/WorkflowOpeningBlock.tsx +++ b/apps/web/src/components/chat/WorkflowOpeningBlock.tsx @@ -1,4 +1,6 @@ import { T, useGT, useMessages } from "gt-react"; +import type { SideThreadOpenIntent } from "@t3tools/client-runtime/side-thread"; +import { useSideThreadTrigger } from "../../hooks/useSideThreadTrigger"; import { useAtomValue } from "@effect/atom-react"; import { isTerminalSubagentStatus, @@ -39,7 +41,7 @@ function scriptMarkdown(script: string) { export function WorkflowOpeningBlock(props: { readonly opening: WorkflowOpening; readonly environmentId: EnvironmentId; - readonly onOpenThread: (threadId: string) => void; + readonly onOpenThread: (threadId: string, intent?: SideThreadOpenIntent) => void; }) { const gt = useGT(); const { opening } = props; @@ -113,9 +115,10 @@ function WorkflowMemberRow(props: { readonly providerInstanceId: ProviderInstanceId; readonly providers: ReadonlyArray; readonly driver: ProviderDriverKind | undefined; - readonly onOpenThread: (threadId: string) => void; + readonly onOpenThread: (threadId: string, intent?: SideThreadOpenIntent) => void; }) { const gt = useGT(); + const trigger = useSideThreadTrigger(); const { member } = props; const threadId = member.childThreadId; const failed = member.status === "failed"; @@ -142,7 +145,7 @@ function WorkflowMemberRow(props: { type="button" aria-label={gt("Open {title}", { title: member.title })} aria-description={member.status} - onClick={() => props.onOpenThread(threadId)} + {...trigger((intent) => props.onOpenThread(threadId, intent))} className={cn( className, "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", diff --git a/apps/web/src/components/chat/timelineRowContext.ts b/apps/web/src/components/chat/timelineRowContext.ts index 2373193588f06..5ff5c032db981 100644 --- a/apps/web/src/components/chat/timelineRowContext.ts +++ b/apps/web/src/components/chat/timelineRowContext.ts @@ -1,4 +1,5 @@ import type { ToolCallDiffTarget } from "../../diffPanelStore"; +import type { SideThreadOpenIntent } from "@t3tools/client-runtime/side-thread"; import type { ProviderApprovalDecision, ResponseContextRecord, @@ -85,6 +86,8 @@ export interface TimelineRowSharedState { onOpenThread: ( threadId: OrchestrationV2TurnItem["threadId"], environmentId?: EnvironmentId, + /** How the click asked to open a subagent or side chat; a plain click when absent. */ + intent?: SideThreadOpenIntent, ) => void; workflowOpening: WorkflowOpening | null; /** Absent hides "Fork from this response", as in the guest view. */ diff --git a/apps/web/src/components/chat/useRightPanelActions.ts b/apps/web/src/components/chat/useRightPanelActions.ts index c2da4e2f6dd5b..12d348de050b8 100644 --- a/apps/web/src/components/chat/useRightPanelActions.ts +++ b/apps/web/src/components/chat/useRightPanelActions.ts @@ -207,7 +207,7 @@ export function useRightPanelActions(input: RightPanelActionsInput) { if (surface.kind === "terminal") { focusTerminal(activeThreadRef, surface.activeTerminalId); } - if (surface.kind === "side-chat") { + if (surface.kind === "thread") { requestWorkspaceFocus({ area: "panel", selector: `[data-side-chat-pane="${CSS.escape(surface.threadId)}"] [data-workspace-area="composer"] [contenteditable="true"]`, diff --git a/apps/web/src/components/chat/useSideChat.ts b/apps/web/src/components/chat/useSideChat.ts index 7a423f9f99a1b..805e6394ddb5a 100644 --- a/apps/web/src/components/chat/useSideChat.ts +++ b/apps/web/src/components/chat/useSideChat.ts @@ -120,7 +120,7 @@ export function useSideChat(input: { } else if (modelSelection !== undefined) { useComposerDraftStore.getState().setModelSelection(targetRef, modelSelection); } - useRightPanelStore.getState().openSideChat(threadRef, targetThreadId); + useRightPanelStore.getState().openThread(threadRef, targetThreadId); return true; }; const open = async (message?: SideChatMessage) => { diff --git a/apps/web/src/components/chat/useThreadLifecycle.tsx b/apps/web/src/components/chat/useThreadLifecycle.tsx index 54989e73c4bc6..31dceea0ce919 100644 --- a/apps/web/src/components/chat/useThreadLifecycle.tsx +++ b/apps/web/src/components/chat/useThreadLifecycle.tsx @@ -79,7 +79,8 @@ import { useAtomValue } from "@effect/atom-react"; import type { RunStopPresentation } from "@t3tools/client-runtime/state/thread-execution"; import { Atom } from "effect/reactivity"; import { environmentThreadDetails } from "../../state/threads"; -import { resolveThreadOpenRoute } from "../../lib/sideChatPane"; +import { type SideThreadOpenIntent, sideThreadKindOf } from "@t3tools/client-runtime/side-thread"; +import { openSideThread, resolveThreadOpenRoute } from "../../lib/sideChatPane"; import type { useLocalDispatchState } from "./useLocalDispatchState"; const RELATED_THREAD_SHELL_WAIT_MS = 1_000; @@ -474,9 +475,11 @@ export function useThreadLifecycle(input: ThreadLifecycleInput) { const handleStopBackgroundWorkStable = useStableCallback(handleStopBackgroundWork); const openRelatedThreadGenerationRef = useRef(0); // A task delegated to a linked environment opens there; the default is this thread's own. + // `intent` comes from the rows that open a subagent, and says the thread is one. const onOpenRelatedThread = async ( threadId: ThreadId, threadEnvironmentId: EnvironmentId = environmentId, + intent?: SideThreadOpenIntent, ) => { const generation = ++openRelatedThreadGenerationRef.current; const threadRef = scopeThreadRef(threadEnvironmentId, threadId); @@ -504,6 +507,21 @@ export function useThreadLifecycle(input: ThreadLifecycleInput) { toastManager.add({ type: "info", title: m(msg("This thread is no longer available")) }); return; } + // A subagent or side chat opens beside this thread or in its place; its own parent, like any + // other thread, only in its place. + if ( + (intent !== undefined || sideThreadKindOf(shell) !== null) && + activeThread?.lineage.parentThreadId !== threadId + ) { + openSideThread({ + threadRef, + panelRef: activeThreadRef, + intent: intent ?? "primary", + navigate: (ref) => + void navigate({ to: "/$environmentId/$threadId", params: buildThreadRouteParams(ref) }), + }); + return; + } const routeRef = resolveThreadOpenRoute(threadRef, shell); if (scopedThreadKey(routeRef) === routeThreadKey) return; void navigate({ diff --git a/apps/web/src/components/settings/SettingsPanels.tsx b/apps/web/src/components/settings/SettingsPanels.tsx index e0a12417848fa..493d8a1e79565 100644 --- a/apps/web/src/components/settings/SettingsPanels.tsx +++ b/apps/web/src/components/settings/SettingsPanels.tsx @@ -579,6 +579,9 @@ export function useSettingsRestore(onRestored?: () => void) { ...(settings.followUpBehavior !== DEFAULT_UNIFIED_SETTINGS.followUpBehavior ? [gt("Follow-up behavior")] : []), + ...(settings.sideThreadOpenTarget !== DEFAULT_UNIFIED_SETTINGS.sideThreadOpenTarget + ? [gt("Open subagents and side chats in")] + : []), ...(settings.toolCallVisibility !== DEFAULT_UNIFIED_SETTINGS.toolCallVisibility ? [gt("Tool calls in chat")] : []), @@ -710,6 +713,7 @@ export function useSettingsRestore(onRestored?: () => void) { composerRichTextEnabled: DEFAULT_UNIFIED_SETTINGS.composerRichTextEnabled, sendShortcut: DEFAULT_UNIFIED_SETTINGS.sendShortcut, followUpBehavior: DEFAULT_UNIFIED_SETTINGS.followUpBehavior, + sideThreadOpenTarget: DEFAULT_UNIFIED_SETTINGS.sideThreadOpenTarget, toolCallVisibility: DEFAULT_UNIFIED_SETTINGS.toolCallVisibility, screenReaderAnnouncements: DEFAULT_UNIFIED_SETTINGS.screenReaderAnnouncements, screenReaderWindowTitle: DEFAULT_UNIFIED_SETTINGS.screenReaderWindowTitle, @@ -1393,6 +1397,63 @@ export function ChatSettingsPanel() { /> + + + updateSettings({ + sideThreadOpenTarget: DEFAULT_UNIFIED_SETTINGS.sideThreadOpenTarget, + }) + } + /> + ) : null + } + control={ + + } + /> + + diff --git a/apps/web/src/components/settings/settingsSearch.test.ts b/apps/web/src/components/settings/settingsSearch.test.ts index 52dadd9c8fb29..3949a9109190f 100644 --- a/apps/web/src/components/settings/settingsSearch.test.ts +++ b/apps/web/src/components/settings/settingsSearch.test.ts @@ -81,6 +81,12 @@ describe("searchSettings", () => { expect(searchSettings("1password").map((item) => item.to)).not.toContain("/settings/secrets"); }); + it("finds where subagents and side chats open by any of its names", () => { + for (const query of ["side panel", "subagent", "side chat", "linked thread", "middle click"]) { + expect(searchSettings(query).map((item) => item.id)).toContain("side-thread-open-target"); + } + }); + it("finds the Scheduled tasks page", () => { expect(searchSettings("scheduled tasks")[0]).toMatchObject({ id: "scheduled-tasks", diff --git a/apps/web/src/components/settings/settingsSearch.ts b/apps/web/src/components/settings/settingsSearch.ts index 51ac4d7e19add..24d93790eb72a 100644 --- a/apps/web/src/components/settings/settingsSearch.ts +++ b/apps/web/src/components/settings/settingsSearch.ts @@ -805,6 +805,16 @@ export const SETTINGS_SEARCH_ITEMS = [ to: "/settings/chat", searchTerms: [msg("queue steer running turn send default behavior composer")], }, + { + id: "side-thread-open-target", + title: msg("Open subagents and side chats in"), + to: "/settings/chat", + searchTerms: [ + msg( + "subagent side chat linked thread click right panel side panel main view command ctrl middle click", + ), + ], + }, { id: "provider-update-checks", title: msg("Provider update checks"), diff --git a/apps/web/src/hooks/useOpenSurfaceInMainView.ts b/apps/web/src/hooks/useOpenSurfaceInMainView.ts new file mode 100644 index 0000000000000..c0e06d7873dfd --- /dev/null +++ b/apps/web/src/hooks/useOpenSurfaceInMainView.ts @@ -0,0 +1,30 @@ +import { scopeThreadRef } from "@t3tools/client-runtime/environment"; +import type { ScopedThreadRef } from "@t3tools/contracts"; +import { useNavigate } from "@tanstack/react-router"; + +import { type LinkedThreadSurface, linkedThreadRouteParams } from "../linkedThreadSurface"; +import { type ThreadSurface, useRightPanelStore } from "../rightPanelStore"; +import { buildThreadRouteParams } from "../threadRoutes"; + +/** + * Moves a side thread's tab from `panelRef`'s panel to the main screen. The tab closes, without + * the cleanup Close does, so the way back does not show the thread beside itself. + */ +export function useOpenSurfaceInMainView(panelRef: ScopedThreadRef | null) { + const navigate = useNavigate(); + return (surface: ThreadSurface | LinkedThreadSurface) => { + if (panelRef === null) return; + useRightPanelStore.getState().closeSurface(panelRef, surface.id); + if (surface.kind === "linked-thread") { + void navigate({ + to: "/linked/$viaEnvironmentId/$environmentId/$threadId", + params: linkedThreadRouteParams(surface), + }); + return; + } + void navigate({ + to: "/$environmentId/$threadId", + params: buildThreadRouteParams(scopeThreadRef(panelRef.environmentId, surface.threadId)), + }); + }; +} diff --git a/apps/web/src/hooks/useRightPanelSurfaceClose.ts b/apps/web/src/hooks/useRightPanelSurfaceClose.ts index e3a4dc72a79a0..978090d3ee61a 100644 --- a/apps/web/src/hooks/useRightPanelSurfaceClose.ts +++ b/apps/web/src/hooks/useRightPanelSurfaceClose.ts @@ -20,11 +20,9 @@ import { useRightPanelStore, type RightPanelSurface, } from "../rightPanelStore"; -import { appAtomRegistry } from "../rpc/atomRegistry"; import { readThreadShell } from "../state/entities"; import { previewEnvironment } from "../state/preview"; import { readEnvironmentScope, useEnvironmentScope } from "../state/session"; -import { environmentShell } from "../state/shell"; import { threadEnvironment } from "../state/threads"; import { useAtomCommand } from "../state/use-atom-command"; import { useTerminalUiStateStore } from "../terminalUiStateStore"; @@ -72,13 +70,12 @@ export function useRightPanelSurfaceClose(input: { } } if ( - surface.kind === "side-chat" && - readEnvironmentScope(ref.environmentId, AuthOrchestrationOperateScope) && - // A live shell without the side chat means it is already deleted. - !( - appAtomRegistry.get(environmentShell.stateValueAtom(ref.environmentId)).status === "live" && - readThreadShell(scopeThreadRef(ref.environmentId, surface.threadId)) === null - ) + surface.kind === "thread" && + // Only a side chat the shell still lists is thrown away with its tab; a subagent belongs to + // its parent's work, and an unlisted side chat is already deleted. + readThreadShell(scopeThreadRef(ref.environmentId, surface.threadId))?.lineage.sideChat === + true && + readEnvironmentScope(ref.environmentId, AuthOrchestrationOperateScope) ) { // The server keeps a side chat with a run or message. Reopen skips one it deleted. void deleteThread({ diff --git a/apps/web/src/hooks/useSideThreadTrigger.ts b/apps/web/src/hooks/useSideThreadTrigger.ts new file mode 100644 index 0000000000000..381f042446e4a --- /dev/null +++ b/apps/web/src/hooks/useSideThreadTrigger.ts @@ -0,0 +1,65 @@ +import { + type SideThreadOpenIntent, + sideThreadOpenIntentOf, +} from "@t3tools/client-runtime/side-thread"; +import { useGT } from "gt-react"; +import { createContext, use, type KeyboardEvent, type MouseEvent } from "react"; + +import { contextMenuSourceOf } from "../contextMenuSource"; +import { isMacPlatform } from "../lib/utils"; +import { readLocalApi } from "../localApi"; + +/** + * False where the threads a view names cannot be opened from it, such as a read-only timeline + * with no environment behind it. Nothing that would open one is offered there. + */ +export const SideThreadsOpenContext = createContext(true); + +/** + * The handlers every row, card and chip that opens a subagent, a side chat or a linked thread + * shares: click and Enter open it where the setting says, the modifier or a middle click in the + * other place, and the context menu names both. Pass `panel: false` where no panel can show it. + * Where threads cannot be opened (`SideThreadsOpenContext`) it gives no handlers at all. + */ +export function useSideThreadTrigger() { + const gt = useGT(); + const canOpen = use(SideThreadsOpenContext); + return (open: (intent: SideThreadOpenIntent) => void, options?: { readonly panel?: boolean }) => { + if (!canOpen) return {}; + const mac = isMacPlatform(navigator.platform); + return { + onClick: (event: MouseEvent) => open(sideThreadOpenIntentOf(event, mac)), + // Middle button: keeps the browser's autoscroll from starting under the click. + onMouseDown: (event: MouseEvent) => { + if (event.button === 1) event.preventDefault(); + }, + onAuxClick: (event: MouseEvent) => { + if (event.button !== 1) return; + event.preventDefault(); + open("alternate"); + }, + onKeyDown: (event: KeyboardEvent) => { + if (event.key !== "Enter" || sideThreadOpenIntentOf(event, mac) !== "alternate") return; + event.preventDefault(); + open("alternate"); + }, + onContextMenu: (event: MouseEvent) => { + const api = readLocalApi(); + if (!api) return; + event.preventDefault(); + event.stopPropagation(); + const items = [ + ...(options?.panel === false + ? [] + : ([{ id: "panel", label: gt("Open in side panel") }] as const)), + { id: "main", label: gt("Open in main view") }, + ] as const; + void api.contextMenu + .show(items, { x: event.clientX, y: event.clientY }, contextMenuSourceOf(event)) + .then((clicked) => { + if (clicked === "panel" || clicked === "main") open(clicked); + }); + }, + }; + }; +} diff --git a/apps/web/src/i18n/translations/de.json b/apps/web/src/i18n/translations/de.json index 6bf4e782aad8d..0f3185ce7f9bb 100644 --- a/apps/web/src/i18n/translations/de.json +++ b/apps/web/src/i18n/translations/de.json @@ -2367,6 +2367,7 @@ "566810ac726b119a": "{title} stummschalten", "f6d1af395ae7bfcb": "Name des Geräte-Tabs", "e7ba2fded155ecdd": "{title}, {state}", + "2906d1220b6a2872": "In Hauptansicht öffnen", "69ba5155e6e2ef95": "Umbenennen", "44c90f8f19346bfb": "Andere schließen", "e6cd4726a7513754": "Rechts davon schließen", @@ -2844,6 +2845,7 @@ "276c7fa42a15a542": "Aktualisiere ältere Server, um diese Einstellung zu speichern.", "52163ddccc1eb594": "Einstellung in einigen Umgebungen gespeichert", "fee07035b4a2a1c3": "Gespeichert auf {environments}.", + "2a1ecf7863e204aa": "In Seitenleiste öffnen", "8a7ee5752bb91550": "Kopieren fehlgeschlagen. Gib stattdessen {command} ein.", "7dfdfa116c6a9d86": "Einordnung konnte nicht gestartet werden", "25fe0f5f3ef3bb02": "{description} Führe stattdessen {command} in einem Terminal auf diesem Rechner aus.", @@ -3618,11 +3620,10 @@ " verknüpft. Der Agent kann diese Verknüpfung so verwenden; ändere den Zugriff unter Einstellungen → Umgebungen." ], "000b0df227182d39": "Andere Adresse…", + "fd07b24350a7643f": "einer verknüpften Umgebung", "6bb5b1b35b2796ae": "Auf {label} über {via} · Arbeitet", "a73b7ab25d6e9bdf": "Auf {label} über {via}", "009e2ca841fdc1ef": "diese Umgebung", - "8cb2e5692c4f05ab": "Öffne diesen Thread auf {label}, um diese Darstellung zu sehen.", - "745a0b899008618c": "Frühere Runden konnten nicht geladen werden. Versuche es erneut.", "4ab24e2807a0d82f": "Mit {label} verbunden", "b797c7beccf2dc46": "Dieses Gerät ist damit gekoppelt und kann seine Threads verwenden.", "d8c4a71a728fcf68": "Verbindung mit {label} wird hergestellt…", @@ -3630,8 +3631,11 @@ "a5424a5a76e10aa3": "Tritt einem Netzwerk bei, in dem es sich befindet, etwa seinem Tailscale-Netzwerk, und versuche es erneut. Du kannst hier weiterlesen.", "1942567fd95da447": "{label} benötigt einen Kopplungscode", "0f62d432499e13f9": "Erstelle dort einen und füge es diesem Gerät als Umgebung hinzu.", + "8cb2e5692c4f05ab": "Öffne diesen Thread auf {label}, um diese Darstellung zu sehen.", + "745a0b899008618c": "Frühere Runden konnten nicht geladen werden. Versuche es erneut.", "0014ce0aaf1bd68a": "Schreibgeschützt", "10ca916def8211d4": "Code eingeben", + "a446e3bda256c2b3": "Verbinden, um zu interagieren", "d0bda35aeec66684": [ "Wird von ", { @@ -3642,7 +3646,6 @@ " gelesen …" ], "c3e8cd9bf44e2f43": "Angezeigt wird, was zuvor gelesen wurde.", - "a446e3bda256c2b3": "Verbinden, um zu interagieren", "eb6e0584cf4a2a1d": "Sprache: {language}", "d76c606a3c519b78": "Zeilenumbruch deaktivieren", "2b683498cee8c8a7": "Zeilen umbrechen", @@ -3963,14 +3966,18 @@ "5e7157db126f1641": "Issues nicht verfügbar", "42ade0e14ff6af94": "Aktualisiere den T3-Code-Server dieser Umgebung, um Issues zu durchsuchen.", "993dcd04611f9571": "Sicher speichern", + "6a116665c8d9ad75": "Nebenchat schließen", + "c868f340c06cddf0": "Thread schließen", + "f0ef94e00bcc0a92": "Subagent schließen", "ccbe48efc8e30c52": "Nebenchat „{title}“ löschen?", "3a859b690f41e899": "Dadurch wird sein Gesprächsverlauf dauerhaft gelöscht.", "980f2db81b9eb4b5": "Der Nebenchat konnte nicht gelöscht werden", "c1844a6d9443df20": "Fügt diesen Nebenchat der nächsten Nachricht des Haupt-Threads hinzu.", "e42d6bd2de470521": "Nebenchat löschen", - "6a116665c8d9ad75": "Nebenchat schließen", + "750af44c1cdd4667": "In Hauptansicht öffnen", "a5e57fdfde50aade": "Zum Chat hinzufügen", "492a438bf9dbd45d": "Dieser Nebenchat wurde gelöscht.", + "255a537ab23ddd2d": "Dieser Thread ist nicht mehr verfügbar.", "7350aa3df15b9802": "Skill {label}", "9ff9f24d1568fbaf": "Für diesen Skill ist keine Beschreibung verfügbar.", "274e087f814611a7": "Anweisungen anzeigen", @@ -4196,9 +4203,9 @@ "5e7eb0f2952de1b2": "Ersetzt", "59bcb9db3f0f59ea": "Inaktiv", "94124ad2133e3aed": "Unbekannt", - "1a6f6154d1cb51a9": "Nebenchat in diesem Chat öffnen", + "000646e27e304b8b": "Nebenchat öffnen", "56567586cbe00c86": "Kontextübergabe in diesem Chat öffnen", - "7fe7d5ae5fb4a655": "Subagent in diesem Chat öffnen", + "405e76cdd602bbcf": "Subagent öffnen", "520c15dbd507b804": "Übergeordneten Agenten in diesem Chat öffnen", "309b160785f6c473": "Fork in diesem Chat öffnen", "6676cd4b8299663f": "Übergeordneten Thread in diesem Chat öffnen", @@ -9833,6 +9840,7 @@ "2407d5d61e7f7206": "Rich-Text-Eingabefeld", "64b8fd2c284c3137": "Tastenkürzel zum Senden", "6163f91bddf474ae": "Verhalten bei Folgenachrichten", + "425021487583cf8a": "Subagenten und Nebenchats öffnen in", "856812e7e1fc445e": "Tool-Aufrufe im Chat", "216ed20b6f40fa6f": "Screenreader-Ansagen", "0ce04933a7047deb": "Fenstertitel für Screenreader", @@ -9890,6 +9898,12 @@ "1ea00f7b1a88ee2e": "Verhalten bei Folgenachrichten auf Standard zurücksetzen", "845e7f34c156ffd4": "Einreihen", "81a74689d0319316": "Umlenken", + "6dc57547546cbe96": "Subagenten und Nebenchats", + "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.", + "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.", + "1eba4b1f5ae00974": "Öffnungsort für Subagenten und Nebenchats auf Standard zurücksetzen", + "f8062ccf65d4bb2a": "Seitenleiste", + "a8072bdf7ae4a288": "Hauptansicht", "162108e16ed96771": "Screenreader", "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.", "5848a9c1d77f45b2": "Tool-Aufrufe im Chat auf Standard zurücksetzen", @@ -9973,6 +9987,8 @@ "b9ebecdb8db71466": "Systemstandard folgt dem Uhrzeitformat deines Browsers oder Betriebssystems.", "62f8a7774dc1ffb7": "Einreihen", "c711b55bc1500f08": "Umlenken", + "e79128045796685d": "Seitenleiste", + "d81dc62319ba223e": "Hauptansicht", "54139af0114a2729": "Rot & Grün (Standard)", "8d4a851d370639e4": "Blau & Orange", "b1d7c1ea891b7db5": "Ausgeklappt", @@ -11603,6 +11619,7 @@ "ade91c8927c48175": "eingabefeld rich text tiptap fett kursiv markdown formatiert wysiwyg", "34d74827c2a8b009": "enter return befehl strg ctrl mehrzeilig prompt neue zeile eingabefeld", "9d1013084c46ecce": "warteschlange einreihen umlenken laufende runde senden standardverhalten eingabefeld", + "e5e7f5e1fb1f2e4c": "subagent nebenchat verknüpfter thread klick rechte leiste seitenleiste hauptansicht befehl strg mittelklick", "5b8b854de7ee6f4d": "installierte cli versionen neuer verfügbar codex claude cursor grok fx kiro opencode", "64f12530d55d2ad1": "fortsetzen laufende aktive unterbrochene arbeit neustart rechner absturz desktop update automatisch", "214a98497c4ed05d": "caffeinate ruhezustand verhindern wach bleiben energie laptop deckel inhibit", diff --git a/apps/web/src/i18n/translations/en.json b/apps/web/src/i18n/translations/en.json index 3ed9b5b0b09ca..d180012e24866 100644 --- a/apps/web/src/i18n/translations/en.json +++ b/apps/web/src/i18n/translations/en.json @@ -2367,6 +2367,7 @@ "566810ac726b119a": "Mute {title}", "f6d1af395ae7bfcb": "Device tab name", "e7ba2fded155ecdd": "{title}, {state}", + "2906d1220b6a2872": "Open in main view", "69ba5155e6e2ef95": "Rename", "44c90f8f19346bfb": "Close others", "e6cd4726a7513754": "Close to the right", @@ -2843,6 +2844,7 @@ "276c7fa42a15a542": "Update older servers to save this setting.", "52163ddccc1eb594": "Setting saved on some environments", "fee07035b4a2a1c3": "Saved on {environments}.", + "2a1ecf7863e204aa": "Open in side panel", "8a7ee5752bb91550": "Could not copy. Type {command} instead.", "7dfdfa116c6a9d86": "Could not start triage", "25fe0f5f3ef3bb02": "{description} Run {command} in a terminal on that machine instead.", @@ -3617,11 +3619,10 @@ ". The agent can use that link as it is; change its access in Settings → Environments." ], "000b0df227182d39": "Another address…", + "fd07b24350a7643f": "a linked environment", "6bb5b1b35b2796ae": "On {label} via {via} · Working", "a73b7ab25d6e9bdf": "On {label} via {via}", "009e2ca841fdc1ef": "this environment", - "8cb2e5692c4f05ab": "Open this thread on {label} to see this visual.", - "745a0b899008618c": "Could not load earlier turns. Try again.", "4ab24e2807a0d82f": "Connected to {label}", "b797c7beccf2dc46": "This device is paired with it and can use its threads.", "d8c4a71a728fcf68": "Connecting to {label}…", @@ -3629,8 +3630,11 @@ "a5424a5a76e10aa3": "Join a network it is on, such as its Tailscale network, and try again. You can keep reading here.", "1942567fd95da447": "{label} needs a pairing code", "0f62d432499e13f9": "Create one on it, then add it to this device as an environment.", + "8cb2e5692c4f05ab": "Open this thread on {label} to see this visual.", + "745a0b899008618c": "Could not load earlier turns. Try again.", "0014ce0aaf1bd68a": "Read-only", "10ca916def8211d4": "Enter code", + "a446e3bda256c2b3": "Connect to interact", "d0bda35aeec66684": [ "Reading from ", { @@ -3641,7 +3645,6 @@ "…" ], "c3e8cd9bf44e2f43": "Showing what was read before.", - "a446e3bda256c2b3": "Connect to interact", "eb6e0584cf4a2a1d": "Language: {language}", "d76c606a3c519b78": "Disable line wrap", "2b683498cee8c8a7": "Wrap lines", @@ -3961,14 +3964,18 @@ "5e7157db126f1641": "Issues unavailable", "42ade0e14ff6af94": "Update this environment's T3 Code server to browse issues.", "993dcd04611f9571": "Save securely", + "6a116665c8d9ad75": "Close side chat", + "c868f340c06cddf0": "Close thread", + "f0ef94e00bcc0a92": "Close subagent", "ccbe48efc8e30c52": "Delete side chat \"{title}\"?", "3a859b690f41e899": "This permanently clears its conversation history.", "980f2db81b9eb4b5": "Could not delete the side chat", "c1844a6d9443df20": "Adds this side chat to the main thread's next message.", "e42d6bd2de470521": "Delete side chat", - "6a116665c8d9ad75": "Close side chat", + "750af44c1cdd4667": "Open in main view", "a5e57fdfde50aade": "Add to chat", "492a438bf9dbd45d": "This side chat was deleted.", + "255a537ab23ddd2d": "This thread is no longer available.", "7350aa3df15b9802": "Skill {label}", "9ff9f24d1568fbaf": "No description is available for this skill.", "274e087f814611a7": "View instructions", @@ -4195,9 +4202,9 @@ "5e7eb0f2952de1b2": "Superseded", "59bcb9db3f0f59ea": "Idle", "94124ad2133e3aed": "Unknown", - "1a6f6154d1cb51a9": "Open side chat in this chat", + "000646e27e304b8b": "Open side chat", "56567586cbe00c86": "Open context transfer in this chat", - "7fe7d5ae5fb4a655": "Open subagent in this chat", + "405e76cdd602bbcf": "Open subagent", "520c15dbd507b804": "Open parent agent in this chat", "309b160785f6c473": "Open fork in this chat", "6676cd4b8299663f": "Open parent thread in this chat", @@ -9842,6 +9849,7 @@ "2407d5d61e7f7206": "Rich text composer", "64b8fd2c284c3137": "Send shortcut", "6163f91bddf474ae": "Follow-up behavior", + "425021487583cf8a": "Open subagents and side chats in", "856812e7e1fc445e": "Tool calls in chat", "216ed20b6f40fa6f": "Screen reader announcements", "0ce04933a7047deb": "Screen reader window title", @@ -9899,6 +9907,12 @@ "1ea00f7b1a88ee2e": "Reset follow-up behavior to default", "845e7f34c156ffd4": "Queue", "81a74689d0319316": "Steer", + "6dc57547546cbe96": "Subagents and side chats", + "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.", + "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.", + "1eba4b1f5ae00974": "Reset where subagents and side chats open to default", + "f8062ccf65d4bb2a": "Side panel", + "a8072bdf7ae4a288": "Main view", "162108e16ed96771": "Screen reader", "18807e775248380c": "Hide the commands, edits, and searches agents run. Hide successful keeps failures. Zen shows only final answers. Approvals, questions, and errors always show.", "5848a9c1d77f45b2": "Reset tool calls in chat to default", @@ -9982,6 +9996,8 @@ "b9ebecdb8db71466": "System default follows your browser or OS clock preference.", "62f8a7774dc1ffb7": "Queue", "c711b55bc1500f08": "Steer", + "e79128045796685d": "Side panel", + "d81dc62319ba223e": "Main view", "54139af0114a2729": "Red & green (default)", "8d4a851d370639e4": "Blue & orange", "b1d7c1ea891b7db5": "Expanded", @@ -11611,6 +11627,7 @@ "ade91c8927c48175": "composer rich text tiptap bold italic markdown styled wysiwyg", "34d74827c2a8b009": "enter return command ctrl multiline prompt new line composer", "9d1013084c46ecce": "queue steer running turn send default behavior composer", + "e5e7f5e1fb1f2e4c": "subagent side chat linked thread click right panel side panel main view command ctrl middle click", "5b8b854de7ee6f4d": "installed cli versions newer available codex claude cursor grok fx kiro opencode", "64f12530d55d2ad1": "resume running active interrupted work restart reboot machine crash desktop update automatically", "214a98497c4ed05d": "caffeinate sleep prevent stay awake power laptop lid inhibit", diff --git a/apps/web/src/i18n/translations/es.json b/apps/web/src/i18n/translations/es.json index dd9280abac65f..b47e1dc6e2ce6 100644 --- a/apps/web/src/i18n/translations/es.json +++ b/apps/web/src/i18n/translations/es.json @@ -2367,6 +2367,7 @@ "566810ac726b119a": "Silenciar {title}", "f6d1af395ae7bfcb": "Nombre de la pestaña del dispositivo", "e7ba2fded155ecdd": "{title}, {state}", + "2906d1220b6a2872": "Abrir en la vista principal", "69ba5155e6e2ef95": "Cambiar nombre", "44c90f8f19346bfb": "Cerrar las demás", "e6cd4726a7513754": "Cerrar las de la derecha", @@ -2843,6 +2844,7 @@ "276c7fa42a15a542": "Actualiza los servidores antiguos para guardar este ajuste.", "52163ddccc1eb594": "Ajuste guardado en algunos entornos", "fee07035b4a2a1c3": "Guardado en {environments}.", + "2a1ecf7863e204aa": "Abrir en el panel lateral", "8a7ee5752bb91550": "No se pudo copiar. Escribe {command} en su lugar.", "7dfdfa116c6a9d86": "No se pudo iniciar el análisis", "25fe0f5f3ef3bb02": "{description} Ejecuta {command} en una terminal de esa máquina en su lugar.", @@ -3617,11 +3619,10 @@ ". El agente puede usar ese vínculo tal cual; cambia su acceso en Ajustes → Entornos." ], "000b0df227182d39": "Otra dirección…", + "fd07b24350a7643f": "un entorno vinculado", "6bb5b1b35b2796ae": "En {label} a través de {via} · Trabajando", "a73b7ab25d6e9bdf": "En {label} a través de {via}", "009e2ca841fdc1ef": "este entorno", - "8cb2e5692c4f05ab": "Abre este hilo en {label} para ver este elemento visual.", - "745a0b899008618c": "No se pudieron cargar los turnos anteriores. Vuelve a intentarlo.", "4ab24e2807a0d82f": "Conectado a {label}", "b797c7beccf2dc46": "Este dispositivo está emparejado con él y puede usar sus hilos.", "d8c4a71a728fcf68": "Conectando con {label}…", @@ -3629,8 +3630,11 @@ "a5424a5a76e10aa3": "Únete a una red en la que esté, como su red de Tailscale, y vuelve a intentarlo. Puedes seguir leyendo aquí.", "1942567fd95da447": "{label} necesita un código de emparejamiento", "0f62d432499e13f9": "Crea uno allí y añádelo a este dispositivo como entorno.", + "8cb2e5692c4f05ab": "Abre este hilo en {label} para ver este elemento visual.", + "745a0b899008618c": "No se pudieron cargar los turnos anteriores. Vuelve a intentarlo.", "0014ce0aaf1bd68a": "Solo lectura", "10ca916def8211d4": "Introducir código", + "a446e3bda256c2b3": "Conectar para interactuar", "d0bda35aeec66684": [ "Leyendo desde ", { @@ -3641,7 +3645,6 @@ "…" ], "c3e8cd9bf44e2f43": "Se muestra lo que se leyó antes.", - "a446e3bda256c2b3": "Conectar para interactuar", "eb6e0584cf4a2a1d": "Lenguaje: {language}", "d76c606a3c519b78": "Desactivar ajuste de línea", "2b683498cee8c8a7": "Ajustar líneas", @@ -3959,14 +3962,18 @@ "5e7157db126f1641": "Issues no disponibles", "42ade0e14ff6af94": "Actualiza el servidor de T3 Code de este entorno para explorar issues.", "993dcd04611f9571": "Guardar de forma segura", + "6a116665c8d9ad75": "Cerrar chat lateral", + "c868f340c06cddf0": "Cerrar hilo", + "f0ef94e00bcc0a92": "Cerrar subagente", "ccbe48efc8e30c52": "¿Eliminar el chat lateral \"{title}\"?", "3a859b690f41e899": "Esto borra de forma permanente su historial de conversación.", "980f2db81b9eb4b5": "No se pudo eliminar el chat lateral", "c1844a6d9443df20": "Añade este chat lateral al próximo mensaje del hilo principal.", "e42d6bd2de470521": "Eliminar chat lateral", - "6a116665c8d9ad75": "Cerrar chat lateral", + "750af44c1cdd4667": "Abrir en la vista principal", "a5e57fdfde50aade": "Añadir al chat", "492a438bf9dbd45d": "Este chat lateral se eliminó.", + "255a537ab23ddd2d": "Este hilo ya no está disponible.", "7350aa3df15b9802": "Skill {label}", "9ff9f24d1568fbaf": "No hay descripción disponible para esta skill.", "274e087f814611a7": "Ver instrucciones", @@ -4193,9 +4200,9 @@ "5e7eb0f2952de1b2": "Reemplazado", "59bcb9db3f0f59ea": "Inactivo", "94124ad2133e3aed": "Desconocido", - "1a6f6154d1cb51a9": "Abrir el chat lateral en este chat", + "000646e27e304b8b": "Abrir chat lateral", "56567586cbe00c86": "Abrir la transferencia de contexto en este chat", - "7fe7d5ae5fb4a655": "Abrir el subagente en este chat", + "405e76cdd602bbcf": "Abrir subagente", "520c15dbd507b804": "Abrir el agente principal en este chat", "309b160785f6c473": "Abrir la bifurcación en este chat", "6676cd4b8299663f": "Abrir el hilo principal en este chat", @@ -9830,6 +9837,7 @@ "2407d5d61e7f7206": "Cuadro de mensaje con texto enriquecido", "64b8fd2c284c3137": "Atajo de envío", "6163f91bddf474ae": "Comportamiento de los seguimientos", + "425021487583cf8a": "Abrir subagentes y chats laterales en", "856812e7e1fc445e": "Llamadas a herramientas en el chat", "216ed20b6f40fa6f": "Anuncios del lector de pantalla", "0ce04933a7047deb": "Título de ventana para el lector de pantalla", @@ -9887,6 +9895,12 @@ "1ea00f7b1a88ee2e": "Restablecer el comportamiento de los seguimientos al valor predeterminado", "845e7f34c156ffd4": "Poner en cola", "81a74689d0319316": "Redirigir", + "6dc57547546cbe96": "Subagentes y chats laterales", + "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.", + "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.", + "1eba4b1f5ae00974": "Restablecer dónde se abren los subagentes y chats laterales al valor predeterminado", + "f8062ccf65d4bb2a": "Panel lateral", + "a8072bdf7ae4a288": "Vista principal", "162108e16ed96771": "Lector de pantalla", "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.", "5848a9c1d77f45b2": "Restablecer las llamadas a herramientas en el chat al valor predeterminado", @@ -9970,6 +9984,8 @@ "b9ebecdb8db71466": "Con «Del sistema» se usa el formato de hora de tu navegador o sistema operativo.", "62f8a7774dc1ffb7": "Poner en cola", "c711b55bc1500f08": "Redirigir", + "e79128045796685d": "Panel lateral", + "d81dc62319ba223e": "Vista principal", "54139af0114a2729": "Rojo y verde (predeterminado)", "8d4a851d370639e4": "Azul y naranja", "b1d7c1ea891b7db5": "Expandidos", @@ -11596,6 +11612,7 @@ "ade91c8927c48175": "cuadro mensaje compositor texto enriquecido tiptap negrita cursiva markdown con estilo wysiwyg", "34d74827c2a8b009": "enter intro comando ctrl multilínea prompt nueva línea cuadro mensaje compositor", "9d1013084c46ecce": "cola redirigir turno en ejecución enviar comportamiento predeterminado cuadro mensaje compositor", + "e5e7f5e1fb1f2e4c": "subagente chat lateral hilo vinculado clic panel derecho panel lateral vista principal comando ctrl clic central", "5b8b854de7ee6f4d": "instalado cli versiones más recientes disponibles codex claude cursor grok fx kiro opencode", "64f12530d55d2ad1": "reanudar en ejecución activo interrumpido trabajo reiniciar máquina fallo actualización de escritorio automáticamente", "214a98497c4ed05d": "caffeinate reposo evitar mantener activo energía portátil tapa inhibir", diff --git a/apps/web/src/i18n/translations/fr.json b/apps/web/src/i18n/translations/fr.json index f4c23672f0cef..9c4f8d60b2ba0 100644 --- a/apps/web/src/i18n/translations/fr.json +++ b/apps/web/src/i18n/translations/fr.json @@ -2367,6 +2367,7 @@ "566810ac726b119a": "Couper le son de {title}", "f6d1af395ae7bfcb": "Nom de l’onglet de l’appareil", "e7ba2fded155ecdd": "{title}, {state}", + "2906d1220b6a2872": "Ouvrir dans la vue principale", "69ba5155e6e2ef95": "Renommer", "44c90f8f19346bfb": "Fermer les autres", "e6cd4726a7513754": "Fermer les onglets à droite", @@ -2843,6 +2844,7 @@ "276c7fa42a15a542": "Mettez à jour les anciens serveurs pour enregistrer ce paramètre.", "52163ddccc1eb594": "Paramètre enregistré sur certains environnements", "fee07035b4a2a1c3": "Enregistré sur {environments}.", + "2a1ecf7863e204aa": "Ouvrir dans le panneau latéral", "8a7ee5752bb91550": "Copie impossible. Saisissez plutôt {command}.", "7dfdfa116c6a9d86": "Impossible de lancer le tri", "25fe0f5f3ef3bb02": "{description} Exécutez plutôt {command} dans un terminal sur cette machine.", @@ -3617,11 +3619,10 @@ ". L’agent peut utiliser cette association telle quelle ; modifiez son accès dans Paramètres → Environnements." ], "000b0df227182d39": "Autre adresse…", + "fd07b24350a7643f": "un environnement associé", "6bb5b1b35b2796ae": "Sur {label} via {via} · En cours", "a73b7ab25d6e9bdf": "Sur {label} via {via}", "009e2ca841fdc1ef": "cet environnement", - "8cb2e5692c4f05ab": "Ouvrez ce fil sur {label} pour voir ce visuel.", - "745a0b899008618c": "Impossible de charger les tours précédents. Réessayez.", "4ab24e2807a0d82f": "Connecté à {label}", "b797c7beccf2dc46": "Cet appareil y est appairé et peut utiliser ses fils.", "d8c4a71a728fcf68": "Connexion à {label}…", @@ -3629,8 +3630,11 @@ "a5424a5a76e10aa3": "Rejoignez un réseau sur lequel il se trouve, comme son réseau Tailscale, puis réessayez. Vous pouvez continuer à lire ici.", "1942567fd95da447": "{label} nécessite un code d’appairage", "0f62d432499e13f9": "Créez-en un dessus, puis ajoutez-le à cet appareil comme environnement.", + "8cb2e5692c4f05ab": "Ouvrez ce fil sur {label} pour voir ce visuel.", + "745a0b899008618c": "Impossible de charger les tours précédents. Réessayez.", "0014ce0aaf1bd68a": "Lecture seule", "10ca916def8211d4": "Saisir le code", + "a446e3bda256c2b3": "Se connecter pour interagir", "d0bda35aeec66684": [ "Lecture depuis ", { @@ -3641,7 +3645,6 @@ "…" ], "c3e8cd9bf44e2f43": "Affichage de ce qui a été lu auparavant.", - "a446e3bda256c2b3": "Se connecter pour interagir", "eb6e0584cf4a2a1d": "Langage : {language}", "d76c606a3c519b78": "Désactiver le retour à la ligne", "2b683498cee8c8a7": "Retour à la ligne", @@ -3960,14 +3963,18 @@ "5e7157db126f1641": "Tickets indisponibles", "42ade0e14ff6af94": "Mettez à jour le serveur T3 Code de cet environnement pour parcourir les tickets.", "993dcd04611f9571": "Enregistrer de façon sécurisée", + "6a116665c8d9ad75": "Fermer la discussion annexe", + "c868f340c06cddf0": "Fermer le fil", + "f0ef94e00bcc0a92": "Fermer le sous-agent", "ccbe48efc8e30c52": "Supprimer la discussion annexe « {title} » ?", "3a859b690f41e899": "Cela efface définitivement son historique de conversation.", "980f2db81b9eb4b5": "Impossible de supprimer la discussion annexe", "c1844a6d9443df20": "Ajoute cette discussion annexe au prochain message du fil principal.", "e42d6bd2de470521": "Supprimer la discussion annexe", - "6a116665c8d9ad75": "Fermer la discussion annexe", + "750af44c1cdd4667": "Ouvrir dans la vue principale", "a5e57fdfde50aade": "Ajouter à la discussion", "492a438bf9dbd45d": "Cette discussion annexe a été supprimée.", + "255a537ab23ddd2d": "Ce fil n’est plus disponible.", "7350aa3df15b9802": "Skill {label}", "9ff9f24d1568fbaf": "Aucune description n’est disponible pour ce skill.", "274e087f814611a7": "Voir les instructions", @@ -4194,9 +4201,9 @@ "5e7eb0f2952de1b2": "Remplacé", "59bcb9db3f0f59ea": "Inactif", "94124ad2133e3aed": "Inconnu", - "1a6f6154d1cb51a9": "Ouvrir la discussion annexe dans cette discussion", + "000646e27e304b8b": "Ouvrir la discussion annexe", "56567586cbe00c86": "Ouvrir le transfert de contexte dans cette discussion", - "7fe7d5ae5fb4a655": "Ouvrir le sous-agent dans cette discussion", + "405e76cdd602bbcf": "Ouvrir le sous-agent", "520c15dbd507b804": "Ouvrir l’agent parent dans cette discussion", "309b160785f6c473": "Ouvrir le fork dans cette discussion", "6676cd4b8299663f": "Ouvrir le fil parent dans cette discussion", @@ -9832,6 +9839,7 @@ "2407d5d61e7f7206": "Zone de saisie en texte enrichi", "64b8fd2c284c3137": "Raccourci d’envoi", "6163f91bddf474ae": "Comportement des relances", + "425021487583cf8a": "Ouvrir les sous-agents et discussions annexes dans", "856812e7e1fc445e": "Appels d’outils dans la discussion", "216ed20b6f40fa6f": "Annonces du lecteur d’écran", "0ce04933a7047deb": "Titre de fenêtre pour le lecteur d’écran", @@ -9889,6 +9897,12 @@ "1ea00f7b1a88ee2e": "Réinitialiser le comportement des relances à la valeur par défaut", "845e7f34c156ffd4": "File d’attente", "81a74689d0319316": "Réorienter", + "6dc57547546cbe96": "Sous-agents et discussions annexes", + "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.", + "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.", + "1eba4b1f5ae00974": "Réinitialiser l’emplacement d’ouverture des sous-agents et discussions annexes à la valeur par défaut", + "f8062ccf65d4bb2a": "Panneau latéral", + "a8072bdf7ae4a288": "Vue principale", "162108e16ed96771": "Lecteur d’écran", "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.", "5848a9c1d77f45b2": "Réinitialiser les appels d’outils dans la discussion à la valeur par défaut", @@ -9972,6 +9986,8 @@ "b9ebecdb8db71466": "L’option Système suit le format de l’heure de votre navigateur ou de votre OS.", "62f8a7774dc1ffb7": "File d’attente", "c711b55bc1500f08": "Réorienter", + "e79128045796685d": "Panneau latéral", + "d81dc62319ba223e": "Vue principale", "54139af0114a2729": "Rouge et vert (par défaut)", "8d4a851d370639e4": "Bleu et orange", "b1d7c1ea891b7db5": "Développés", @@ -11601,6 +11617,7 @@ "ade91c8927c48175": "zone de saisie texte enrichi tiptap gras italique markdown stylé wysiwyg", "34d74827c2a8b009": "entrée retour commande ctrl multiligne prompt nouvelle ligne zone de saisie", "9d1013084c46ecce": "file d’attente réorienter tour en cours envoyer comportement par défaut zone de saisie", + "e5e7f5e1fb1f2e4c": "sous-agent discussion annexe fil associé clic panneau droit panneau latéral vue principale commande ctrl clic du milieu", "5b8b854de7ee6f4d": "installé cli versions plus récentes disponibles codex claude cursor grok fx kiro opencode", "64f12530d55d2ad1": "reprendre en cours actif interrompu travail redémarrer redémarrage machine plantage mise à jour bureau automatiquement", "214a98497c4ed05d": "caffeinate veille empêcher rester éveillé alimentation portable capot inhiber", diff --git a/apps/web/src/i18n/translations/ja.json b/apps/web/src/i18n/translations/ja.json index 7e2d260d010ba..a1e35e2610715 100644 --- a/apps/web/src/i18n/translations/ja.json +++ b/apps/web/src/i18n/translations/ja.json @@ -2365,6 +2365,7 @@ "566810ac726b119a": "{title} をミュート", "f6d1af395ae7bfcb": "デバイスタブの名前", "e7ba2fded155ecdd": "{title}、{state}", + "2906d1220b6a2872": "メインビューで開く", "69ba5155e6e2ef95": "名前を変更", "44c90f8f19346bfb": "その他を閉じる", "e6cd4726a7513754": "右側を閉じる", @@ -2841,6 +2842,7 @@ "276c7fa42a15a542": "この設定を保存するには古いサーバーを更新してください。", "52163ddccc1eb594": "一部の環境で設定を保存しました", "fee07035b4a2a1c3": "{environments} に保存しました。", + "2a1ecf7863e204aa": "サイドパネルで開く", "8a7ee5752bb91550": "コピーできませんでした。代わりに {command} と入力してください。", "7dfdfa116c6a9d86": "トリアージを開始できませんでした", "25fe0f5f3ef3bb02": "{description} 代わりに、そのマシンのターミナルで {command} を実行してください。", @@ -3612,11 +3614,10 @@ " にリンクされています。エージェントはそのリンクをそのまま使用できます。アクセス権は [設定] → [環境] で変更してください。" ], "000b0df227182d39": "別のアドレス…", + "fd07b24350a7643f": "リンクされた環境", "6bb5b1b35b2796ae": "{label}({via} 経由) · 作業中", "a73b7ab25d6e9bdf": "{label}({via} 経由)", "009e2ca841fdc1ef": "この環境", - "8cb2e5692c4f05ab": "このビジュアルを見るには、{label} でこのスレッドを開いてください。", - "745a0b899008618c": "以前のターンを読み込めませんでした。もう一度お試しください。", "4ab24e2807a0d82f": "{label} に接続しました", "b797c7beccf2dc46": "このデバイスはペアリング済みで、そのスレッドを利用できます。", "d8c4a71a728fcf68": "{label} に接続しています…", @@ -3624,8 +3625,11 @@ "a5424a5a76e10aa3": "Tailscale ネットワークなど、そのマシンが接続しているネットワークに参加してから、もう一度お試しください。ここでは引き続き閲覧できます。", "1942567fd95da447": "{label} にはペアリングコードが必要です", "0f62d432499e13f9": "そのマシンで作成し、このデバイスに環境として追加してください。", + "8cb2e5692c4f05ab": "このビジュアルを見るには、{label} でこのスレッドを開いてください。", + "745a0b899008618c": "以前のターンを読み込めませんでした。もう一度お試しください。", "0014ce0aaf1bd68a": "読み取り専用", "10ca916def8211d4": "コードを入力", + "a446e3bda256c2b3": "接続して操作する", "d0bda35aeec66684": [ "読み取り中: ", { @@ -3636,7 +3640,6 @@ "…" ], "c3e8cd9bf44e2f43": "以前に読み取った内容を表示しています。", - "a446e3bda256c2b3": "接続して操作する", "eb6e0584cf4a2a1d": "言語: {language}", "d76c606a3c519b78": "行の折り返しを無効にする", "2b683498cee8c8a7": "行を折り返す", @@ -3950,14 +3953,18 @@ "5e7157db126f1641": "Issue を利用できません", "42ade0e14ff6af94": "Issue を参照するには、この環境の T3 Code サーバーを更新してください。", "993dcd04611f9571": "安全に保存", + "6a116665c8d9ad75": "サイドチャットを閉じる", + "c868f340c06cddf0": "スレッドを閉じる", + "f0ef94e00bcc0a92": "サブエージェントを閉じる", "ccbe48efc8e30c52": "サイドチャット「{title}」を削除しますか?", "3a859b690f41e899": "会話履歴が完全に消去されます。", "980f2db81b9eb4b5": "サイドチャットを削除できませんでした", "c1844a6d9443df20": "このサイドチャットをメインスレッドの次のメッセージに追加します。", "e42d6bd2de470521": "サイドチャットを削除", - "6a116665c8d9ad75": "サイドチャットを閉じる", + "750af44c1cdd4667": "メインビューで開く", "a5e57fdfde50aade": "チャットに追加", "492a438bf9dbd45d": "このサイドチャットは削除されました。", + "255a537ab23ddd2d": "このスレッドは利用できなくなりました。", "7350aa3df15b9802": "スキル {label}", "9ff9f24d1568fbaf": "このスキルには説明がありません。", "274e087f814611a7": "指示を表示", @@ -4184,9 +4191,9 @@ "5e7eb0f2952de1b2": "置き換え済み", "59bcb9db3f0f59ea": "アイドル", "94124ad2133e3aed": "不明", - "1a6f6154d1cb51a9": "このチャットでサイドチャットを開く", + "000646e27e304b8b": "サイドチャットを開く", "56567586cbe00c86": "このチャットでコンテキストの引き継ぎを開く", - "7fe7d5ae5fb4a655": "このチャットでサブエージェントを開く", + "405e76cdd602bbcf": "サブエージェントを開く", "520c15dbd507b804": "このチャットで親エージェントを開く", "309b160785f6c473": "このチャットでフォークを開く", "6676cd4b8299663f": "このチャットで親スレッドを開く", @@ -9784,6 +9791,7 @@ "2407d5d61e7f7206": "リッチテキスト入力欄", "64b8fd2c284c3137": "送信ショートカット", "6163f91bddf474ae": "フォローアップの動作", + "425021487583cf8a": "サブエージェントとサイドチャットを開く場所", "856812e7e1fc445e": "チャット内のツール呼び出し", "216ed20b6f40fa6f": "スクリーンリーダーの読み上げ", "0ce04933a7047deb": "スクリーンリーダー用のウィンドウタイトル", @@ -9841,6 +9849,12 @@ "1ea00f7b1a88ee2e": "フォローアップの動作をデフォルトにリセット", "845e7f34c156ffd4": "キュー", "81a74689d0319316": "軌道修正", + "6dc57547546cbe96": "サブエージェントとサイドチャット", + "ffbc33f6b6ddc689": "クリックでサブエージェント、サイドチャット、リンクされた環境のスレッドを開く場所です。{modifier} を押しながらクリックするか中クリックすると、代わりにメインビューで開きます。", + "7b7062c4b277e235": "クリックでサブエージェント、サイドチャット、リンクされた環境のスレッドを開く場所です。{modifier} を押しながらクリックするか中クリックすると、代わりにサイドパネルで開きます。", + "1eba4b1f5ae00974": "サブエージェントとサイドチャットを開く場所をデフォルトにリセット", + "f8062ccf65d4bb2a": "サイドパネル", + "a8072bdf7ae4a288": "メインビュー", "162108e16ed96771": "スクリーンリーダー", "18807e775248380c": "エージェントが実行するコマンド、編集、検索を非表示にします。「成功したものを非表示」では失敗は表示されます。Zen では最終的な回答だけを表示します。承認、質問、エラーは常に表示されます。", "5848a9c1d77f45b2": "チャット内のツール呼び出しをデフォルトにリセット", @@ -9924,6 +9938,8 @@ "b9ebecdb8db71466": "「システムのデフォルト」を選ぶと、ブラウザーまたは OS の時刻形式に従います。", "62f8a7774dc1ffb7": "キュー", "c711b55bc1500f08": "軌道修正", + "e79128045796685d": "サイドパネル", + "d81dc62319ba223e": "メインビュー", "54139af0114a2729": "赤と緑 (デフォルト)", "8d4a851d370639e4": "青とオレンジ", "b1d7c1ea891b7db5": "展開", @@ -11551,6 +11567,7 @@ "ade91c8927c48175": "入力欄 リッチテキスト Tiptap 太字 斜体 Markdown スタイル WYSIWYG rich text", "34d74827c2a8b009": "Enter Return Command Ctrl 複数行 プロンプト 改行 入力欄 shortcut", "9d1013084c46ecce": "キュー 軌道修正 実行中 ターン 送信 デフォルト 動作 入力欄 queue steer", + "e5e7f5e1fb1f2e4c": "サブエージェント サイドチャット リンクされたスレッド クリック 右パネル サイドパネル メインビュー コマンド ctrl 中クリック", "5b8b854de7ee6f4d": "インストール済み CLI バージョン 新しい 利用可能 Codex Claude Cursor Grok fx Kiro OpenCode update", "64f12530d55d2ad1": "再開 実行中 アクティブ 中断 作業 再起動 マシン クラッシュ デスクトップ 更新 自動 resume", "214a98497c4ed05d": "caffeinate スリープ 防止 スリープしない 電源 ノートパソコン 蓋 inhibit sleep", diff --git a/apps/web/src/i18n/translations/ko.json b/apps/web/src/i18n/translations/ko.json index 6e9795c9f0fd6..daccb6affe5a8 100644 --- a/apps/web/src/i18n/translations/ko.json +++ b/apps/web/src/i18n/translations/ko.json @@ -2366,6 +2366,7 @@ "566810ac726b119a": "{title} 음소거", "f6d1af395ae7bfcb": "기기 탭 이름", "e7ba2fded155ecdd": "{title}, {state}", + "2906d1220b6a2872": "메인 보기에서 열기", "69ba5155e6e2ef95": "이름 바꾸기", "44c90f8f19346bfb": "다른 탭 닫기", "e6cd4726a7513754": "오른쪽 탭 닫기", @@ -2842,6 +2843,7 @@ "276c7fa42a15a542": "이 설정을 저장하려면 이전 서버를 업데이트하세요.", "52163ddccc1eb594": "일부 환경에만 설정이 저장됨", "fee07035b4a2a1c3": "{environments}에 저장되었습니다.", + "2a1ecf7863e204aa": "사이드 패널에서 열기", "8a7ee5752bb91550": "복사할 수 없습니다. 대신 {command}을(를) 입력하세요.", "7dfdfa116c6a9d86": "분류를 시작할 수 없습니다", "25fe0f5f3ef3bb02": "{description} 대신 해당 머신의 터미널에서 {command}을(를) 실행하세요.", @@ -3612,11 +3614,10 @@ "에 연결되어 있습니다. 에이전트는 이 연결을 그대로 사용할 수 있으며, 액세스는 설정 → 환경에서 변경하세요." ], "000b0df227182d39": "다른 주소…", + "fd07b24350a7643f": "연결된 환경", "6bb5b1b35b2796ae": "{label} ({via} 경유) · 작업 중", "a73b7ab25d6e9bdf": "{label} ({via} 경유)", "009e2ca841fdc1ef": "이 환경", - "8cb2e5692c4f05ab": "이 시각 자료를 보려면 {label}에서 이 스레드를 여세요.", - "745a0b899008618c": "이전 턴을 불러올 수 없습니다. 다시 시도하세요.", "4ab24e2807a0d82f": "{label}에 연결됨", "b797c7beccf2dc46": "이 기기가 페어링되어 해당 스레드를 사용할 수 있습니다.", "d8c4a71a728fcf68": "{label}에 연결하는 중…", @@ -3624,8 +3625,11 @@ "a5424a5a76e10aa3": "Tailscale 네트워크처럼 해당 머신이 연결된 네트워크에 참여한 후 다시 시도하세요. 여기에서 계속 읽을 수 있습니다.", "1942567fd95da447": "{label}에 페어링 코드가 필요합니다", "0f62d432499e13f9": "해당 머신에서 코드를 만든 다음 이 기기에 환경으로 추가하세요.", + "8cb2e5692c4f05ab": "이 시각 자료를 보려면 {label}에서 이 스레드를 여세요.", + "745a0b899008618c": "이전 턴을 불러올 수 없습니다. 다시 시도하세요.", "0014ce0aaf1bd68a": "읽기 전용", "10ca916def8211d4": "코드 입력", + "a446e3bda256c2b3": "연결하여 상호작용", "d0bda35aeec66684": [ "읽는 중: ", { @@ -3636,7 +3640,6 @@ "…" ], "c3e8cd9bf44e2f43": "이전에 읽은 내용을 표시하고 있습니다.", - "a446e3bda256c2b3": "연결하여 상호작용", "eb6e0584cf4a2a1d": "언어: {language}", "d76c606a3c519b78": "줄 바꿈 끄기", "2b683498cee8c8a7": "줄 바꿈", @@ -3948,14 +3951,18 @@ "5e7157db126f1641": "이슈를 사용할 수 없음", "42ade0e14ff6af94": "이슈를 탐색하려면 이 환경의 T3 Code 서버를 업데이트하세요.", "993dcd04611f9571": "안전하게 저장", + "6a116665c8d9ad75": "사이드 채팅 닫기", + "c868f340c06cddf0": "스레드 닫기", + "f0ef94e00bcc0a92": "서브에이전트 닫기", "ccbe48efc8e30c52": "사이드 채팅 \"{title}\"을(를) 삭제할까요?", "3a859b690f41e899": "대화 기록이 영구적으로 삭제됩니다.", "980f2db81b9eb4b5": "사이드 채팅을 삭제할 수 없습니다", "c1844a6d9443df20": "이 사이드 채팅을 기본 스레드의 다음 메시지에 추가합니다.", "e42d6bd2de470521": "사이드 채팅 삭제", - "6a116665c8d9ad75": "사이드 채팅 닫기", + "750af44c1cdd4667": "메인 보기에서 열기", "a5e57fdfde50aade": "채팅에 추가", "492a438bf9dbd45d": "이 사이드 채팅은 삭제되었습니다.", + "255a537ab23ddd2d": "이 스레드를 더 이상 사용할 수 없습니다.", "7350aa3df15b9802": "스킬 {label}", "9ff9f24d1568fbaf": "이 스킬에 대한 설명이 없습니다.", "274e087f814611a7": "지침 보기", @@ -4181,9 +4188,9 @@ "5e7eb0f2952de1b2": "대체됨", "59bcb9db3f0f59ea": "유휴", "94124ad2133e3aed": "알 수 없음", - "1a6f6154d1cb51a9": "이 채팅에서 사이드 채팅 열기", + "000646e27e304b8b": "사이드 채팅 열기", "56567586cbe00c86": "이 채팅에서 컨텍스트 전달 열기", - "7fe7d5ae5fb4a655": "이 채팅에서 서브에이전트 열기", + "405e76cdd602bbcf": "서브에이전트 열기", "520c15dbd507b804": "이 채팅에서 상위 에이전트 열기", "309b160785f6c473": "이 채팅에서 포크 열기", "6676cd4b8299663f": "이 채팅에서 상위 스레드 열기", @@ -9787,6 +9794,7 @@ "2407d5d61e7f7206": "서식 있는 텍스트 입력창", "64b8fd2c284c3137": "보내기 단축키", "6163f91bddf474ae": "후속 메시지 동작", + "425021487583cf8a": "서브에이전트와 사이드 채팅을 여는 위치", "856812e7e1fc445e": "채팅의 도구 호출", "216ed20b6f40fa6f": "화면 낭독기 알림", "0ce04933a7047deb": "화면 낭독기 창 제목", @@ -9844,6 +9852,12 @@ "1ea00f7b1a88ee2e": "후속 메시지 동작 기본값으로 재설정", "845e7f34c156ffd4": "대기열", "81a74689d0319316": "방향 조정", + "6dc57547546cbe96": "서브에이전트와 사이드 채팅", + "ffbc33f6b6ddc689": "클릭했을 때 서브에이전트, 사이드 채팅 또는 연결된 환경의 스레드가 열리는 위치입니다. {modifier}-클릭 또는 가운데 클릭은 대신 메인 보기에서 엽니다.", + "7b7062c4b277e235": "클릭했을 때 서브에이전트, 사이드 채팅 또는 연결된 환경의 스레드가 열리는 위치입니다. {modifier}-클릭 또는 가운데 클릭은 대신 사이드 패널에서 엽니다.", + "1eba4b1f5ae00974": "서브에이전트와 사이드 채팅을 여는 위치 기본값으로 재설정", + "f8062ccf65d4bb2a": "사이드 패널", + "a8072bdf7ae4a288": "메인 보기", "162108e16ed96771": "화면 낭독기", "18807e775248380c": "에이전트가 실행하는 명령, 편집, 검색을 숨깁니다. 성공한 항목 숨기기는 실패를 남겨 둡니다. Zen은 최종 답변만 표시합니다. 승인, 질문, 오류는 항상 표시됩니다.", "5848a9c1d77f45b2": "채팅의 도구 호출 기본값으로 재설정", @@ -9927,6 +9941,8 @@ "b9ebecdb8db71466": "시스템 기본값은 브라우저 또는 OS의 시간 형식 설정을 따릅니다.", "62f8a7774dc1ffb7": "대기열", "c711b55bc1500f08": "방향 조정", + "e79128045796685d": "사이드 패널", + "d81dc62319ba223e": "메인 보기", "54139af0114a2729": "빨강 및 초록(기본값)", "8d4a851d370639e4": "파랑 및 주황", "b1d7c1ea891b7db5": "펼침", @@ -11548,6 +11564,7 @@ "ade91c8927c48175": "입력창 서식 있는 텍스트 tiptap 굵게 기울임 마크다운 스타일 wysiwyg", "34d74827c2a8b009": "enter return command ctrl 여러 줄 프롬프트 새 줄 입력창", "9d1013084c46ecce": "대기열 방향 조정 실행 중 턴 보내기 기본 동작 입력창", + "e5e7f5e1fb1f2e4c": "서브에이전트 사이드 채팅 연결된 스레드 클릭 오른쪽 패널 사이드 패널 메인 보기 커맨드 ctrl 가운데 클릭", "5b8b854de7ee6f4d": "설치된 CLI 버전 최신 사용 가능 Codex Claude Cursor Grok fx Kiro OpenCode", "64f12530d55d2ad1": "재개 실행 중 활성 중단된 작업 다시 시작 재부팅 머신 충돌 데스크톱 업데이트 자동", "214a98497c4ed05d": "caffeinate 절전 방지 깨어 있기 전원 노트북 덮개 inhibit", diff --git a/apps/web/src/i18n/translations/pt-BR.json b/apps/web/src/i18n/translations/pt-BR.json index dc0dbfcad030c..052f352a28f09 100644 --- a/apps/web/src/i18n/translations/pt-BR.json +++ b/apps/web/src/i18n/translations/pt-BR.json @@ -2367,6 +2367,7 @@ "566810ac726b119a": "Silenciar {title}", "f6d1af395ae7bfcb": "Nome da aba do dispositivo", "e7ba2fded155ecdd": "{title}, {state}", + "2906d1220b6a2872": "Abrir na visualização principal", "69ba5155e6e2ef95": "Renomear", "44c90f8f19346bfb": "Fechar as outras", "e6cd4726a7513754": "Fechar à direita", @@ -2843,6 +2844,7 @@ "276c7fa42a15a542": "Atualize os servidores mais antigos para salvar esta configuração.", "52163ddccc1eb594": "Configuração salva em alguns ambientes", "fee07035b4a2a1c3": "Salvo em {environments}.", + "2a1ecf7863e204aa": "Abrir no painel lateral", "8a7ee5752bb91550": "Não foi possível copiar. Digite {command}.", "7dfdfa116c6a9d86": "Não foi possível iniciar a triagem", "25fe0f5f3ef3bb02": "{description} Execute {command} em um terminal naquela máquina.", @@ -3617,11 +3619,10 @@ ". O agente pode usar esse vínculo como está; altere o acesso em Configurações → Ambientes." ], "000b0df227182d39": "Outro endereço…", + "fd07b24350a7643f": "um ambiente vinculado", "6bb5b1b35b2796ae": "Em {label} via {via} · Trabalhando", "a73b7ab25d6e9bdf": "Em {label} via {via}", "009e2ca841fdc1ef": "este ambiente", - "8cb2e5692c4f05ab": "Abra este thread em {label} para ver este visual.", - "745a0b899008618c": "Não foi possível carregar os turnos anteriores. Tente novamente.", "4ab24e2807a0d82f": "Conectado a {label}", "b797c7beccf2dc46": "Este dispositivo está pareado com ele e pode usar suas threads.", "d8c4a71a728fcf68": "Conectando a {label}…", @@ -3629,8 +3630,11 @@ "a5424a5a76e10aa3": "Entre em uma rede em que ele esteja, como a rede Tailscale dele, e tente novamente. Você pode continuar lendo aqui.", "1942567fd95da447": "{label} precisa de um código de pareamento", "0f62d432499e13f9": "Crie um nele e adicione-o a este dispositivo como ambiente.", + "8cb2e5692c4f05ab": "Abra este thread em {label} para ver este visual.", + "745a0b899008618c": "Não foi possível carregar os turnos anteriores. Tente novamente.", "0014ce0aaf1bd68a": "Somente leitura", "10ca916def8211d4": "Inserir código", + "a446e3bda256c2b3": "Conectar para interagir", "d0bda35aeec66684": [ "Lendo de ", { @@ -3641,7 +3645,6 @@ "…" ], "c3e8cd9bf44e2f43": "Mostrando o que foi lido antes.", - "a446e3bda256c2b3": "Conectar para interagir", "eb6e0584cf4a2a1d": "Linguagem: {language}", "d76c606a3c519b78": "Desativar quebra de linha", "2b683498cee8c8a7": "Quebrar linhas", @@ -3960,14 +3963,18 @@ "5e7157db126f1641": "Issues indisponíveis", "42ade0e14ff6af94": "Atualize o servidor do T3 Code deste ambiente para navegar pelas issues.", "993dcd04611f9571": "Salvar com segurança", + "6a116665c8d9ad75": "Fechar chat paralelo", + "c868f340c06cddf0": "Fechar thread", + "f0ef94e00bcc0a92": "Fechar subagente", "ccbe48efc8e30c52": "Excluir o chat paralelo \"{title}\"?", "3a859b690f41e899": "Isso apaga permanentemente o histórico dele.", "980f2db81b9eb4b5": "Não foi possível excluir o chat paralelo", "c1844a6d9443df20": "Adiciona este chat paralelo à próxima mensagem da thread principal.", "e42d6bd2de470521": "Excluir chat paralelo", - "6a116665c8d9ad75": "Fechar chat paralelo", + "750af44c1cdd4667": "Abrir na visualização principal", "a5e57fdfde50aade": "Adicionar ao chat", "492a438bf9dbd45d": "Este chat paralelo foi excluído.", + "255a537ab23ddd2d": "Esta thread não está mais disponível.", "7350aa3df15b9802": "Skill {label}", "9ff9f24d1568fbaf": "Não há descrição disponível para esta skill.", "274e087f814611a7": "Ver instruções", @@ -4193,9 +4200,9 @@ "5e7eb0f2952de1b2": "Substituído", "59bcb9db3f0f59ea": "Ocioso", "94124ad2133e3aed": "Desconhecido", - "1a6f6154d1cb51a9": "Abrir o chat paralelo neste chat", + "000646e27e304b8b": "Abrir chat paralelo", "56567586cbe00c86": "Abrir a transferência de contexto neste chat", - "7fe7d5ae5fb4a655": "Abrir o subagente neste chat", + "405e76cdd602bbcf": "Abrir subagente", "520c15dbd507b804": "Abrir o agente principal neste chat", "309b160785f6c473": "Abrir o fork neste chat", "6676cd4b8299663f": "Abrir a thread principal neste chat", @@ -9831,6 +9838,7 @@ "2407d5d61e7f7206": "Editor de texto formatado", "64b8fd2c284c3137": "Atalho de envio", "6163f91bddf474ae": "Comportamento de mensagens de acompanhamento", + "425021487583cf8a": "Abrir subagentes e chats paralelos em", "856812e7e1fc445e": "Chamadas de ferramentas no chat", "216ed20b6f40fa6f": "Anúncios do leitor de tela", "0ce04933a7047deb": "Título da janela para leitor de tela", @@ -9888,6 +9896,12 @@ "1ea00f7b1a88ee2e": "Redefinir o comportamento das mensagens de acompanhamento para o padrão", "845e7f34c156ffd4": "Enfileirar", "81a74689d0319316": "Direcionar", + "6dc57547546cbe96": "Subagentes e chats paralelos", + "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.", + "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.", + "1eba4b1f5ae00974": "Redefinir onde subagentes e chats paralelos abrem para o padrão", + "f8062ccf65d4bb2a": "Painel lateral", + "a8072bdf7ae4a288": "Visualização principal", "162108e16ed96771": "Leitor de tela", "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.", "5848a9c1d77f45b2": "Redefinir as chamadas de ferramentas no chat para o padrão", @@ -9971,6 +9985,8 @@ "b9ebecdb8db71466": "\"Padrão do sistema\" usa o formato de horário do navegador ou do sistema operacional.", "62f8a7774dc1ffb7": "Enfileirar", "c711b55bc1500f08": "Direcionar", + "e79128045796685d": "Painel lateral", + "d81dc62319ba223e": "Visualização principal", "54139af0114a2729": "Vermelho e verde (padrão)", "8d4a851d370639e4": "Azul e laranja", "b1d7c1ea891b7db5": "Expandido", @@ -11600,6 +11616,7 @@ "ade91c8927c48175": "editor de mensagens rich text tiptap negrito itálico markdown estilizado wysiwyg", "34d74827c2a8b009": "enter return command ctrl várias linhas prompt nova linha editor de mensagens", "9d1013084c46ecce": "fila enfileirar direcionar turno em execução enviar comportamento padrão editor de mensagens", + "e5e7f5e1fb1f2e4c": "subagente chat paralelo thread vinculada clique painel direito painel lateral visualização principal comando ctrl clique do meio", "5b8b854de7ee6f4d": "cli instaladas versões mais novas disponíveis codex claude cursor grok fx kiro opencode", "64f12530d55d2ad1": "retomar em execução ativo interrompido trabalho reiniciar reboot máquina falha atualização do desktop automaticamente", "214a98497c4ed05d": "caffeinate repouso impedir manter acordado energia notebook tampa inibir", diff --git a/apps/web/src/i18n/translations/ru.json b/apps/web/src/i18n/translations/ru.json index 31b603d4b2b59..7f91c9be0cc94 100644 --- a/apps/web/src/i18n/translations/ru.json +++ b/apps/web/src/i18n/translations/ru.json @@ -2367,6 +2367,7 @@ "566810ac726b119a": "Выключить звук: {title}", "f6d1af395ae7bfcb": "Название вкладки устройства", "e7ba2fded155ecdd": "{title}, {state}", + "2906d1220b6a2872": "Открыть в основном окне", "69ba5155e6e2ef95": "Переименовать", "44c90f8f19346bfb": "Закрыть остальные", "e6cd4726a7513754": "Закрыть справа", @@ -2843,6 +2844,7 @@ "276c7fa42a15a542": "Обновите старые серверы, чтобы сохранить эту настройку.", "52163ddccc1eb594": "Настройка сохранена в некоторых окружениях", "fee07035b4a2a1c3": "Сохранено на {environments}.", + "2a1ecf7863e204aa": "Открыть в боковой панели", "8a7ee5752bb91550": "Не удалось скопировать. Введите {command} вручную.", "7dfdfa116c6a9d86": "Не удалось начать разбор проблемы", "25fe0f5f3ef3bb02": "{description} Вместо этого выполните {command} в терминале на той машине.", @@ -3617,11 +3619,10 @@ ". Агент может использовать эту привязку как есть; изменить её доступ можно в «Настройки → Окружения»." ], "000b0df227182d39": "Другой адрес…", + "fd07b24350a7643f": "привязанном окружении", "6bb5b1b35b2796ae": "На {label} через {via} · Работает", "a73b7ab25d6e9bdf": "На {label} через {via}", "009e2ca841fdc1ef": "это окружение", - "8cb2e5692c4f05ab": "Откройте этот тред на {label}, чтобы увидеть это визуальное представление.", - "745a0b899008618c": "Не удалось загрузить более ранние ходы. Повторите попытку.", "4ab24e2807a0d82f": "Подключено к {label}", "b797c7beccf2dc46": "Это устройство сопряжено с ним и может работать с его тредами.", "d8c4a71a728fcf68": "Подключение к {label}…", @@ -3629,8 +3630,11 @@ "a5424a5a76e10aa3": "Подключитесь к сети, в которой оно находится, например к его сети Tailscale, и повторите попытку. Здесь можно продолжать чтение.", "1942567fd95da447": "Для {label} нужен код сопряжения", "0f62d432499e13f9": "Создайте его там и добавьте эту машину на устройство как окружение.", + "8cb2e5692c4f05ab": "Откройте этот тред на {label}, чтобы увидеть это визуальное представление.", + "745a0b899008618c": "Не удалось загрузить более ранние ходы. Повторите попытку.", "0014ce0aaf1bd68a": "Только чтение", "10ca916def8211d4": "Ввести код", + "a446e3bda256c2b3": "Подключиться для взаимодействия", "d0bda35aeec66684": [ "Чтение с ", { @@ -3641,7 +3645,6 @@ "…" ], "c3e8cd9bf44e2f43": "Показано то, что было прочитано раньше.", - "a446e3bda256c2b3": "Подключиться для взаимодействия", "eb6e0584cf4a2a1d": "Язык: {language}", "d76c606a3c519b78": "Отключить перенос строк", "2b683498cee8c8a7": "Переносить строки", @@ -3960,14 +3963,18 @@ "5e7157db126f1641": "Issue недоступны", "42ade0e14ff6af94": "Обновите сервер T3 Code в этом окружении, чтобы просматривать issue.", "993dcd04611f9571": "Сохранить безопасно", + "6a116665c8d9ad75": "Закрыть боковой чат", + "c868f340c06cddf0": "Закрыть тред", + "f0ef94e00bcc0a92": "Закрыть субагента", "ccbe48efc8e30c52": "Удалить боковой чат «{title}»?", "3a859b690f41e899": "Его история беседы будет удалена безвозвратно.", "980f2db81b9eb4b5": "Не удалось удалить боковой чат", "c1844a6d9443df20": "Добавляет этот боковой чат к следующему сообщению основного треда.", "e42d6bd2de470521": "Удалить боковой чат", - "6a116665c8d9ad75": "Закрыть боковой чат", + "750af44c1cdd4667": "Открыть в основном окне", "a5e57fdfde50aade": "Добавить в чат", "492a438bf9dbd45d": "Этот боковой чат удалён.", + "255a537ab23ddd2d": "Этот тред больше недоступен.", "7350aa3df15b9802": "Навык {label}", "9ff9f24d1568fbaf": "У этого навыка нет описания.", "274e087f814611a7": "Показать инструкции", @@ -4193,9 +4200,9 @@ "5e7eb0f2952de1b2": "Заменён", "59bcb9db3f0f59ea": "Простаивает", "94124ad2133e3aed": "Неизвестно", - "1a6f6154d1cb51a9": "Открыть боковой чат в этом чате", + "000646e27e304b8b": "Открыть боковой чат", "56567586cbe00c86": "Открыть передачу контекста в этом чате", - "7fe7d5ae5fb4a655": "Открыть субагента в этом чате", + "405e76cdd602bbcf": "Открыть субагента", "520c15dbd507b804": "Открыть родительского агента в этом чате", "309b160785f6c473": "Открыть ответвление в этом чате", "6676cd4b8299663f": "Открыть родительский тред в этом чате", @@ -9834,6 +9841,7 @@ "2407d5d61e7f7206": "Поле ввода с форматированием", "64b8fd2c284c3137": "Сочетание для отправки", "6163f91bddf474ae": "Поведение дополнительных сообщений", + "425021487583cf8a": "Открывать субагентов и боковые чаты в", "856812e7e1fc445e": "Вызовы инструментов в чате", "216ed20b6f40fa6f": "Объявления для экранного диктора", "0ce04933a7047deb": "Заголовок окна для экранного диктора", @@ -9891,6 +9899,12 @@ "1ea00f7b1a88ee2e": "Сбросить поведение дополнительных сообщений к значению по умолчанию", "845e7f34c156ffd4": "Очередь", "81a74689d0319316": "Корректировка", + "6dc57547546cbe96": "Субагенты и боковые чаты", + "ffbc33f6b6ddc689": "Где по щелчку открывается субагент, боковой чат или тред в привязанном окружении. {modifier}-щелчок или щелчок средней кнопкой открывает его в основном окне.", + "7b7062c4b277e235": "Где по щелчку открывается субагент, боковой чат или тред в привязанном окружении. {modifier}-щелчок или щелчок средней кнопкой открывает его в боковой панели.", + "1eba4b1f5ae00974": "Сбросить место открытия субагентов и боковых чатов к значению по умолчанию", + "f8062ccf65d4bb2a": "Боковая панель", + "a8072bdf7ae4a288": "Основное окно", "162108e16ed96771": "Экранный диктор", "18807e775248380c": "Скрывать команды, правки и поиски, которые выполняют агенты. «Скрывать успешные» оставляет ошибки. «Дзен» показывает только итоговые ответы. Запросы подтверждения, вопросы и ошибки показываются всегда.", "5848a9c1d77f45b2": "Сбросить вызовы инструментов в чате к значению по умолчанию", @@ -9974,6 +9988,8 @@ "b9ebecdb8db71466": "«Как в системе» использует формат времени браузера или ОС.", "62f8a7774dc1ffb7": "Очередь", "c711b55bc1500f08": "Корректировка", + "e79128045796685d": "Боковая панель", + "d81dc62319ba223e": "Основное окно", "54139af0114a2729": "Красный и зелёный (по умолчанию)", "8d4a851d370639e4": "Синий и оранжевый", "b1d7c1ea891b7db5": "Развёрнуты", @@ -11601,6 +11617,7 @@ "ade91c8927c48175": "поле ввода форматирование tiptap жирный курсив markdown стили wysiwyg", "34d74827c2a8b009": "enter return command ctrl многострочный промпт новая строка поле ввода", "9d1013084c46ecce": "очередь корректировка выполняющийся ход отправить поведение по умолчанию поле ввода", + "e5e7f5e1fb1f2e4c": "субагент боковой чат привязанный тред щелчок правая панель боковая панель основное окно command ctrl средняя кнопка", "5b8b854de7ee6f4d": "установленные cli версии новее доступно codex claude cursor grok fx kiro opencode", "64f12530d55d2ad1": "возобновить выполняющаяся активная прерванная работа перезапуск перезагрузка компьютер сбой обновление десктоп автоматически", "214a98497c4ed05d": "caffeinate сон не давать уснуть бодрствование питание ноутбук крышка блокировать", diff --git a/apps/web/src/i18n/translations/sv.json b/apps/web/src/i18n/translations/sv.json index a0f86175e48e3..809732730e8c4 100644 --- a/apps/web/src/i18n/translations/sv.json +++ b/apps/web/src/i18n/translations/sv.json @@ -2367,6 +2367,7 @@ "566810ac726b119a": "Stäng av ljudet för {title}", "f6d1af395ae7bfcb": "Namn på enhetsflik", "e7ba2fded155ecdd": "{title}, {state}", + "2906d1220b6a2872": "Öppna i huvudvyn", "69ba5155e6e2ef95": "Byt namn", "44c90f8f19346bfb": "Stäng andra", "e6cd4726a7513754": "Stäng till höger", @@ -2843,6 +2844,7 @@ "276c7fa42a15a542": "Uppdatera äldre servrar för att spara den här inställningen.", "52163ddccc1eb594": "Inställningen sparades i vissa miljöer", "fee07035b4a2a1c3": "Sparat på {environments}.", + "2a1ecf7863e204aa": "Öppna i sidopanelen", "8a7ee5752bb91550": "Kunde inte kopiera. Skriv {command} i stället.", "7dfdfa116c6a9d86": "Kunde inte starta felsökningen", "25fe0f5f3ef3bb02": "{description} Kör {command} i en terminal på den datorn i stället.", @@ -3617,11 +3619,10 @@ ". Agenten kan använda den länken som den är; ändra dess åtkomst under Inställningar → Miljöer." ], "000b0df227182d39": "En annan adress…", + "fd07b24350a7643f": "en länkad miljö", "6bb5b1b35b2796ae": "På {label} via {via} · Arbetar", "a73b7ab25d6e9bdf": "På {label} via {via}", "009e2ca841fdc1ef": "den här miljön", - "8cb2e5692c4f05ab": "Öppna den här tråden på {label} för att se den här visualiseringen.", - "745a0b899008618c": "Kunde inte läsa in tidigare omgångar. Försök igen.", "4ab24e2807a0d82f": "Ansluten till {label}", "b797c7beccf2dc46": "Den här enheten är parkopplad med den och kan använda dess trådar.", "d8c4a71a728fcf68": "Ansluter till {label}…", @@ -3629,8 +3630,11 @@ "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.", "1942567fd95da447": "{label} behöver en parkopplingskod", "0f62d432499e13f9": "Skapa en där och lägg till den på den här enheten som en miljö.", + "8cb2e5692c4f05ab": "Öppna den här tråden på {label} för att se den här visualiseringen.", + "745a0b899008618c": "Kunde inte läsa in tidigare omgångar. Försök igen.", "0014ce0aaf1bd68a": "Skrivskyddad", "10ca916def8211d4": "Ange kod", + "a446e3bda256c2b3": "Anslut för att interagera", "d0bda35aeec66684": [ "Läser från ", { @@ -3641,7 +3645,6 @@ "…" ], "c3e8cd9bf44e2f43": "Visar det som lästes tidigare.", - "a446e3bda256c2b3": "Anslut för att interagera", "eb6e0584cf4a2a1d": "Språk: {language}", "d76c606a3c519b78": "Inaktivera radbrytning", "2b683498cee8c8a7": "Bryt rader", @@ -3960,14 +3963,18 @@ "5e7157db126f1641": "Ärenden är inte tillgängliga", "42ade0e14ff6af94": "Uppdatera T3 Code-servern i den här miljön för att bläddra bland ärenden.", "993dcd04611f9571": "Spara säkert", + "6a116665c8d9ad75": "Stäng sidochatt", + "c868f340c06cddf0": "Stäng tråd", + "f0ef94e00bcc0a92": "Stäng subagent", "ccbe48efc8e30c52": "Ta bort sidochatten ”{title}”?", "3a859b690f41e899": "Det här rensar dess konversationshistorik permanent.", "980f2db81b9eb4b5": "Kunde inte ta bort sidochatten", "c1844a6d9443df20": "Lägger till den här sidochatten i huvudtrådens nästa meddelande.", "e42d6bd2de470521": "Ta bort sidochatt", - "6a116665c8d9ad75": "Stäng sidochatt", + "750af44c1cdd4667": "Öppna i huvudvyn", "a5e57fdfde50aade": "Lägg till i chatten", "492a438bf9dbd45d": "Den här sidochatten togs bort.", + "255a537ab23ddd2d": "Den här tråden är inte längre tillgänglig.", "7350aa3df15b9802": "Färdighet {label}", "9ff9f24d1568fbaf": "Ingen beskrivning finns för den här färdigheten.", "274e087f814611a7": "Visa instruktioner", @@ -4194,9 +4201,9 @@ "5e7eb0f2952de1b2": "Ersatt", "59bcb9db3f0f59ea": "Inaktiv", "94124ad2133e3aed": "Okänd", - "1a6f6154d1cb51a9": "Öppna sidochatten i den här chatten", + "000646e27e304b8b": "Öppna sidochatt", "56567586cbe00c86": "Öppna kontextöverföringen i den här chatten", - "7fe7d5ae5fb4a655": "Öppna subagenten i den här chatten", + "405e76cdd602bbcf": "Öppna subagent", "520c15dbd507b804": "Öppna den överordnade agenten i den här chatten", "309b160785f6c473": "Öppna forken i den här chatten", "6676cd4b8299663f": "Öppna den överordnade tråden i den här chatten", @@ -9840,6 +9847,7 @@ "2407d5d61e7f7206": "Inmatningsfält med formaterad text", "64b8fd2c284c3137": "Kortkommando för att skicka", "6163f91bddf474ae": "Beteende för uppföljningar", + "425021487583cf8a": "Öppna subagenter och sidochattar i", "856812e7e1fc445e": "Verktygsanrop i chatten", "216ed20b6f40fa6f": "Uppläsningar för skärmläsare", "0ce04933a7047deb": "Fönstertitel för skärmläsare", @@ -9897,6 +9905,12 @@ "1ea00f7b1a88ee2e": "Återställ beteende för uppföljningar till standard", "845e7f34c156ffd4": "Köa", "81a74689d0319316": "Styr om", + "6dc57547546cbe96": "Subagenter och sidochattar", + "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.", + "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.", + "1eba4b1f5ae00974": "Återställ var subagenter och sidochattar öppnas till standard", + "f8062ccf65d4bb2a": "Sidopanel", + "a8072bdf7ae4a288": "Huvudvy", "162108e16ed96771": "Skärmläsare", "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.", "5848a9c1d77f45b2": "Återställ verktygsanrop i chatten till standard", @@ -9980,6 +9994,8 @@ "b9ebecdb8db71466": "Systemstandard följer webbläsarens eller operativsystemets klockinställning.", "62f8a7774dc1ffb7": "Köa", "c711b55bc1500f08": "Styr om", + "e79128045796685d": "Sidopanel", + "d81dc62319ba223e": "Huvudvy", "54139af0114a2729": "Rött och grönt (standard)", "8d4a851d370639e4": "Blått och orange", "b1d7c1ea891b7db5": "Utfällda", @@ -11609,6 +11625,7 @@ "ade91c8927c48175": "inmatningsfält formaterad text tiptap fet kursiv markdown formaterad wysiwyg", "34d74827c2a8b009": "enter retur command ctrl flera rader prompt ny rad inmatningsfält", "9d1013084c46ecce": "kö styr om pågående omgång skicka standardbeteende inmatningsfält", + "e5e7f5e1fb1f2e4c": "subagent sidochatt länkad tråd klick högerpanel sidopanel huvudvy kommando ctrl mittenklick", "5b8b854de7ee6f4d": "installerade cli versioner nyare tillgänglig codex claude cursor grok fx kiro opencode", "64f12530d55d2ad1": "återuppta pågående aktiv avbrutet arbete omstart starta om dator krasch skrivbord uppdatering automatiskt", "214a98497c4ed05d": "caffeinate viloläge förhindra håll vaken ström laptop lock förhindra", diff --git a/apps/web/src/i18n/translations/zh.json b/apps/web/src/i18n/translations/zh.json index 312065925ba94..007cf2777b24b 100644 --- a/apps/web/src/i18n/translations/zh.json +++ b/apps/web/src/i18n/translations/zh.json @@ -2371,6 +2371,7 @@ "566810ac726b119a": "将 {title} 静音", "f6d1af395ae7bfcb": "设备标签名", "e7ba2fded155ecdd": "{title},{state}", + "2906d1220b6a2872": "在主视图中打开", "69ba5155e6e2ef95": "重命名", "44c90f8f19346bfb": "关闭其他标签", "e6cd4726a7513754": "关闭右侧标签", @@ -2847,6 +2848,7 @@ "276c7fa42a15a542": "请更新旧版服务器后再保存此设置。", "52163ddccc1eb594": "部分环境已保存设置", "fee07035b4a2a1c3": "已在 {environments} 上保存。", + "2a1ecf7863e204aa": "在侧边面板中打开", "8a7ee5752bb91550": "无法复制。请改为输入 {command}。", "7dfdfa116c6a9d86": "无法开始问题排查", "25fe0f5f3ef3bb02": "{description} 请改为在那台机器的终端中运行 {command}。", @@ -3622,11 +3624,10 @@ "。智能体可以直接使用该关联;请在“设置 → 环境”中更改其访问权限。" ], "000b0df227182d39": "其他地址…", + "fd07b24350a7643f": "关联环境", "6bb5b1b35b2796ae": "位于 {label},经由 {via} · 运行中", "a73b7ab25d6e9bdf": "位于 {label},经由 {via}", "009e2ca841fdc1ef": "此环境", - "8cb2e5692c4f05ab": "在 {label} 上打开此会话即可查看此可视内容。", - "745a0b899008618c": "无法加载更早的对话。请重试。", "4ab24e2807a0d82f": "已连接到 {label}", "b797c7beccf2dc46": "此设备已与其配对,可以使用其中的会话。", "d8c4a71a728fcf68": "正在连接 {label}…", @@ -3634,8 +3635,11 @@ "a5424a5a76e10aa3": "请加入它所在的网络(例如其 Tailscale 网络),然后重试。你仍可在此继续阅读。", "1942567fd95da447": "{label} 需要配对码", "0f62d432499e13f9": "在该机器上创建配对码,然后将其作为环境添加到此设备。", + "8cb2e5692c4f05ab": "在 {label} 上打开此会话即可查看此可视内容。", + "745a0b899008618c": "无法加载更早的对话。请重试。", "0014ce0aaf1bd68a": "只读", "10ca916def8211d4": "输入配对码", + "a446e3bda256c2b3": "连接以进行交互", "d0bda35aeec66684": [ "正在从 ", { @@ -3646,7 +3650,6 @@ " 读取…" ], "c3e8cd9bf44e2f43": "正在显示之前读取的内容。", - "a446e3bda256c2b3": "连接以进行交互", "eb6e0584cf4a2a1d": "语言:{language}", "d76c606a3c519b78": "取消自动换行", "2b683498cee8c8a7": "自动换行", @@ -3965,14 +3968,18 @@ "5e7157db126f1641": "issue 不可用", "42ade0e14ff6af94": "请更新此环境的 T3 Code 服务器以浏览 issue。", "993dcd04611f9571": "安全保存", + "6a116665c8d9ad75": "关闭侧聊", + "c868f340c06cddf0": "关闭会话", + "f0ef94e00bcc0a92": "关闭子智能体", "ccbe48efc8e30c52": "删除侧聊“{title}”?", "3a859b690f41e899": "这会永久清除它的对话记录。", "980f2db81b9eb4b5": "无法删除侧聊", "c1844a6d9443df20": "把这段侧聊附加到主会话的下一条消息中。", "e42d6bd2de470521": "删除侧聊", - "6a116665c8d9ad75": "关闭侧聊", + "750af44c1cdd4667": "在主视图中打开", "a5e57fdfde50aade": "添加到对话", "492a438bf9dbd45d": "这段侧聊已删除。", + "255a537ab23ddd2d": "这个会话已不可用。", "7350aa3df15b9802": "技能 {label}", "9ff9f24d1568fbaf": "这个技能没有描述。", "274e087f814611a7": "查看说明", @@ -4200,9 +4207,9 @@ "5e7eb0f2952de1b2": "已被替代", "59bcb9db3f0f59ea": "闲置", "94124ad2133e3aed": "未知", - "1a6f6154d1cb51a9": "在此对话中打开侧聊", + "000646e27e304b8b": "打开侧聊", "56567586cbe00c86": "在此对话中打开上下文转移", - "7fe7d5ae5fb4a655": "在此对话中打开子智能体", + "405e76cdd602bbcf": "打开子智能体", "520c15dbd507b804": "在此对话中打开父智能体", "309b160785f6c473": "在此对话中打开分叉", "6676cd4b8299663f": "在此对话中打开父会话", @@ -9847,6 +9854,7 @@ "2407d5d61e7f7206": "富文本输入框", "64b8fd2c284c3137": "发送快捷键", "6163f91bddf474ae": "追加消息行为", + "425021487583cf8a": "子智能体和侧聊的打开位置", "856812e7e1fc445e": "聊天中的工具调用", "216ed20b6f40fa6f": "屏幕阅读器播报", "0ce04933a7047deb": "屏幕阅读器窗口标题", @@ -9904,6 +9912,12 @@ "1ea00f7b1a88ee2e": "重置后续消息行为为默认值", "845e7f34c156ffd4": "加入队列", "81a74689d0319316": "引导当前执行", + "6dc57547546cbe96": "子智能体和侧聊", + "ffbc33f6b6ddc689": "单击时子智能体、侧聊或关联环境中的会话在哪里打开。按住 {modifier} 单击或中键单击会改为在主视图中打开。", + "7b7062c4b277e235": "单击时子智能体、侧聊或关联环境中的会话在哪里打开。按住 {modifier} 单击或中键单击会改为在侧边面板中打开。", + "1eba4b1f5ae00974": "将子智能体和侧聊的打开位置重置为默认值", + "f8062ccf65d4bb2a": "侧边面板", + "a8072bdf7ae4a288": "主视图", "162108e16ed96771": "屏幕阅读器", "18807e775248380c": "隐藏智能体执行的命令、编辑和搜索。“隐藏成功的调用”仍保留失败项;“专注模式”仅显示最终回答。审批、提问和错误始终显示。", "5848a9c1d77f45b2": "重置聊天中的工具调用为默认值", @@ -9987,6 +10001,8 @@ "b9ebecdb8db71466": "系统默认使用浏览器或操作系统的时钟偏好。", "62f8a7774dc1ffb7": "加入队列", "c711b55bc1500f08": "引导当前执行", + "e79128045796685d": "侧边面板", + "d81dc62319ba223e": "主视图", "54139af0114a2729": "红色与绿色(默认)", "8d4a851d370639e4": "蓝色与橙色", "b1d7c1ea891b7db5": "展开", @@ -11625,6 +11641,7 @@ "ade91c8927c48175": "输入框 富文本 tiptap 粗体 斜体 markdown 样式 所见即所得", "34d74827c2a8b009": "enter 回车 command ctrl 多行 提示词 换行 输入框", "9d1013084c46ecce": "排队 引导 运行中 轮次 发送 默认行为 输入框", + "e5e7f5e1fb1f2e4c": "子智能体 侧聊 关联会话 单击 右侧面板 侧边面板 主视图 command ctrl 中键单击", "5b8b854de7ee6f4d": "已安装 cli 版本 更新 可用 codex claude cursor grok fx kiro opencode", "64f12530d55d2ad1": "恢复 运行中 活跃 中断 工作 重启 重新启动 机器 崩溃 桌面 更新 自动", "214a98497c4ed05d": "caffeinate 睡眠 阻止 保持唤醒 电源 笔记本 盖子 抑制", diff --git a/apps/web/src/lib/assistantCitationNavigation.test.ts b/apps/web/src/lib/assistantCitationNavigation.test.ts index 0f1816c2db85a..bcbc5c338df2d 100644 --- a/apps/web/src/lib/assistantCitationNavigation.test.ts +++ b/apps/web/src/lib/assistantCitationNavigation.test.ts @@ -175,5 +175,5 @@ function expectSideChatRevealedOnParent(router: ReturnType { expect(route).toEqual(mainRef); expect( selectActiveRightPanelSurface(useRightPanelStore.getState().byThreadKey, mainRef)?.id, - ).toBe("side-chat:side-chat"); + ).toBe("thread:side-chat"); expect( resolveThreadOpenRoute(mainRef, { lineage: { sideChat: false, parentThreadId: null } as never, }), ).toBe(mainRef); }); + +it("opens a side thread beside the thread the click was in, or in its place", () => { + useRightPanelStore.setState(useRightPanelStore.getInitialState()); + const navigated: unknown[] = []; + const open = ( + input: Pick[0], "threadRef" | "panelRef" | "intent">, + ) => openSideThread({ ...input, navigate: (ref) => void navigated.push(ref) }); + const surfaces = () => + selectThreadRightPanelState(useRightPanelStore.getState().byThreadKey, mainRef).surfaces; + + expect(open({ threadRef: sideChatRef, panelRef: mainRef, intent: "primary" })).toBe("panel"); + expect(surfaces().map((surface) => surface.id)).toEqual(["thread:side-chat"]); + expect(navigated).toEqual([]); + + expect(open({ threadRef: sideChatRef, panelRef: mainRef, intent: "alternate" })).toBe("main"); + expect(navigated).toEqual([sideChatRef]); + + // No panel shows a thread beside itself, of another environment, or where there is none. + const elsewhere = scopeThreadRef(EnvironmentId.make("environment:other"), sideChatRef.threadId); + expect(open({ threadRef: mainRef, panelRef: mainRef, intent: "panel" })).toBe("main"); + expect(open({ threadRef: elsewhere, panelRef: mainRef, intent: "panel" })).toBe("main"); + expect(open({ threadRef: sideChatRef, panelRef: null, intent: "panel" })).toBe("main"); + expect(navigated).toEqual([sideChatRef, mainRef, elsewhere, sideChatRef]); + expect(surfaces()).toHaveLength(1); +}); diff --git a/apps/web/src/lib/sideChatPane.ts b/apps/web/src/lib/sideChatPane.ts index e18b5f5ad129c..72343a41ca020 100644 --- a/apps/web/src/lib/sideChatPane.ts +++ b/apps/web/src/lib/sideChatPane.ts @@ -1,8 +1,21 @@ import { scopeThreadRef } from "@t3tools/client-runtime/environment"; -import type { OrchestrationV2ThreadShell, ScopedThreadRef } from "@t3tools/contracts"; +import { + resolveSideThreadOpenTarget, + type SideThreadOpenIntent, +} from "@t3tools/client-runtime/side-thread"; +import type { + OrchestrationV2ThreadShell, + ScopedThreadRef, + SideThreadOpenTarget, +} from "@t3tools/contracts"; import type { ToolCallDiffTarget } from "../diffPanelStore"; -import { useRightPanelStore } from "../rightPanelStore"; +import type { LinkedThreadTarget } from "@t3tools/client-runtime/linked-thread"; +import type { useNavigate } from "@tanstack/react-router"; + +import { getClientSettings } from "../hooks/useSettings"; +import { linkedThreadRouteParams } from "../linkedThreadSurface"; +import { rightPanelHostRef, useRightPanelStore } from "../rightPanelStore"; /** Whether an event started in the side chat pane (`data-side-chat-pane`), which the main chat ignores. */ export function isInSideChatPane(target: EventTarget | null): boolean { @@ -10,11 +23,13 @@ export function isInSideChatPane(target: EventTarget | null): boolean { } /** - * Opens an embedded side chat's tool diffs in its parent's diff panel and runs its shell commands + * Opens an embedded side thread's tool diffs in its parent's diff panel and runs its shell commands * in the parent's terminal drawer, since the embedded view hides its own. Other panel actions reach * the parent through `hostRightPanel`; diff selection and the drawer are not panel state. */ export interface SideChatParentPanel { + /** The thread whose panel shows the embedded one. */ + readonly hostRef: ScopedThreadRef; readonly openToolDiff: (target: ToolCallDiffTarget) => void; readonly runShellCommand: (command: string) => void; } @@ -30,6 +45,69 @@ export function resolveThreadOpenRoute( const parentThreadId = thread?.lineage.sideChat === true ? thread.lineage.parentThreadId : null; if (parentThreadId === null) return threadRef; const parentRef = scopeThreadRef(threadRef.environmentId, parentThreadId); - useRightPanelStore.getState().openSideChat(parentRef, threadRef.threadId); + useRightPanelStore.getState().openThread(parentRef, threadRef.threadId); return parentRef; } + +/** + * Whether `panelRef`'s right panel can show `threadRef` as a tab: a thread of the same environment + * that is not the one the panel belongs to. + */ +function canOpenThreadInPanel( + threadRef: ScopedThreadRef, + panelRef: ScopedThreadRef | null, +): panelRef is ScopedThreadRef { + if (panelRef === null) return false; + const host = rightPanelHostRef(panelRef); + return host.environmentId === threadRef.environmentId && host.threadId !== threadRef.threadId; +} + +/** + * Opens a side chat or subagent where the click asked: as a tab beside `panelRef`, the thread the + * click happened in, or on the main screen through `navigate`. Returns where it went. + */ +export function openSideThread(input: { + readonly threadRef: ScopedThreadRef; + readonly panelRef: ScopedThreadRef | null; + readonly intent: SideThreadOpenIntent; + readonly navigate: (threadRef: ScopedThreadRef) => void; +}): SideThreadOpenTarget { + const { threadRef, panelRef } = input; + const target = resolveSideThreadOpenTarget({ + preference: getClientSettings().sideThreadOpenTarget, + intent: input.intent, + panelAvailable: canOpenThreadInPanel(threadRef, panelRef), + }); + if (target === "panel" && panelRef !== null) { + useRightPanelStore.getState().openThread(panelRef, threadRef.threadId); + } else { + input.navigate(threadRef); + } + return target; +} + +/** + * Opens the read-only view of a linked environment's thread where the click asked: as a tab in + * `panelRef`'s right panel, or on the main screen, which is also where it goes without a panel. + */ +export function openLinkedThreadRead(input: { + readonly panelRef: ScopedThreadRef | null; + readonly target: LinkedThreadTarget; + readonly intent: SideThreadOpenIntent; + readonly navigate: ReturnType; +}) { + const { panelRef, target } = input; + const place = resolveSideThreadOpenTarget({ + preference: getClientSettings().sideThreadOpenTarget, + intent: input.intent, + panelAvailable: panelRef !== null, + }); + if (place === "panel" && panelRef !== null) { + useRightPanelStore.getState().openLinkedThread(panelRef, target); + return; + } + void input.navigate({ + to: "/linked/$viaEnvironmentId/$environmentId/$threadId", + params: linkedThreadRouteParams(target), + }); +} diff --git a/apps/web/src/linkedThreadSurface.ts b/apps/web/src/linkedThreadSurface.ts index 344efffe8d472..5736e2ab38006 100644 --- a/apps/web/src/linkedThreadSurface.ts +++ b/apps/web/src/linkedThreadSurface.ts @@ -53,3 +53,14 @@ export function linkedThreadTitle( ): string { return surface.title?.trim() || fallback; } + +/** The main-screen route of a linked environment's thread, read through `viaEnvironmentId`. */ +export function linkedThreadRouteParams( + target: Pick, +) { + return { + viaEnvironmentId: target.viaEnvironmentId, + environmentId: target.environmentId, + threadId: target.threadId, + }; +} diff --git a/apps/web/src/reopenClosedView.ts b/apps/web/src/reopenClosedView.ts index f226b5f1efd1e..cff3810a7b348 100644 --- a/apps/web/src/reopenClosedView.ts +++ b/apps/web/src/reopenClosedView.ts @@ -161,8 +161,8 @@ export async function reopenClosedView( case "issue": panels.openIssue(ref, surface); break; - case "side-chat": - panels.openSideChat(ref, surface.threadId); + case "thread": + panels.openThread(ref, surface.threadId); break; case "linked-thread": panels.openLinkedThread(ref, surface); diff --git a/apps/web/src/rightPanelStore.test.ts b/apps/web/src/rightPanelStore.test.ts index 39ac8336ce38c..32dd581430cb2 100644 --- a/apps/web/src/rightPanelStore.test.ts +++ b/apps/web/src/rightPanelStore.test.ts @@ -595,6 +595,44 @@ describe("rightPanelStore", () => { }); }); + it("opens a side chat or subagent once per thread, and never the panel's own thread", () => { + const store = useRightPanelStore.getState(); + const child = ThreadId.make("child"); + store.openThread(refA, child); + store.open(refA, "diff"); + store.openThread(refA, child); + store.openThread(refA, refA.threadId); + const panel = selectThreadRightPanelState(useRightPanelStore.getState().byThreadKey, refA); + expect(panel.surfaces.map((surface) => surface.id)).toEqual(["thread:child", "diff"]); + expect(panel.activeSurfaceId).toBe("thread:child"); + }); + + it("keeps side chat tabs saved before they became thread surfaces", () => { + const migrated = migratePersistedRightPanelState({ + byThreadKey: { + "env-1:thread-A": { + isOpen: true, + activeSurfaceId: "side-chat:side", + surfaces: [ + { id: "diff", kind: "diff" }, + { id: "side-chat:side", kind: "side-chat", threadId: "side" }, + { id: "side-chat:gone", kind: "side-chat" }, + { id: "thread:stale", kind: "thread", threadId: "sub" }, + ], + }, + }, + }); + expect(selectThreadRightPanelState(migrated.byThreadKey, refA)).toEqual({ + isOpen: true, + activeSurfaceId: "thread:side", + surfaces: [ + { id: "diff", kind: "diff" }, + { id: "thread:side", kind: "thread", threadId: "side" }, + { id: "thread:sub", kind: "thread", threadId: "sub" }, + ], + }); + }); + it("drops the legacy singleton terminal surface during migration", () => { expect( migratePersistedRightPanelState({ diff --git a/apps/web/src/rightPanelStore.ts b/apps/web/src/rightPanelStore.ts index 6b932ed4a46cf..350820eec07b4 100644 --- a/apps/web/src/rightPanelStore.ts +++ b/apps/web/src/rightPanelStore.ts @@ -30,7 +30,7 @@ const RIGHT_PANEL_KINDS = [ "pull-request", "pull-requests", "issue", - "side-chat", + "thread", "linked-thread", ] as const; export type RightPanelKind = (typeof RIGHT_PANEL_KINDS)[number]; @@ -103,10 +103,32 @@ export type RightPanelSurface = key: string; url?: string; } - | { id: `side-chat:${string}`; kind: "side-chat"; threadId: ThreadId } + /** + * A thread of the panel's environment shown beside it: a side chat or a subagent. Which one is + * the thread's own lineage, so the surface only names it. + */ + | ThreadSurface /** A linked environment's thread, read through `viaEnvironmentId`; it has no thread here. */ | LinkedThreadSurface; +export type ThreadSurface = { id: `thread:${string}`; kind: "thread"; threadId: ThreadId }; + +const threadSurface = (threadId: ThreadId): ThreadSurface => ({ + id: `thread:${threadId}`, + kind: "thread", + threadId, +}); + +/** + * A saved thread surface with its id rebuilt, or null when it names no thread. Builds before + * subagents opened here saved it as `side-chat`. + */ +export function decodeThreadSurface(surface: object): ThreadSurface | null { + const { kind, threadId } = surface as Record; + if ((kind !== "thread" && kind !== "side-chat") || typeof threadId !== "string") return null; + return threadId === "" ? null : threadSurface(ThreadId.make(threadId)); +} + const RIGHT_PANEL_STORAGE_KEY = "t3code:right-panel-state:v2"; const RIGHT_PANEL_STORAGE_VERSION = 15; @@ -165,10 +187,11 @@ interface RightPanelStoreState { ref: ScopedThreadRef, kind: Exclude< RightPanelKind, - "file" | "terminal" | "pull-request" | "issue" | "side-chat" | "linked-thread" + "file" | "terminal" | "pull-request" | "issue" | "thread" | "linked-thread" >, ) => void; - openSideChat: (ref: ScopedThreadRef, threadId: ThreadId) => void; + /** Opens a side chat or subagent of `ref`'s environment as a tab; `ref` itself has no tab. */ + openThread: (ref: ScopedThreadRef, threadId: ThreadId) => void; openLinkedThread: (ref: ScopedThreadRef, target: LinkedThreadTarget) => void; /** Records the title the linked environment gave, so the tab and a reopened one show it. */ setLinkedThreadTitle: (ref: ScopedThreadRef, surfaceId: string, title: string) => void; @@ -238,7 +261,7 @@ interface RightPanelStoreState { ref: ScopedThreadRef, kind: Exclude< RightPanelKind, - "file" | "terminal" | "pull-request" | "issue" | "side-chat" | "linked-thread" + "file" | "terminal" | "pull-request" | "issue" | "thread" | "linked-thread" >, ) => void; setThreadPanelOpen: ( @@ -264,7 +287,7 @@ const DEFAULT_THREAD_PANEL_VISIBILITY: ThreadPanelVisibility = { const singletonSurface = ( kind: Exclude< RightPanelKind, - "file" | "preview" | "terminal" | "pull-request" | "issue" | "side-chat" | "linked-thread" + "file" | "preview" | "terminal" | "pull-request" | "issue" | "thread" | "linked-thread" >, ): RightPanelSurface => { switch (kind) { @@ -587,6 +610,10 @@ export function migratePersistedRightPanelState(persistedState: unknown): { ? validThreadState.surfaces.flatMap((surface) => { if (!surface || typeof surface !== "object") return []; const kind = (surface as { kind?: string }).kind; + if (kind === "thread" || kind === "side-chat") { + const decoded = decodeThreadSurface(surface); + return decoded === null ? [] : [decoded]; + } // Also drops kinds this build does not know, such as one a newer build saved. if (!(RIGHT_PANEL_KINDS as ReadonlyArray).includes(kind)) return []; if (surface.kind === "linked-thread") { @@ -684,7 +711,12 @@ export function migratePersistedRightPanelState(persistedState: unknown): { ]; }) : []; - const rawActiveSurfaceId = validThreadState?.activeSurfaceId; + const savedActiveSurfaceId = validThreadState?.activeSurfaceId; + const rawActiveSurfaceId = + typeof savedActiveSurfaceId === "string" && + savedActiveSurfaceId.startsWith("side-chat:") + ? `thread:${savedActiveSurfaceId.slice("side-chat:".length)}` + : savedActiveSurfaceId; const persistedActiveSurfaceId = surfaces.some( (surface) => surface.id === rawActiveSurfaceId, ) @@ -840,11 +872,13 @@ export const useRightPanelStore = create()( ); }), ), - openSideChat: (ref, threadId) => + openThread: (ref, threadId) => set((state) => - userAction(state, scopedThreadKey(ref), (current) => - upsertSurface(current, { id: `side-chat:${threadId}`, kind: "side-chat", threadId }), - ), + rightPanelHostRef(ref).threadId === threadId + ? state + : userAction(state, scopedThreadKey(ref), (current) => + upsertSurface(current, threadSurface(threadId)), + ), ), openLinkedThread: (ref, target) => set((state) => diff --git a/apps/web/src/routeTree.gen.ts b/apps/web/src/routeTree.gen.ts index 0392f92459406..f5d7e53fb4f74 100644 --- a/apps/web/src/routeTree.gen.ts +++ b/apps/web/src/routeTree.gen.ts @@ -53,6 +53,7 @@ import { Route as ChatSettingsAccessRouteImport } from './routes/_chat.settings. import { Route as ChatSettingsAboutRouteImport } from './routes/_chat.settings.about' import { Route as ChatDraftDraftIdRouteImport } from './routes/_chat.draft.$draftId' import { Route as ChatEnvironmentIdThreadIdRouteImport } from './routes/_chat.$environmentId.$threadId' +import { Route as ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRouteImport } from './routes/_chat.linked.$viaEnvironmentId.$environmentId.$threadId' const WelcomeRoute = WelcomeRouteImport.update({ id: '/welcome', @@ -279,6 +280,12 @@ const ChatEnvironmentIdThreadIdRoute = path: '/$environmentId/$threadId', getParentRoute: () => ChatRoute, } as any) +const ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRoute = + ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRouteImport.update({ + id: '/linked/$viaEnvironmentId/$environmentId/$threadId', + path: '/linked/$viaEnvironmentId/$environmentId/$threadId', + getParentRoute: () => ChatRoute, + } as any) export interface FileRoutesByFullPath { '/': typeof ChatIndexRoute @@ -324,6 +331,7 @@ export interface FileRoutesByFullPath { '/settings/voice': typeof ChatSettingsVoiceRoute '/settings/worktrees': typeof ChatSettingsWorktreesRoute '/threads/$environmentId/$threadId': typeof ThreadsEnvironmentIdThreadIdRoute + '/linked/$viaEnvironmentId/$environmentId/$threadId': typeof ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRoute } export interface FileRoutesByTo { '/approve-agent': typeof ApproveAgentRoute @@ -369,6 +377,7 @@ export interface FileRoutesByTo { '/settings/voice': typeof ChatSettingsVoiceRoute '/settings/worktrees': typeof ChatSettingsWorktreesRoute '/threads/$environmentId/$threadId': typeof ThreadsEnvironmentIdThreadIdRoute + '/linked/$viaEnvironmentId/$environmentId/$threadId': typeof ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRoute } export interface FileRoutesById { __root__: typeof rootRouteImport @@ -416,6 +425,7 @@ export interface FileRoutesById { '/_chat/settings/voice': typeof ChatSettingsVoiceRoute '/_chat/settings/worktrees': typeof ChatSettingsWorktreesRoute '/threads/$environmentId/$threadId': typeof ThreadsEnvironmentIdThreadIdRoute + '/_chat/linked/$viaEnvironmentId/$environmentId/$threadId': typeof ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRoute } export interface FileRouteTypes { fileRoutesByFullPath: FileRoutesByFullPath @@ -463,6 +473,7 @@ export interface FileRouteTypes { | '/settings/voice' | '/settings/worktrees' | '/threads/$environmentId/$threadId' + | '/linked/$viaEnvironmentId/$environmentId/$threadId' fileRoutesByTo: FileRoutesByTo to: | '/approve-agent' @@ -508,6 +519,7 @@ export interface FileRouteTypes { | '/settings/voice' | '/settings/worktrees' | '/threads/$environmentId/$threadId' + | '/linked/$viaEnvironmentId/$environmentId/$threadId' id: | '__root__' | '/_chat' @@ -554,6 +566,7 @@ export interface FileRouteTypes { | '/_chat/settings/voice' | '/_chat/settings/worktrees' | '/threads/$environmentId/$threadId' + | '/_chat/linked/$viaEnvironmentId/$environmentId/$threadId' fileRoutesById: FileRoutesById } export interface RootRouteChildren { @@ -878,6 +891,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof ChatEnvironmentIdThreadIdRouteImport parentRoute: typeof ChatRoute } + '/_chat/linked/$viaEnvironmentId/$environmentId/$threadId': { + id: '/_chat/linked/$viaEnvironmentId/$environmentId/$threadId' + path: '/linked/$viaEnvironmentId/$environmentId/$threadId' + fullPath: '/linked/$viaEnvironmentId/$environmentId/$threadId' + preLoaderRoute: typeof ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRouteImport + parentRoute: typeof ChatRoute + } } } @@ -954,6 +974,7 @@ interface ChatRouteChildren { ChatIndexRoute: typeof ChatIndexRoute ChatEnvironmentIdThreadIdRoute: typeof ChatEnvironmentIdThreadIdRoute ChatDraftDraftIdRoute: typeof ChatDraftDraftIdRoute + ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRoute: typeof ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRoute } const ChatRouteChildren: ChatRouteChildren = { @@ -965,6 +986,8 @@ const ChatRouteChildren: ChatRouteChildren = { ChatIndexRoute: ChatIndexRoute, ChatEnvironmentIdThreadIdRoute: ChatEnvironmentIdThreadIdRoute, ChatDraftDraftIdRoute: ChatDraftDraftIdRoute, + ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRoute: + ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRoute, } const ChatRouteWithChildren = ChatRoute._addFileChildren(ChatRouteChildren) diff --git a/apps/web/src/routes/_chat.linked.$viaEnvironmentId.$environmentId.$threadId.tsx b/apps/web/src/routes/_chat.linked.$viaEnvironmentId.$environmentId.$threadId.tsx new file mode 100644 index 0000000000000..f7a6cc0dc8a8f --- /dev/null +++ b/apps/web/src/routes/_chat.linked.$viaEnvironmentId.$environmentId.$threadId.tsx @@ -0,0 +1,18 @@ +import { EnvironmentId, ThreadId } from "@t3tools/contracts"; +import { createFileRoute } from "@tanstack/react-router"; + +import { LinkedThreadPage } from "../components/chat/LinkedThreadPage"; + +// A thread on a linked environment this client is not connected to, read through `viaEnvironmentId`. +export const Route = createFileRoute("/_chat/linked/$viaEnvironmentId/$environmentId/$threadId")({ + component: function LinkedThreadRoute() { + const params = Route.useParams(); + return ( + + ); + }, +}); diff --git a/apps/web/src/state/linkedThreadView.ts b/apps/web/src/state/linkedThreadView.ts index 7dfc41a9f617f..af05128c4ae33 100644 --- a/apps/web/src/state/linkedThreadView.ts +++ b/apps/web/src/state/linkedThreadView.ts @@ -1,5 +1,6 @@ import { useAtom, useAtomSet, useAtomValue } from "@effect/atom-react"; import { scopedThreadKey, scopeThreadRef } from "@t3tools/client-runtime/environment"; +import type { SideThreadOpenIntent } from "@t3tools/client-runtime/side-thread"; import { connectLinkedEnvironment, type LinkedThreadOpen, @@ -12,6 +13,7 @@ import { AsyncResult, Atom } from "effect/reactivity"; import type { TurnItemSource } from "../components/chat/timelineRowContext"; import { useRightPanelStore } from "../rightPanelStore"; import { connectPairing, reachesEnvironment } from "../connection/onboarding"; +import { openLinkedThreadRead } from "../lib/sideChatPane"; import type { LinkedThreadSurface } from "../linkedThreadSurface"; import { buildThreadRouteParams } from "../threadRoutes"; import { useEnvironment } from "./environments"; @@ -20,10 +22,9 @@ import { useEnvironmentQuery } from "./query"; import { useAtomCommand } from "./use-atom-command"; /** - * How a click opens a thread that the thread `panelRef` says is on a linked environment: in place - * when this client is connected there itself, else as a read-only tab in that thread's right - * panel, read through its environment. Once the link is gone a saved environment opens in place, - * where the client can reconnect to it; with neither, the tab says what to link again. + * How a click opens a thread `panelRef` says is on a linked environment: in place when this client + * is connected there, else read-only through `panelRef`'s environment, in its right panel or on + * the main screen as the click asks. A saved environment whose link is gone opens in place. */ export function useLinkedThreadOpener( panelRef: ScopedThreadRef, @@ -35,7 +36,10 @@ export function useLinkedThreadOpener( } | undefined, title: string | null, -): { readonly mode: Exclude; readonly open: () => void } | null { +): { + readonly mode: Exclude; + readonly open: (intent: SideThreadOpenIntent) => void; +} | null { const navigate = useNavigate(); const viaEnvironmentId = panelRef.environmentId; const own = useEnvironment(thread?.environmentId ?? null); @@ -51,14 +55,19 @@ export function useLinkedThreadOpener( const mode = resolved === "direct" ? "direct" : "linked"; return { mode, - open: () => { + open: (intent) => { if (mode === "linked") { - useRightPanelStore.getState().openLinkedThread(panelRef, { - viaEnvironmentId, - environmentId: thread.environmentId, - threadId: thread.threadId, - label: own?.label ?? thread.label, - title, + openLinkedThreadRead({ + panelRef, + target: { + viaEnvironmentId, + environmentId: thread.environmentId, + threadId: thread.threadId, + label: own?.label ?? thread.label, + title, + }, + intent, + navigate, }); return; } @@ -71,8 +80,9 @@ export function useLinkedThreadOpener( } type TabKey = readonly [ - panelEnvironmentId: EnvironmentId, - panelThreadId: ThreadId, + /** Null on the main screen, where no tab shows the title. */ + panelEnvironmentId: EnvironmentId | null, + panelThreadId: ThreadId | null, surfaceId: string, viaEnvironmentId: EnvironmentId, environmentId: EnvironmentId, @@ -90,30 +100,36 @@ const targetOf = ( const tabViewAtom = Atom.family((key: string) => { const [panelEnvironmentId, panelThreadId, surfaceId, viaEnvironmentId, environmentId, threadId] = JSON.parse(key) as TabKey; - const panelRef = scopeThreadRef(panelEnvironmentId, panelThreadId); + const panelRef = + panelEnvironmentId === null || panelThreadId === null + ? null + : scopeThreadRef(panelEnvironmentId, panelThreadId); const view = peerLinkEnvironment.threadView( targetOf({ viaEnvironmentId, environmentId, threadId }), ); return Atom.make((get) => { const live = get(view); const title = AsyncResult.getOrElse(live, () => null)?.thread.projection?.thread.title; - if (title) useRightPanelStore.getState().setLinkedThreadTitle(panelRef, surfaceId, title); + if (title && panelRef !== null) { + useRightPanelStore.getState().setLinkedThreadTitle(panelRef, surfaceId, title); + } return live; }).pipe(Atom.setIdleTTL(0), Atom.withLabel(`linked-thread-tab-view:${key}`)); }); /** - * The thread of `surface`, streamed through the environment that links to it for the tab in - * `panelRef`'s panel. The stream runs only while `visible`; what it last showed stays. + * The thread of `surface`, streamed through the environment that links to it, for the tab in + * `panelRef`'s panel or, with null, the main screen. The stream runs only while `visible`; what + * it last showed stays. */ export function useLinkedThreadView( - panelRef: ScopedThreadRef, + panelRef: ScopedThreadRef | null, surface: Pick, visible: boolean, ) { const key: TabKey = [ - panelRef.environmentId, - panelRef.threadId, + panelRef?.environmentId ?? null, + panelRef?.threadId ?? null, surface.id, surface.viaEnvironmentId, surface.environmentId, @@ -157,11 +173,12 @@ const linkedEnvironmentConnectAtom = Atom.family((key: string) => /** * Connects this client to the environment `surface`'s thread lives in. One step when the linking - * environment can get a pairing for this client: the thread then opens there and the tab closes. - * Otherwise the add-environment dialog opens for that machine. + * environment can get a pairing for this client: the thread then opens there, in place of the + * read-only view. Otherwise the add-environment dialog opens for that machine. `panelRef` is the + * thread whose panel shows the read, or null on the main screen. */ export function useConnectLinkedEnvironment( - panelRef: ScopedThreadRef, + panelRef: ScopedThreadRef | null, surface: LinkedThreadSurface, ) { const navigate = useNavigate(); @@ -174,7 +191,9 @@ export function useConnectLinkedEnvironment( const reaches = useAtomCommand(reachesEnvironment, quiet); const pair = useAtomCommand(connectPairing, quiet); const [state, setState] = useAtom( - linkedEnvironmentConnectAtom(`${scopedThreadKey(panelRef)}:${surface.id}`), + linkedEnvironmentConnectAtom( + `${panelRef === null ? "main" : scopedThreadKey(panelRef)}:${surface.id}`, + ), ); const addWithCode = (prefill: AddEnvironmentPrefill) => { setPrefill(prefill); @@ -213,10 +232,12 @@ export function useConnectLinkedEnvironment( if (outcome.type === "connected") { setState({ phase: "idle" }); // The thread opens where every thread on a connected environment does, so its tab is done. - useRightPanelStore.getState().closeSurface(panelRef, surface.id); + if (panelRef !== null) useRightPanelStore.getState().closeSurface(panelRef, surface.id); void navigate({ to: "/$environmentId/$threadId", params: buildThreadRouteParams(scopeThreadRef(surface.environmentId, surface.threadId)), + // The read-only page has nothing left to go back to. + replace: panelRef === null, }); return outcome; } diff --git a/apps/web/test/appScenarios.renders.tsx b/apps/web/test/appScenarios.renders.tsx index 8a784eea73d11..b27b3ae8994f1 100644 --- a/apps/web/test/appScenarios.renders.tsx +++ b/apps/web/test/appScenarios.renders.tsx @@ -443,7 +443,7 @@ it("app-switch-settings-section", async () => { // Keep git scenarios last: the status they leave cached adds renders to later scenarios. it("app-git-file-counts-with-side-chat", async () => { using _clock = frozenClock(); - useRightPanelStore.getState().openSideChat(scopeThreadRef(ENVIRONMENT_ID, WARM), SIDE_CHAT.id); + useRightPanelStore.getState().openThread(scopeThreadRef(ENVIRONMENT_ID, WARM), SIDE_CHAT.id); await using _app = (await openThread(WARM)).screen; await expect.element(lastAnswer(SIDE_CHAT.id)).toBeVisible(); const gitStatus = vcsEnvironment.status({ @@ -485,7 +485,7 @@ it("app-git-file-counts-with-side-chat", async () => { // ChatView re-renders when the tree goes dirty or clean; the composer and side chat timeline should not. it("app-git-status-updates-with-side-chat", async () => { using _clock = frozenClock(); - useRightPanelStore.getState().openSideChat(scopeThreadRef(ENVIRONMENT_ID, WARM), SIDE_CHAT.id); + useRightPanelStore.getState().openThread(scopeThreadRef(ENVIRONMENT_ID, WARM), SIDE_CHAT.id); await using _app = (await openThread(WARM)).screen; await expect.element(lastAnswer(SIDE_CHAT.id)).toBeVisible(); const local = (insertions: number) => ({ diff --git a/apps/web/test/fakeEnvironment.ts b/apps/web/test/fakeEnvironment.ts index 7fd89bf48a9f5..5a15cdeb8eef7 100644 --- a/apps/web/test/fakeEnvironment.ts +++ b/apps/web/test/fakeEnvironment.ts @@ -227,6 +227,8 @@ function run( export interface FakeThread { /** Makes this a side chat of that thread. */ readonly sideChatOf?: ThreadId; + /** Makes this a subagent the provider started under that thread, which takes no messages. */ + readonly providerSubagentOf?: ThreadId; /** Makes this an older settled thread the shell leaves out; only its family read returns it. */ readonly olderSettled?: true; readonly id: ThreadId; @@ -309,6 +311,8 @@ export function threadWithQuestion(name: string, question: string): FakeThread { }; } +const parentOf = (thread: FakeThread) => thread.sideChatOf ?? thread.providerSubagentOf; + function shellOf(thread: FakeThread): OrchestrationV2ThreadShell { const latest = thread.runs.at(-1); const modelSelection = thread.modelSelection ?? MODEL; @@ -325,14 +329,14 @@ function shellOf(thread: FakeThread): OrchestrationV2ThreadShell { activeProviderThreadId: thread.providerThreads?.[0]?.id ?? null, ...(thread.issues === undefined ? {} : { issues: thread.issues }), lineage: { - rootThreadId: thread.sideChatOf ?? thread.id, - parentThreadId: thread.sideChatOf ?? null, - relationshipToParent: null, + rootThreadId: parentOf(thread) ?? thread.id, + parentThreadId: parentOf(thread) ?? null, + relationshipToParent: thread.providerSubagentOf ? "subagent" : null, ...(thread.sideChatOf ? { sideChat: true } : {}), }, forkedFrom: null, - createdBy: "user", - creationSource: "web", + createdBy: thread.providerSubagentOf ? "agent" : "user", + creationSource: thread.providerSubagentOf ? "provider" : "web", latestRunId: latest?.id ?? null, activeRunId: null, // Idle reads as waiting on the user, which shows a per-second duration in the sidebar. @@ -525,7 +529,7 @@ const handlers: Record unknown> = { ); }, [ORCHESTRATION_V2_WS_METHODS.getThreadFamily]: (input: { readonly threadId: ThreadId }) => { - const rootOf = (thread: FakeThread) => thread.sideChatOf ?? thread.id; + const rootOf = (thread: FakeThread) => parentOf(thread) ?? thread.id; const requested = threads.find((candidate) => candidate.id === input.threadId); return Effect.succeed({ snapshotSequence: sequence, diff --git a/docs/user/remote-access.md b/docs/user/remote-access.md index a3efb1de076d1..9240cfe873942 100644 --- a/docs/user/remote-access.md +++ b/docs/user/remote-access.md @@ -483,8 +483,10 @@ You can read a thread on a linked machine without connecting this app to it. Ope a task that was delegated there from the thread's agents, or a thread link that points there, and the thread opens read-only, streamed through the machine you are connected to over its link. It follows the thread live. On web and desktop -it opens as a tab in the right panel, beside the thread you are in, and shows -the same timeline as any other thread. +it opens as a tab in the right panel, beside the thread you are in, or in the +main view with ⌘/Ctrl-click, like +[subagents and side chats](thread-sidebar.md#open-a-thread-beside-the-one-you-are-in). +It shows the same timeline as any other thread. - The view is marked **Read-only** with both machines' names. To reply, approve or stop the thread, choose **Connect to interact**. When the link has full diff --git a/docs/user/thread-sidebar.md b/docs/user/thread-sidebar.md index 4854144f3658b..5950e152bd570 100644 --- a/docs/user/thread-sidebar.md +++ b/docs/user/thread-sidebar.md @@ -269,7 +269,10 @@ the snooze. Enable **Snooze until limits reset** in thread behavior settings to snooze limit stops by default. Providers without a reset time offer manual retry and the normal snooze choices. -On web and desktop, use **Agents** to follow work delegated to subagents. +On web and desktop, use **Agents** to follow work delegated to subagents. Click +a subagent there or on its conversation card to open it in the right panel, +beside the thread you are in. See +[Open a thread beside the one you are in](#open-a-thread-beside-the-one-you-are-in). On mobile, open a subagent from its conversation card or **Agents**. On iOS layouts with an inspector, its thread opens beside the parent. Maximize it to 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 shortcuts, such as Open in editor and project scripts. **Reset to default** brings back the standard rows. +## Open a thread beside the one you are in + +On web and desktop, a subagent, a side chat, and a +[thread on a linked machine](remote-access.md#read-a-linked-machines-threads) +all open the same way. Click one to open it as a tab in the right panel, so the +thread you are in stays in view. Hold ⌘ (Ctrl on Windows and Linux) while you +click, or middle-click, to open it in the main view instead. With the keyboard, +Enter and ⌘/Ctrl + Enter do the same. Right-click for **Open in side panel** and +**Open in main view**. + +To make the main view the place a plain click opens them, set **Settings → Chat → +Open subagents and side chats in** to **Main view**. The modifier then opens +the side panel. + +From a tab, **Open in main view** at the top of the tab, or in the tab's +right-click menu, moves it to the main view. The bottom of the view depends on +the thread: a side chat or a subagent you delegated has a composer, a subagent +the agent started is read-only, and a thread on a linked machine is read-only +with **Connect to interact**. + +Other thread links open in the main view as before. + +On mobile these threads open in the inspector on layouts that have one, where +Maximize fills the screen, and full screen everywhere else. + ## Side chats 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. On web and desktop, start a message with `/side` or `/btw`, then your question. You can also choose **Side chat** from the **+** menu in the right panel. The side chat opens as a tab there, with its own composer. Side chats do not show in the -sidebar. Find one again under **Side chats** in thread details. +sidebar. Find one again under **Side chats** in thread details, where it opens +[like a subagent does](#open-a-thread-beside-the-one-you-are-in). A side chat works in the same folder as the thread and starts with the permissions, model, and reasoning level shown in the thread's composer, including for its first diff --git a/packages/client-runtime/package.json b/packages/client-runtime/package.json index 0663ee293e2e8..361bbb32ff62a 100644 --- a/packages/client-runtime/package.json +++ b/packages/client-runtime/package.json @@ -115,6 +115,10 @@ "types": "./src/linkedThread.ts", "default": "./src/linkedThread.ts" }, + "./side-thread": { + "types": "./src/sideThread.ts", + "default": "./src/sideThread.ts" + }, "./scheduled-task-webhook": { "types": "./src/scheduledTaskWebhook.ts", "default": "./src/scheduledTaskWebhook.ts" diff --git a/packages/client-runtime/src/sideThread.test.ts b/packages/client-runtime/src/sideThread.test.ts new file mode 100644 index 0000000000000..70770aaace22d --- /dev/null +++ b/packages/client-runtime/src/sideThread.test.ts @@ -0,0 +1,108 @@ +import { ThreadId } from "@t3tools/contracts"; +import { describe, expect, it } from "vite-plus/test"; + +import { + resolveMobileSideThreadPresentation, + resolveSideThreadOpenTarget, + sideThreadComposer, + sideThreadKindOf, + sideThreadOpenIntentOf, +} from "./sideThread.ts"; + +const parentThreadId = ThreadId.make("parent"); +const lineage = ( + overrides: Partial<{ + parentThreadId: ThreadId | null; + relationshipToParent: "fork" | "subagent" | null; + sideChat: boolean; + }>, +) => ({ + lineage: { + rootThreadId: parentThreadId, + parentThreadId, + relationshipToParent: null, + forkedFrom: null, + ...overrides, + }, +}); + +describe("sideThreadKindOf", () => { + it.each([ + ["a side chat", lineage({ relationshipToParent: "fork", sideChat: true }), "side-chat"], + ["an app subagent", { ...lineage({ relationshipToParent: "subagent" }) }, "subagent"], + [ + "a provider's own subagent", + { ...lineage({ relationshipToParent: "subagent" }), creationSource: "provider" as const }, + "provider-subagent", + ], + ["a fork", lineage({ relationshipToParent: "fork" }), null], + ["a top-level thread", lineage({ parentThreadId: null }), null], + // The flag alone does not make a tab: a side chat is beside some thread. + ["a side chat with no parent", lineage({ parentThreadId: null, sideChat: true }), null], + ])("classifies %s", (_name, thread, kind) => { + expect(sideThreadKindOf(thread as Parameters[0])).toBe(kind); + }); + + it("treats a thread that is not loaded as an ordinary one", () => { + expect(sideThreadKindOf(null)).toBeNull(); + }); +}); + +describe("sideThreadComposer", () => { + it.each([ + ["side-chat", "composer"], + ["subagent", "composer"], + ["provider-subagent", "read-only"], + ["linked", "read-only-connect"], + ] as const)("gives %s the %s", (kind, composer) => { + expect(sideThreadComposer(kind)).toBe(composer); + }); +}); + +describe("resolveSideThreadOpenTarget", () => { + it.each([ + // preference, intent, panelAvailable, target + ["panel", "primary", true, "panel"], + ["panel", "alternate", true, "main"], + ["main", "primary", true, "main"], + ["main", "alternate", true, "panel"], + // The context menu names a place, whatever the preference. + ["panel", "main", true, "main"], + ["main", "panel", true, "panel"], + // With no panel to open in, every way of asking lands on the main view. + ["panel", "primary", false, "main"], + ["main", "alternate", false, "main"], + ["main", "panel", false, "main"], + ] as const)( + "prefers %s, asked %s, panel %s: opens in %s", + (preference, intent, panelAvailable, target) => { + expect(resolveSideThreadOpenTarget({ preference, intent, panelAvailable })).toBe(target); + }, + ); +}); + +describe("sideThreadOpenIntentOf", () => { + const plain = { metaKey: false, ctrlKey: false, button: 0 }; + + it("takes the platform's modifier and the middle button as the other place", () => { + expect(sideThreadOpenIntentOf(plain, true)).toBe("primary"); + expect(sideThreadOpenIntentOf({ ...plain, metaKey: true }, true)).toBe("alternate"); + expect(sideThreadOpenIntentOf({ ...plain, ctrlKey: true }, false)).toBe("alternate"); + expect(sideThreadOpenIntentOf({ ...plain, button: 1 }, false)).toBe("alternate"); + // A key press has no button. + expect(sideThreadOpenIntentOf({ metaKey: true, ctrlKey: false }, true)).toBe("alternate"); + }); + + it("ignores the other platform's modifier", () => { + // Ctrl-click on macOS is the context menu, and the Windows key is not Ctrl. + expect(sideThreadOpenIntentOf({ ...plain, ctrlKey: true }, true)).toBe("primary"); + expect(sideThreadOpenIntentOf({ ...plain, metaKey: true }, false)).toBe("primary"); + }); +}); + +describe("resolveMobileSideThreadPresentation", () => { + it("uses the inspector wherever the layout has one, else the full screen", () => { + expect(resolveMobileSideThreadPresentation({ inspectorAvailable: true })).toBe("inspector"); + expect(resolveMobileSideThreadPresentation({ inspectorAvailable: false })).toBe("full-screen"); + }); +}); diff --git a/packages/client-runtime/src/sideThread.ts b/packages/client-runtime/src/sideThread.ts new file mode 100644 index 0000000000000..8cac3a9552441 --- /dev/null +++ b/packages/client-runtime/src/sideThread.ts @@ -0,0 +1,94 @@ +import type { OrchestrationV2AppThread, SideThreadOpenTarget } from "@t3tools/contracts"; + +/** + * A thread that opens beside the one you are in. `linked` lives on a linked environment this client + * has no connection to; the others are threads of a connected environment. + */ +export type SideThreadKind = "side-chat" | "subagent" | "provider-subagent" | "linked"; + +/** + * Which side thread `thread` is, or null for a thread that opens like any other. A row that does + * not carry how the thread was created cannot tell a provider's own subagent from the app's. + */ +export function sideThreadKindOf( + thread: + | (Pick & + Partial>) + | null + | undefined, +): Exclude | null { + if (!thread) return null; + if (thread.lineage.sideChat === true && thread.lineage.parentThreadId !== null) { + return "side-chat"; + } + if (thread.lineage.relationshipToParent !== "subagent") return null; + return thread.creationSource === "provider" ? "provider-subagent" : "subagent"; +} + +export type SideThreadComposer = + /** The normal composer. */ + | "composer" + /** A bar that says the thread takes no messages. */ + | "read-only" + /** The same bar, offering to connect to the environment the thread is on. */ + | "read-only-connect"; + +/** What stands at the bottom of a side thread, in the panel and on the main screen alike. */ +export function sideThreadComposer(kind: SideThreadKind): SideThreadComposer { + switch (kind) { + case "linked": + return "read-only-connect"; + case "provider-subagent": + return "read-only"; + case "side-chat": + case "subagent": + return "composer"; + } +} + +/** + * How the user asked to open a side thread: a plain click or Enter, the same with the modifier + * (or a middle click), or one of the two places named outright, as a context menu does. + */ +export type SideThreadOpenIntent = "primary" | "alternate" | SideThreadOpenTarget; + +/** + * Where a side thread opens. The preference names the plain click's place and the modifier takes + * the other; without a panel to open in, everything goes to the main view. + */ +export function resolveSideThreadOpenTarget(input: { + readonly preference: SideThreadOpenTarget; + readonly intent: SideThreadOpenIntent; + readonly panelAvailable: boolean; +}): SideThreadOpenTarget { + if (!input.panelAvailable) return "main"; + switch (input.intent) { + case "primary": + return input.preference; + case "alternate": + return input.preference === "panel" ? "main" : "panel"; + default: + return input.intent; + } +} + +/** The intent of a click, an auxiliary click or a key press on a side thread's row. */ +export function sideThreadOpenIntentOf( + event: { + readonly metaKey: boolean; + readonly ctrlKey: boolean; + /** Absent on key events. */ + readonly button?: number; + }, + mac: boolean, +): Extract { + if (event.button === 1) return "alternate"; + return (mac ? event.metaKey : event.ctrlKey) ? "alternate" : "primary"; +} + +/** Where a side thread opens on mobile: the inspector pane where the layout has one. */ +export function resolveMobileSideThreadPresentation(input: { + readonly inspectorAvailable: boolean; +}): "inspector" | "full-screen" { + return input.inspectorAvailable ? "inspector" : "full-screen"; +} diff --git a/packages/contracts/src/settings.ts b/packages/contracts/src/settings.ts index 378b8af0e466f..b0726b07174c9 100644 --- a/packages/contracts/src/settings.ts +++ b/packages/contracts/src/settings.ts @@ -315,6 +315,13 @@ export { export const BrowserLinkTarget = Schema.Literals(["system", "app"]); export type BrowserLinkTarget = typeof BrowserLinkTarget.Type; export const DEFAULT_BROWSER_LINK_TARGET: BrowserLinkTarget = "system"; +/** + * Where a plain click opens a subagent, a side chat or a linked environment's thread: beside the + * thread you are in, or in its place. A modified click opens it in the other one. + */ +export const SideThreadOpenTarget = Schema.Literals(["panel", "main"]); +export type SideThreadOpenTarget = typeof SideThreadOpenTarget.Type; +const DEFAULT_SIDE_THREAD_OPEN_TARGET: SideThreadOpenTarget = "panel"; /** * What the address bar searches with when the input is not an address. * "custom" uses `browserCustomSearchUrl`, a template with `%s` for the query. @@ -525,6 +532,9 @@ export const ClientSettingsSchema = Schema.Struct({ followUpBehavior: Schema.Literals(["queue", "steer"]).pipe( Schema.withDecodingDefault(Effect.succeed("steer")), ), + sideThreadOpenTarget: SideThreadOpenTarget.pipe( + Schema.withDecodingDefault(Effect.succeed(DEFAULT_SIDE_THREAD_OPEN_TARGET)), + ), proactivePanelsEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))), showSkillsInSlashMenu: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))), boringSidebarEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))), @@ -2101,6 +2111,7 @@ export const ClientSettingsPatch = Schema.Struct({ composerRichTextEnabled: Schema.optionalKey(Schema.Boolean), sendShortcut: Schema.optionalKey(Schema.Literals(["enter", "mod-enter-multiline", "mod-enter"])), followUpBehavior: Schema.optionalKey(Schema.Literals(["queue", "steer"])), + sideThreadOpenTarget: Schema.optionalKey(SideThreadOpenTarget), proactivePanelsEnabled: Schema.optionalKey(Schema.Boolean), showSkillsInSlashMenu: Schema.optionalKey(Schema.Boolean), boringSidebarEnabled: Schema.optionalKey(Schema.Boolean), From f78d07a4e712cd8f0daf14f314d380a45bf76417 Mon Sep 17 00:00:00 2001 From: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Date: Thu, 19 Nov 2026 20:00:51 -0800 Subject: [PATCH 2/4] feat(mobile): a linked thread opens in the inspector like subagents and side chats Where the layout has an inspector, a linked environment's read-only thread now opens in it, with the same header as a subagent or side chat there, and its maximize button gives it the whole screen. Phones keep the existing screen. Co-Authored-By: Claude Fable 5.2 --- apps/mobile/src/Stack.tsx | 5 ++ .../features/threads/LinkedThreadSheet.tsx | 59 ++++++-------- .../features/threads/ThreadAgentsSheet.tsx | 7 +- .../features/threads/ThreadRouteScreen.tsx | 8 +- .../src/features/threads/linkedThreadRoute.ts | 22 ++++++ .../threads/thread-inspector-header.tsx | 38 +++++++++ .../thread-inspector-navigation.test.tsx | 64 ++++++++++++++- .../threads/thread-inspector-navigation.ts | 15 +++- .../threads/thread-inspector-preview.tsx | 77 ++++++++++--------- .../threads/thread-subagent-group.tsx | 15 ++-- .../features/threads/useOpenLinkedThread.ts | 53 +++++++++++++ .../src/features/threads/useOpenThreadLink.ts | 13 +--- docs/user/remote-access.md | 4 +- 13 files changed, 275 insertions(+), 105 deletions(-) create mode 100644 apps/mobile/src/features/threads/linkedThreadRoute.ts create mode 100644 apps/mobile/src/features/threads/thread-inspector-header.tsx diff --git a/apps/mobile/src/Stack.tsx b/apps/mobile/src/Stack.tsx index b9281945f11f6..696b01ce29692 100644 --- a/apps/mobile/src/Stack.tsx +++ b/apps/mobile/src/Stack.tsx @@ -789,6 +789,11 @@ const RootStackConfig = createWorkspaceStackNavigator({ screen: LinkedThreadSheet, options: sheetRoute({ detent: 0.9, android: "fullScreen" }), }), + // Maximized from the inspector, like ThreadInspectorFullscreen. + LinkedThreadFullscreen: createNativeStackScreen({ + screen: LinkedThreadSheet, + options: modalRoute({ header: "glass", itemStyle: "editor", duoMinimize: "onScrollUp" }), + }), ThreadGuestShare: createNativeStackScreen({ screen: ThreadGuestShareSheet, options: sheetRoute({ detent: 0.5 }), diff --git a/apps/mobile/src/features/threads/LinkedThreadSheet.tsx b/apps/mobile/src/features/threads/LinkedThreadSheet.tsx index 7c9ee3c17e9a7..061aaa8372f4a 100644 --- a/apps/mobile/src/features/threads/LinkedThreadSheet.tsx +++ b/apps/mobile/src/features/threads/LinkedThreadSheet.tsx @@ -26,7 +26,6 @@ import { AppActivityIndicator } from "../../components/ui/AppActivityIndicator"; import { AppText as Text } from "../../components/ui/AppText"; import { Button } from "../../components/ui/Button"; import { ScreenContent } from "../../components/ui/ScreenContent"; -import { SheetHeader } from "../../components/ui/SheetHeader"; import { SelectableMarkdownText } from "../../native/SelectableMarkdownText"; import { useEnvironments } from "../../state/environments"; import { @@ -40,30 +39,11 @@ import { useConnectLinkedEnvironment, useLinkedThreadView } from "../../state/li import { peerLinkEnvironment } from "../../state/peerLinks"; import { useEnvironmentQuery } from "../../state/query"; import { useMarkdownPreviewStyles } from "../files/FileMarkdownPreview"; +import type { LinkedThreadRouteParams } from "./linkedThreadRoute"; import { ReadOnlyComposerBar } from "./ReadOnlyComposerBar"; +import { ThreadInspectorHeader, type ThreadInspectorPresentation } from "./thread-inspector-header"; import { useOpenLinkedThread } from "./useOpenLinkedThread"; -type LinkedThreadRouteParams = { - readonly viaEnvironmentId: string; - readonly environmentId: string; - readonly threadId: string; - readonly label: string; - readonly title?: string; -}; - -/** The route params that open a linked environment's thread read-only. */ -export const linkedThreadRouteParams = ( - thread: { readonly environmentId: EnvironmentId; readonly threadId: ThreadId }, - linked: { readonly viaEnvironmentId: EnvironmentId; readonly label: string }, - title: string | null, -): LinkedThreadRouteParams => ({ - viaEnvironmentId: linked.viaEnvironmentId, - environmentId: thread.environmentId, - threadId: thread.threadId, - label: linked.label, - ...(title === null ? {} : { title }), -}); - function ActivityRow(props: { readonly activity: ThreadFeedActivity; readonly target: LinkedThreadTarget; @@ -263,12 +243,23 @@ const subscribeAppState = (onChange: () => void) => { }; const appIsActive = () => AppState.currentState === "active"; -function LinkedThreadView(props: { readonly target: LinkedThreadTarget }) { +/** + * A linked environment's thread, read through the environment this app is connected to. The app + * never connects to the linked one, so the view only reads. It shows in the inspector, where + * `presentation` maximizes it, or as its own screen, where `presentation` closes it. + */ +export function LinkedThreadView(props: { + readonly target: LinkedThreadTarget; + /** Closes the screen by going back when absent. */ + readonly presentation?: ThreadInspectorPresentation; +}) { const { target } = props; const gt = useGT(); const m = useMessages(); const locale = useLocale(); const navigation = useNavigation(); + const presentation = props.presentation ?? { onClose: () => navigation.goBack() }; + const inInspector = "onMaximize" in presentation; const insets = useSafeAreaInsets(); const via = useEnvironments().environments.find( @@ -302,20 +293,23 @@ function LinkedThreadView(props: { readonly target: LinkedThreadTarget }) { const connect = async () => { const outcome = await connection.connect(); if (outcome.type === "unreachable") return; - // This sheet closes either way: the thread opens where the app is now connected, or the - // add-environment screen takes its place. + // The read-only view gives way either way: the thread opens where the app is now connected, + // or the add-environment screen takes its place. In the inspector the thread replaces it there. if (outcome.type === "connected") { - navigation.goBack(); + if (!inInspector) navigation.goBack(); openThread({ environmentId: target.environmentId, threadId: target.threadId }); return; } - navigation.dispatch(StackActions.replace("ConnectionsNew", { linked: target.environmentId })); + if (inInspector) navigation.navigate("ConnectionsNew", { linked: target.environmentId }); + else { + navigation.dispatch(StackActions.replace("ConnectionsNew", { linked: target.environmentId })); + } }; return ( - - + navigation.goBack()} /> ) { const { viaEnvironmentId, environmentId, threadId, label, title } = route.params; return ( diff --git a/apps/mobile/src/features/threads/ThreadAgentsSheet.tsx b/apps/mobile/src/features/threads/ThreadAgentsSheet.tsx index 0299b688dd86a..e2c3d6d04bbf7 100644 --- a/apps/mobile/src/features/threads/ThreadAgentsSheet.tsx +++ b/apps/mobile/src/features/threads/ThreadAgentsSheet.tsx @@ -30,10 +30,10 @@ import { SubagentStopButton } from "./SubagentStopButton"; import { ThreadWorkflowGroup } from "./ThreadWorkflowGroup"; import { ScreenContent } from "../../components/ui/ScreenContent"; import { subagentThreadTarget, type SubagentThreadTarget } from "./threadAgentsPresentation"; -import { linkedThreadRouteParams } from "./LinkedThreadSheet"; import { useLinkedThreadReach } from "../../state/linkedThread"; import { useOpenThreadInspector } from "./thread-inspector-navigation"; +import { useOpenLinkedThreadRead } from "./useOpenLinkedThread"; type AgentsTarget = { readonly environmentId: EnvironmentId; readonly threadId: ThreadId }; @@ -53,6 +53,7 @@ export function ThreadAgentsSheet({ route }: StaticScreenProps) { const target = route.params; const navigation = useNavigation(); const openInspector = useOpenThreadInspector(); + const openLinkedRead = useOpenLinkedThreadRead(); const insets = useSafeAreaInsets(); const gt = useGT(); const messages = useMessages(); @@ -73,9 +74,7 @@ export function ThreadAgentsSheet({ route }: StaticScreenProps) { const openChildThread = (child: SubagentThreadTarget, title: string | null = null) => { void Haptics.selectionAsync(); if (child.linked !== undefined) { - navigation.dispatch( - StackActions.replace("LinkedThread", linkedThreadRouteParams(child, child.linked, title)), - ); + openLinkedRead(child, child.linked, title, { source: target, replace: true }); return; } if ( diff --git a/apps/mobile/src/features/threads/ThreadRouteScreen.tsx b/apps/mobile/src/features/threads/ThreadRouteScreen.tsx index 9d9cddd644e36..6feb3750d6f52 100644 --- a/apps/mobile/src/features/threads/ThreadRouteScreen.tsx +++ b/apps/mobile/src/features/threads/ThreadRouteScreen.tsx @@ -127,12 +127,8 @@ import { useWorkspaceBackNavigation, } from "../layout/workspace/useAndroidWorkspaceNavigation"; import { openSettings } from "../settings/settings-navigation"; -import { - InspectorContentScope, - ThreadInspectorHeader, - ThreadInspectorPreview, - type ThreadInspectorPresentation, -} from "./thread-inspector-preview"; +import { ThreadInspectorHeader, type ThreadInspectorPresentation } from "./thread-inspector-header"; +import { InspectorContentScope, ThreadInspectorPreview } from "./thread-inspector-preview"; import { useStartSideChat } from "./useStartSideChat"; import { useThreadStatusAnnouncements } from "./useThreadStatusAnnouncements"; import type { ThreadInspectorMode, ThreadInspectorTarget } from "./thread-inspector-navigation"; diff --git a/apps/mobile/src/features/threads/linkedThreadRoute.ts b/apps/mobile/src/features/threads/linkedThreadRoute.ts new file mode 100644 index 0000000000000..e428e57a2834f --- /dev/null +++ b/apps/mobile/src/features/threads/linkedThreadRoute.ts @@ -0,0 +1,22 @@ +import type { EnvironmentId, ThreadId } from "@t3tools/contracts"; + +export type LinkedThreadRouteParams = { + readonly viaEnvironmentId: string; + readonly environmentId: string; + readonly threadId: string; + readonly label: string; + readonly title?: string; +}; + +/** The route params that open a linked environment's thread read-only. */ +export const linkedThreadRouteParams = ( + thread: { readonly environmentId: EnvironmentId; readonly threadId: ThreadId }, + linked: { readonly viaEnvironmentId: EnvironmentId; readonly label: string }, + title: string | null, +): LinkedThreadRouteParams => ({ + viaEnvironmentId: linked.viaEnvironmentId, + environmentId: thread.environmentId, + threadId: thread.threadId, + label: linked.label, + ...(title === null ? {} : { title }), +}); diff --git a/apps/mobile/src/features/threads/thread-inspector-header.tsx b/apps/mobile/src/features/threads/thread-inspector-header.tsx new file mode 100644 index 0000000000000..f3d738d3238ed --- /dev/null +++ b/apps/mobile/src/features/threads/thread-inspector-header.tsx @@ -0,0 +1,38 @@ +import { useGT } from "gt-react-native"; + +import { AppBar } from "../../components/ui/AppBar"; +import { SheetHeader } from "../../components/ui/SheetHeader"; + +/** A thread shown outside its route: in the inspector pane, or presented full screen with a close. */ +export type ThreadInspectorPresentation = + | { readonly onMaximize: () => void } + | { readonly onClose: () => void }; + +export function ThreadInspectorHeader( + props: ThreadInspectorPresentation & { readonly title: string; readonly subtitle?: string }, +) { + const gt = useGT(); + if ("onMaximize" in props) { + return ( + + ); + } + return ( + + ); +} diff --git a/apps/mobile/src/features/threads/thread-inspector-navigation.test.tsx b/apps/mobile/src/features/threads/thread-inspector-navigation.test.tsx index d09bd106941c0..404d28184d7b8 100644 --- a/apps/mobile/src/features/threads/thread-inspector-navigation.test.tsx +++ b/apps/mobile/src/features/threads/thread-inspector-navigation.test.tsx @@ -3,17 +3,19 @@ import * as NodeModule from "node:module"; import * as React from "react"; import { act, useLayoutEffect } from "react"; import { createRoot } from "react-dom/client"; +import { EnvironmentId, ThreadId } from "@t3tools/contracts"; import { expect, it, vi } from "vite-plus/test"; const harness = vi.hoisted(() => ({ dispatch: (_action: unknown) => {}, getState: (): unknown => undefined, getRoute: (): unknown => undefined, + inspectorSupported: true, })); vi.mock("react-native", () => ({ Platform: { OS: "ios" } })); vi.mock("../layout/AdaptiveWorkspaceLayout", () => ({ - useWorkspacePaneState: () => ({ fileInspector: { supported: true } }), + useWorkspacePaneState: () => ({ fileInspector: { supported: harness.inspectorSupported } }), })); vi.mock("@react-navigation/native", async () => { const { createRequire } = await import("node:module"); @@ -28,7 +30,7 @@ vi.mock("@react-navigation/native", async () => { }); import { useOpenThreadInspector } from "./thread-inspector-navigation"; -import { useOpenLinkedThread } from "./useOpenLinkedThread"; +import { useOpenLinkedThread, useOpenLinkedThreadRead } from "./useOpenLinkedThread"; const requireNavigation = NodeModule.createRequire( NodeModule.createRequire(import.meta.url).resolve("@react-navigation/native/package.json"), @@ -38,11 +40,12 @@ const { StackRouter, StackActions } = requireNavigation("@react-navigation/route StackActions: typeof import("@react-navigation/native").StackActions; }; -function setup(fromAgents: boolean, fullscreen = false) { +function setup(fromAgents: boolean, fullscreen = false, inspectorSupported = true) { + harness.inspectorSupported = inspectorSupported; (globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true; const router = StackRouter({}); const options = { - routeNames: ["Home", "Thread", "ThreadAgents", "ThreadInspectorFullscreen"], + routeNames: ["Home", "Thread", "ThreadAgents", "ThreadInspectorFullscreen", "LinkedThread"], routeParamList: {}, routeGetIdList: {}, }; @@ -66,12 +69,15 @@ function setup(fromAgents: boolean, fullscreen = false) { ); let openInspector: ReturnType; let openLinkedThread: ReturnType; + let openLinkedThreadRead: ReturnType; function Probe() { const open = useOpenThreadInspector(); const openLinked = useOpenLinkedThread(); + const openLinkedRead = useOpenLinkedThreadRead(); useLayoutEffect(() => { openInspector = open; openLinkedThread = openLinked; + openLinkedThreadRead = openLinkedRead; }); return null; } @@ -94,6 +100,9 @@ function setup(fromAgents: boolean, fullscreen = false) { openLinked(threadId: string) { act(() => openLinkedThread({ environmentId: source.environmentId, threadId })); }, + openLinkedRead(...input: Parameters) { + act(() => openLinkedThreadRead(...input)); + }, [Symbol.dispose]() { act(() => root.unmount()); }, @@ -134,6 +143,53 @@ it("opens a completion link in the parent inspector", () => { }); }); +it.each([ + { inspectorSupported: true, fromAgents: false }, + { inspectorSupported: true, fromAgents: true }, + { inspectorSupported: false, fromAgents: false }, + { inspectorSupported: false, fromAgents: true }, +])( + "opens a linked environment's thread in the inspector where there is one ($inspectorSupported, from Agents $fromAgents)", + ({ inspectorSupported, fromAgents }) => { + using screen = setup(fromAgents, false, inspectorSupported); + const thread = { + environmentId: EnvironmentId.make("linked-vm"), + threadId: ThreadId.make("there"), + }; + const linked = { viaEnvironmentId: EnvironmentId.make("remote-environment"), label: "fs-17" }; + screen.openLinkedRead(thread, linked, "Fix the build", { + source: screen.source, + replace: fromAgents, + }); + if (inspectorSupported) { + // Beside the parent, like a subagent or a side chat; the Agents sheet gives way. + expect(screen.state.routes.map((route) => route.name)).toEqual(["Home", "Thread"]); + expect(screen.state.routes.at(-1)).toMatchObject({ + key: screen.parentKey, + params: { + inspector: { + type: "linkedThread", + ...thread, + linked: { ...linked, title: "Fix the build" }, + }, + }, + }); + return; + } + // A phone has no inspector: the read-only thread takes the screen, replacing the sheet. + expect(screen.state.routes.map((route) => route.name)).toEqual([ + "Home", + "Thread", + "LinkedThread", + ]); + expect(screen.state.routes.at(-1)?.params).toEqual({ + ...thread, + ...linked, + title: "Fix the build", + }); + }, +); + it("switches between subagents and devices in the same parent route", () => { using screen = setup(false); screen.open({ type: "thread", environmentId: screen.source.environmentId, threadId: "child" }); diff --git a/apps/mobile/src/features/threads/thread-inspector-navigation.ts b/apps/mobile/src/features/threads/thread-inspector-navigation.ts index fa60cf45a84ae..966dd1a92a632 100644 --- a/apps/mobile/src/features/threads/thread-inspector-navigation.ts +++ b/apps/mobile/src/features/threads/thread-inspector-navigation.ts @@ -2,14 +2,22 @@ import { StackActions, useNavigation } from "@react-navigation/native"; import { createContext, use } from "react"; import { Platform } from "react-native"; +import { resolveMobileSideThreadPresentation } from "@t3tools/client-runtime/side-thread"; + import { useWorkspacePaneState } from "../layout/AdaptiveWorkspaceLayout"; export type ThreadInspectorMode = "route" | "git" | "files" | "preview"; export type ThreadInspectorTarget = { - readonly type: "thread" | "device" | "localPreview"; + /** "linkedThread" is a thread on a linked environment, read through `linked.viaEnvironmentId`. */ + readonly type: "thread" | "linkedThread" | "device" | "localPreview"; readonly environmentId: string; readonly threadId: string; + readonly linked?: { + readonly viaEnvironmentId: string; + readonly label: string; + readonly title?: string; + }; readonly deviceKey?: string; /** The environment's localhost page a "localPreview" shows. */ readonly url?: string; @@ -27,7 +35,10 @@ export function useOpenThreadInspector() { source: { readonly environmentId: string; readonly threadId: string }, target: ThreadInspectorTarget, ) => { - if (Platform.OS !== "ios" || !fileInspector.supported) return false; + const presentation = resolveMobileSideThreadPresentation({ + inspectorAvailable: Platform.OS === "ios" && fileInspector.supported, + }); + if (presentation === "full-screen") return false; if (openInInspector) openInInspector(target); else { const parent = navigation.getState()?.routes.findLast((route) => route.name === "Thread"); diff --git a/apps/mobile/src/features/threads/thread-inspector-preview.tsx b/apps/mobile/src/features/threads/thread-inspector-preview.tsx index e8ea059b54f2b..f3934aad9accc 100644 --- a/apps/mobile/src/features/threads/thread-inspector-preview.tsx +++ b/apps/mobile/src/features/threads/thread-inspector-preview.tsx @@ -1,11 +1,8 @@ import { useIsFocused, useNavigation, type StaticScreenProps } from "@react-navigation/native"; import { EnvironmentId, ThreadId } from "@t3tools/contracts"; -import { useGT } from "gt-react-native"; import { type ReactNode } from "react"; import { View } from "react-native"; -import { AppBar } from "../../components/ui/AppBar"; -import { SheetHeader } from "../../components/ui/SheetHeader"; import { LocalPreviewScreen } from "../browser/LocalPreviewRouteScreen"; import { DevicePreviewScreen } from "../devices/DevicePreviewRouteScreen"; import { @@ -16,42 +13,11 @@ import { ThreadInspectorNavigationContext, type ThreadInspectorTarget, } from "./thread-inspector-navigation"; +import { linkedThreadRouteParams } from "./linkedThreadRoute"; +import { LinkedThreadView } from "./LinkedThreadSheet"; +import type { ThreadInspectorPresentation } from "./thread-inspector-header"; import { ThreadPreviewRoute } from "./thread-preview-route"; -/** A thread shown outside its route: in the inspector pane, or presented full screen with a close. */ -export type ThreadInspectorPresentation = - | { readonly onMaximize: () => void } - | { readonly onClose: () => void }; - -export function ThreadInspectorHeader( - props: ThreadInspectorPresentation & { readonly title: string; readonly subtitle?: string }, -) { - const gt = useGT(); - if ("onMaximize" in props) { - return ( - - ); - } - return ( - - ); -} - /** A thread shown beside or over the workspace does not take the workspace's content width. */ export function InspectorContentScope({ children }: { readonly children: ReactNode }) { return ( @@ -102,6 +68,12 @@ export function ThreadInspectorPreview(props: { }); }} /> + ) : target.type === "linkedThread" && target.linked ? ( + ) : target.type === "device" ? ( ); } + +/** A linked environment's read-only thread in the inspector; Maximize gives it the whole screen. */ +function LinkedThread(props: { + readonly thread: Pick; + readonly linked: NonNullable; +}) { + const navigation = useNavigation(); + const params = linkedThreadRouteParams( + { + environmentId: EnvironmentId.make(props.thread.environmentId), + threadId: ThreadId.make(props.thread.threadId), + }, + { + viaEnvironmentId: EnvironmentId.make(props.linked.viaEnvironmentId), + label: props.linked.label, + }, + props.linked.title ?? null, + ); + return ( + navigation.navigate("LinkedThreadFullscreen", params) }} + /> + ); +} diff --git a/apps/mobile/src/features/threads/thread-subagent-group.tsx b/apps/mobile/src/features/threads/thread-subagent-group.tsx index 0ef23f27a06b4..e953e0c56a8c5 100644 --- a/apps/mobile/src/features/threads/thread-subagent-group.tsx +++ b/apps/mobile/src/features/threads/thread-subagent-group.tsx @@ -28,11 +28,11 @@ import { useServerConfigs } from "../../state/entities"; import { SubagentRow } from "./SubagentRow"; import { useVisibleSecondClock } from "./use-visible-second-clock"; import { subagentThreadTarget } from "./threadAgentsPresentation"; -import { linkedThreadRouteParams } from "./LinkedThreadSheet"; import { useLinkedThreadReach } from "../../state/linkedThread"; import { WorkLogBlock } from "./work-log-layout"; import { useOpenThreadInspector } from "./thread-inspector-navigation"; +import { useOpenLinkedThreadRead } from "./useOpenLinkedThread"; type SubagentItem = Extract; type AgentTiming = Pick; @@ -114,6 +114,7 @@ export function ThreadSubagentGroup(props: { const config = useAtomValue(serverEnvironment.configValueAtom(props.environmentId)); const navigation = useNavigation(); const openInspector = useOpenThreadInspector(); + const openLinkedRead = useOpenLinkedThreadRead(); const members = props.activities.flatMap(({ projectedItem }) => projectedItem.item.type === "subagent" ? [projectedItem.item] : [], ); @@ -224,12 +225,12 @@ export function ThreadSubagentGroup(props: { onPress={() => { if (target === null) return; if (target.linked !== undefined) { - navigation.dispatch( - StackActions.push( - "LinkedThread", - linkedThreadRouteParams(target, target.linked, agent.title), - ), - ); + openLinkedRead(target, target.linked, agent.title, { + source: { + environmentId: props.environmentId, + threadId: members[0]!.threadId, + }, + }); return; } if ( diff --git a/apps/mobile/src/features/threads/useOpenLinkedThread.ts b/apps/mobile/src/features/threads/useOpenLinkedThread.ts index 2fc70a6298d7d..dc7217cfbc862 100644 --- a/apps/mobile/src/features/threads/useOpenLinkedThread.ts +++ b/apps/mobile/src/features/threads/useOpenLinkedThread.ts @@ -1,8 +1,12 @@ import { StackActions, useNavigation, useRoute, type Route } from "@react-navigation/native"; import { use } from "react"; +import type { EnvironmentId, ThreadId } from "@t3tools/contracts"; + import { linkedThreadStep } from "../../lib/android-workspace-navigation"; +import { linkedThreadRouteParams } from "./linkedThreadRoute"; import { ThreadInspectorNavigationContext, + type ThreadInspectorTarget, useOpenThreadInspector, } from "./thread-inspector-navigation"; @@ -33,3 +37,52 @@ export function useOpenLinkedThread() { else if (step === "push") navigation.dispatch(StackActions.push("Thread", target)); }; } + +/** + * Opens a linked environment's thread read-only, read through `linked.viaEnvironmentId`: in the + * inspector where the layout has one, as subagents and side chats do, else as its own screen. + * `source` is the thread it opens from when the caller is not that thread's own screen. + */ +export function useOpenLinkedThreadRead() { + const navigation = useNavigation(); + const route = useRoute>(); + const openInspector = useOpenThreadInspector(); + const openInInspector = use(ThreadInspectorNavigationContext); + return ( + thread: { readonly environmentId: EnvironmentId; readonly threadId: ThreadId }, + linked: { readonly viaEnvironmentId: EnvironmentId; readonly label: string }, + title: string | null, + options?: { + readonly source?: { readonly environmentId: string; readonly threadId: string }; + /** Replaces the calling sheet instead of stacking on it. */ + readonly replace?: boolean; + }, + ) => { + const params = linkedThreadRouteParams(thread, linked, title); + const target: ThreadInspectorTarget = { + type: "linkedThread", + environmentId: params.environmentId, + threadId: params.threadId, + linked: { + viaEnvironmentId: params.viaEnvironmentId, + label: params.label, + ...(params.title === undefined ? {} : { title: params.title }), + }, + }; + if (openInInspector) { + openInInspector(target); + return; + } + const source = + options?.source ?? + (route.name === "Thread" && route.params?.environmentId && route.params.threadId + ? { environmentId: route.params.environmentId, threadId: route.params.threadId } + : null); + if (source !== null && openInspector(source, target)) return; + navigation.dispatch( + options?.replace + ? StackActions.replace("LinkedThread", params) + : StackActions.push("LinkedThread", params), + ); + }; +} diff --git a/apps/mobile/src/features/threads/useOpenThreadLink.ts b/apps/mobile/src/features/threads/useOpenThreadLink.ts index 27e5c5ecdea75..08e04898c7aac 100644 --- a/apps/mobile/src/features/threads/useOpenThreadLink.ts +++ b/apps/mobile/src/features/threads/useOpenThreadLink.ts @@ -1,19 +1,17 @@ -import { StackActions, useNavigation } from "@react-navigation/native"; import { resolveLinkedThreadOpen } from "@t3tools/client-runtime/linked-thread"; import type { EnvironmentId, ScopedThreadRef } from "@t3tools/contracts"; import { useEnvironments } from "../../state/environments"; import { useLinkedEnvironments } from "../../state/peerLinks"; -import { linkedThreadRouteParams } from "./LinkedThreadSheet"; -import { useOpenLinkedThread } from "./useOpenLinkedThread"; +import { useOpenLinkedThread, useOpenLinkedThreadRead } from "./useOpenLinkedThread"; /** * Opens a thread that a link or chip in `viaEnvironmentId` points at: in place when this app is * connected to its environment, else read-only through `viaEnvironmentId`'s link to it. */ export function useOpenThreadLink(viaEnvironmentId: EnvironmentId | null) { - const navigation = useNavigation(); const openThread = useOpenLinkedThread(); + const openLinkedRead = useOpenLinkedThreadRead(); const linkedEnvironments = useLinkedEnvironments(viaEnvironmentId); const { presentationById } = useEnvironments(); return (thread: ScopedThreadRef, title: string | null = null) => { @@ -29,12 +27,7 @@ export function useOpenThreadLink(viaEnvironmentId: EnvironmentId | null) { linked: true, }) === "linked" ) { - navigation.dispatch( - StackActions.push( - "LinkedThread", - linkedThreadRouteParams(thread, { viaEnvironmentId, label }, title), - ), - ); + openLinkedRead(thread, { viaEnvironmentId, label }, title); return; } openThread({ diff --git a/docs/user/remote-access.md b/docs/user/remote-access.md index 9240cfe873942..61492760f2a4b 100644 --- a/docs/user/remote-access.md +++ b/docs/user/remote-access.md @@ -486,7 +486,9 @@ are connected to over its link. It follows the thread live. On web and desktop it opens as a tab in the right panel, beside the thread you are in, or in the main view with ⌘/Ctrl-click, like [subagents and side chats](thread-sidebar.md#open-a-thread-beside-the-one-you-are-in). -It shows the same timeline as any other thread. +On mobile it opens in the inspector on layouts that have one, where Maximize +fills the screen, and as its own screen elsewhere. It shows the same timeline as +any other thread on web and desktop, and a shorter read-only list on mobile. - The view is marked **Read-only** with both machines' names. To reply, approve or stop the thread, choose **Connect to interact**. When the link has full From 45fff06827da944fa008dc344560f1e89e7ed77c Mon Sep 17 00:00:00 2001 From: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Date: Fri, 20 Nov 2026 11:42:55 -0800 Subject: [PATCH 3/4] fix(web): a linked thread opens on the main screen, and a side thread tab has no second header A linked thread's route used the params a local thread route uses, so the chat layout took it for a thread on this client and rendered nothing. Its params now have their own names. The header under a subagent's or linked thread's tab repeated the tab's title, Close and Open in main view, so it is gone. A side chat keeps its header for Add to chat and Delete. Co-Authored-By: Claude Fable 5.2 --- .../src/components/ChatView.browser.test.tsx | 16 +- .../src/components/chat/LinkedThreadPane.tsx | 27 +--- .../chat/RightPanelSurfaceContent.tsx | 1 - .../src/components/chat/SideThreadPane.tsx | 145 ++++++------------ .../web/src/hooks/useOpenSurfaceInMainView.ts | 2 +- apps/web/src/i18n/translations/de.json | 5 +- apps/web/src/i18n/translations/en.json | 5 +- apps/web/src/i18n/translations/es.json | 5 +- apps/web/src/i18n/translations/fr.json | 5 +- apps/web/src/i18n/translations/ja.json | 5 +- apps/web/src/i18n/translations/ko.json | 5 +- apps/web/src/i18n/translations/pt-BR.json | 5 +- apps/web/src/i18n/translations/ru.json | 5 +- apps/web/src/i18n/translations/sv.json | 5 +- apps/web/src/i18n/translations/zh.json | 5 +- apps/web/src/lib/sideChatPane.ts | 2 +- apps/web/src/linkedThreadSurface.ts | 4 +- apps/web/src/routeTree.gen.ts | 44 +++--- ....$linkedEnvironmentId.$linkedThreadId.tsx} | 9 +- apps/web/src/threadRoutes.test.ts | 12 ++ 20 files changed, 110 insertions(+), 202 deletions(-) rename apps/web/src/routes/{_chat.linked.$viaEnvironmentId.$environmentId.$threadId.tsx => _chat.linked.$viaEnvironmentId.$linkedEnvironmentId.$linkedThreadId.tsx} (59%) diff --git a/apps/web/src/components/ChatView.browser.test.tsx b/apps/web/src/components/ChatView.browser.test.tsx index 66eed3d0158b3..ae6628ba6733c 100644 --- a/apps/web/src/components/ChatView.browser.test.tsx +++ b/apps/web/src/components/ChatView.browser.test.tsx @@ -32,7 +32,7 @@ import stylesheet from "~/index.css?inline"; import { environmentContextRecord } from "~/lib/composerContextRecords"; import { startWorkspaceFocus } from "~/lib/workspaceFocus"; import { usePromptStashStore } from "~/promptStashStore"; -import { selectThreadRightPanelState, useRightPanelStore } from "~/rightPanelStore"; +import { useRightPanelStore } from "~/rightPanelStore"; import { getRouter } from "~/router"; import { appAtomRegistry } from "~/rpc/atomRegistry"; import { environmentThreadDetails } from "~/state/threads"; @@ -805,7 +805,7 @@ it("selecting a side-chat tab focuses that side chat's composer", async () => { await expect.element(mainEditor).toHaveTextContent("main draft"); }); -it("a subagent tab shows its read-only bar and moves to the main view", async () => { +it("a subagent tab shows its read-only bar under no header of its own", async () => { const parent = threadWithHistory("subagent-parent", 1); const subagent = { ...threadWithHistory("subagent-child", 1), @@ -829,8 +829,8 @@ it("a subagent tab shows its read-only bar and moves to the main view", async () router: false, }); const pane = screen.getByTestId("side-thread-pane"); - // The same header as a side chat, without what only a side chat offers. - await expect.element(pane.getByRole("heading", { name: subagent.title })).toBeVisible(); + // No header of its own: the tab names it, and only a side chat has actions to put in one. + await expect.element(pane.getByRole("heading", { name: subagent.title })).not.toBeInTheDocument(); await expect.element(pane.getByText("Runs on its own")).toBeVisible(); await expect.element(pane.getByRole("button", { name: "Add to chat" })).not.toBeInTheDocument(); await expect @@ -839,14 +839,6 @@ it("a subagent tab shows its read-only bar and moves to the main view", async () await expect .element(screen.getByRole("textbox", { name: `Message ${parent.title}`, exact: true })) .toBeVisible(); - - await pane.getByRole("button", { name: "Open in main view" }).click(); - await vi.waitFor(() => - expect(router.state.location.pathname).toBe(`/${ENVIRONMENT_ID}/${subagent.id}`), - ); - expect( - selectThreadRightPanelState(useRightPanelStore.getState().byThreadKey, parentRef).surfaces, - ).toEqual([]); }); it("/side sends the draft's attachments and context, and keeps them when it does not start", async () => { diff --git a/apps/web/src/components/chat/LinkedThreadPane.tsx b/apps/web/src/components/chat/LinkedThreadPane.tsx index 00b0a8c226575..798ef2c80e405 100644 --- a/apps/web/src/components/chat/LinkedThreadPane.tsx +++ b/apps/web/src/components/chat/LinkedThreadPane.tsx @@ -4,7 +4,6 @@ import { T, useGT, useMessages, Var } from "gt-react"; import { EyeIcon, PlugIcon } from "lucide-react"; import { useState, type ReactNode } from "react"; -import { useOpenSurfaceInMainView } from "../../hooks/useOpenSurfaceInMainView"; import { useStableCallback } from "../../hooks/useStableCallback"; import { type LinkedThreadSurface, linkedThreadTitle } from "../../linkedThreadSurface"; import { useEnvironment } from "../../state/environments"; @@ -22,7 +21,6 @@ import { ReadOnlyComposerLead, ReadOnlyComposerStatus, } from "./ReadOnlyComposerBar"; -import { SideThreadPaneHeader } from "./SideThreadPane"; import { Spinner } from "../ui/spinner"; import { toastManager } from "../ui/toast"; import type { MessagesTimelineHistoryControls } from "./MessagesTimeline"; @@ -84,8 +82,8 @@ export function LinkedThread(props: { readonly surface: LinkedThreadSurface; /** Whether it is showing; the stream runs only while it is. */ readonly visible: boolean; - /** What sits above the timeline, given the thread's title once the stream or surface names it. */ - readonly renderHeader: (title: string) => ReactNode; + /** What sits above the timeline on the main screen; a tab already names the thread. */ + readonly renderHeader?: (title: string) => ReactNode; }) { const { surface, panelRef } = props; const gt = useGT(); @@ -182,7 +180,7 @@ export function LinkedThread(props: { data-chat-canvas className="flex h-full min-h-0 flex-col [--chat-lane-inset-end:0px] [--chat-lane-inset-start:0px] [--chat-timeline-gutter:0px]" > - {props.renderHeader( + {props.renderHeader?.( linkedThreadTitle( { title: projection?.thread.title || surface.title }, gt("Thread on {label}", { label }), @@ -265,23 +263,6 @@ export function LinkedThreadPane(props: { readonly surface: LinkedThreadSurface; /** Whether the tab is showing. */ readonly visible: boolean; - readonly onClose: () => void; }) { - const { panelRef, surface } = props; - const openInMainView = useOpenSurfaceInMainView(panelRef); - return ( - ( - openInMainView(surface)} - onClose={props.onClose} - /> - )} - /> - ); + return ; } diff --git a/apps/web/src/components/chat/RightPanelSurfaceContent.tsx b/apps/web/src/components/chat/RightPanelSurfaceContent.tsx index 9da95e52e0c8d..22ef904e2c13f 100644 --- a/apps/web/src/components/chat/RightPanelSurfaceContent.tsx +++ b/apps/web/src/components/chat/RightPanelSurfaceContent.tsx @@ -231,7 +231,6 @@ export function RightPanelSurfaceContent(props: { panelRef={threadRef} surface={surface} visible={visible && props.activeSurfaceId === surface.id} - onClose={() => onCloseSurface(surface)} /> ); case "device": diff --git a/apps/web/src/components/chat/SideThreadPane.tsx b/apps/web/src/components/chat/SideThreadPane.tsx index 80e2be31e1b4c..9f32d90c4f8a7 100644 --- a/apps/web/src/components/chat/SideThreadPane.tsx +++ b/apps/web/src/components/chat/SideThreadPane.tsx @@ -1,5 +1,5 @@ import { scopeThreadRef } from "@t3tools/client-runtime/environment"; -import { sideThreadKindOf, type SideThreadKind } from "@t3tools/client-runtime/side-thread"; +import { sideThreadKindOf } from "@t3tools/client-runtime/side-thread"; import { formatSubagentDisplayTitle } from "@t3tools/client-runtime/state/subagent-display"; import { isAtomCommandInterrupted, @@ -9,12 +9,11 @@ import { import { AuthOrchestrationOperateScope, type ScopedThreadRef } from "@t3tools/contracts"; import { threadContextRecord } from "@t3tools/shared/composerContextReferences"; import { T, useGT } from "gt-react"; -import { SquareArrowOutUpLeftIcon, Trash2Icon, XIcon } from "lucide-react"; -import { type ReactNode, useEffect, useState } from "react"; +import { Trash2Icon, XIcon } from "lucide-react"; +import { useEffect, useState } from "react"; import { useComposerDraftStore } from "../../composerDraftStore"; import { ComposerHandleContext } from "../../composerHandleContext"; -import { useOpenSurfaceInMainView } from "../../hooks/useOpenSurfaceInMainView"; import { useClientSettings } from "../../hooks/useSettings"; import { releaseComposerDraftUploads } from "../../lib/composerDraftUploads"; import type { SideChatParentPanel } from "../../lib/sideChatPane"; @@ -37,60 +36,9 @@ import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; import { BackgroundThreadContext } from "./backgroundThread"; /** - * The top of every side thread's tab: what the thread is, what its kind can do, then the way to - * the main view and Close, in the same place whichever kind it is. - */ -export function SideThreadPaneHeader(props: { - readonly title: string; - readonly kind: SideThreadKind; - /** What only this kind of thread offers, before the shared controls. */ - readonly children?: ReactNode; - readonly onOpenInMainView: () => void; - readonly onClose: () => void; -}) { - const gt = useGT(); - return ( -
    -

    {props.title}

    - {props.children} - - - - - } - /> - - Open in main view - - - -
    - ); -} - -/** - * A side chat or a subagent as a tab: the shared header over the thread's own chat. The chat - * decides its bottom, the composer or the read-only bar, as it does on the main screen. + * A side chat or a subagent as a tab: the thread's own chat, which decides its bottom, the + * composer or the read-only bar, as it does on the main screen. The tab names it and closes it, + * so only a side chat, which has actions of its own, gets a header. */ export default function SideThreadPane(props: { /** The thread whose panel shows the tab. */ @@ -102,7 +50,6 @@ export default function SideThreadPane(props: { const { parentRef, surface } = props; const { threadId } = surface; const gt = useGT(); - const openInMainView = useOpenSurfaceInMainView(parentRef); const threadRef = scopeThreadRef(parentRef.environmentId, threadId); // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- registers the parent panel as host in the panel store useEffect( @@ -197,45 +144,47 @@ export default function SideThreadPane(props: { data-testid="side-thread-pane" className="flex h-full min-h-0 flex-col" > - openInMainView(surface)} - onClose={props.onClose} - > - {isSideChat ? ( - <> - - - Add to chat - - } - /> - - {canAddToChat - ? gt("Adds this side chat to the main thread's next message.") - : gt("Available after the first message.")} - - - - - ) : null} - + {isSideChat ? ( +
    +

    {title}

    + + + Add to chat + + } + /> + + {canAddToChat + ? gt("Adds this side chat to the main thread's next message.") + : gt("Available after the first message.")} + + + + +
    + ) : null} {renderState === "missing" ? (

    {isSideChat ? ( diff --git a/apps/web/src/hooks/useOpenSurfaceInMainView.ts b/apps/web/src/hooks/useOpenSurfaceInMainView.ts index c0e06d7873dfd..293569b3c4dd1 100644 --- a/apps/web/src/hooks/useOpenSurfaceInMainView.ts +++ b/apps/web/src/hooks/useOpenSurfaceInMainView.ts @@ -17,7 +17,7 @@ export function useOpenSurfaceInMainView(panelRef: ScopedThreadRef | null) { useRightPanelStore.getState().closeSurface(panelRef, surface.id); if (surface.kind === "linked-thread") { void navigate({ - to: "/linked/$viaEnvironmentId/$environmentId/$threadId", + to: "/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId", params: linkedThreadRouteParams(surface), }); return; diff --git a/apps/web/src/i18n/translations/de.json b/apps/web/src/i18n/translations/de.json index 0f3185ce7f9bb..f49ef838a02e0 100644 --- a/apps/web/src/i18n/translations/de.json +++ b/apps/web/src/i18n/translations/de.json @@ -3966,15 +3966,12 @@ "5e7157db126f1641": "Issues nicht verfügbar", "42ade0e14ff6af94": "Aktualisiere den T3-Code-Server dieser Umgebung, um Issues zu durchsuchen.", "993dcd04611f9571": "Sicher speichern", - "6a116665c8d9ad75": "Nebenchat schließen", - "c868f340c06cddf0": "Thread schließen", - "f0ef94e00bcc0a92": "Subagent schließen", "ccbe48efc8e30c52": "Nebenchat „{title}“ löschen?", "3a859b690f41e899": "Dadurch wird sein Gesprächsverlauf dauerhaft gelöscht.", "980f2db81b9eb4b5": "Der Nebenchat konnte nicht gelöscht werden", "c1844a6d9443df20": "Fügt diesen Nebenchat der nächsten Nachricht des Haupt-Threads hinzu.", "e42d6bd2de470521": "Nebenchat löschen", - "750af44c1cdd4667": "In Hauptansicht öffnen", + "6a116665c8d9ad75": "Nebenchat schließen", "a5e57fdfde50aade": "Zum Chat hinzufügen", "492a438bf9dbd45d": "Dieser Nebenchat wurde gelöscht.", "255a537ab23ddd2d": "Dieser Thread ist nicht mehr verfügbar.", diff --git a/apps/web/src/i18n/translations/en.json b/apps/web/src/i18n/translations/en.json index d180012e24866..ba8a96f2b96ae 100644 --- a/apps/web/src/i18n/translations/en.json +++ b/apps/web/src/i18n/translations/en.json @@ -3964,15 +3964,12 @@ "5e7157db126f1641": "Issues unavailable", "42ade0e14ff6af94": "Update this environment's T3 Code server to browse issues.", "993dcd04611f9571": "Save securely", - "6a116665c8d9ad75": "Close side chat", - "c868f340c06cddf0": "Close thread", - "f0ef94e00bcc0a92": "Close subagent", "ccbe48efc8e30c52": "Delete side chat \"{title}\"?", "3a859b690f41e899": "This permanently clears its conversation history.", "980f2db81b9eb4b5": "Could not delete the side chat", "c1844a6d9443df20": "Adds this side chat to the main thread's next message.", "e42d6bd2de470521": "Delete side chat", - "750af44c1cdd4667": "Open in main view", + "6a116665c8d9ad75": "Close side chat", "a5e57fdfde50aade": "Add to chat", "492a438bf9dbd45d": "This side chat was deleted.", "255a537ab23ddd2d": "This thread is no longer available.", diff --git a/apps/web/src/i18n/translations/es.json b/apps/web/src/i18n/translations/es.json index b47e1dc6e2ce6..2dc62e4340467 100644 --- a/apps/web/src/i18n/translations/es.json +++ b/apps/web/src/i18n/translations/es.json @@ -3962,15 +3962,12 @@ "5e7157db126f1641": "Issues no disponibles", "42ade0e14ff6af94": "Actualiza el servidor de T3 Code de este entorno para explorar issues.", "993dcd04611f9571": "Guardar de forma segura", - "6a116665c8d9ad75": "Cerrar chat lateral", - "c868f340c06cddf0": "Cerrar hilo", - "f0ef94e00bcc0a92": "Cerrar subagente", "ccbe48efc8e30c52": "¿Eliminar el chat lateral \"{title}\"?", "3a859b690f41e899": "Esto borra de forma permanente su historial de conversación.", "980f2db81b9eb4b5": "No se pudo eliminar el chat lateral", "c1844a6d9443df20": "Añade este chat lateral al próximo mensaje del hilo principal.", "e42d6bd2de470521": "Eliminar chat lateral", - "750af44c1cdd4667": "Abrir en la vista principal", + "6a116665c8d9ad75": "Cerrar chat lateral", "a5e57fdfde50aade": "Añadir al chat", "492a438bf9dbd45d": "Este chat lateral se eliminó.", "255a537ab23ddd2d": "Este hilo ya no está disponible.", diff --git a/apps/web/src/i18n/translations/fr.json b/apps/web/src/i18n/translations/fr.json index 9c4f8d60b2ba0..5b6f8fe3684fe 100644 --- a/apps/web/src/i18n/translations/fr.json +++ b/apps/web/src/i18n/translations/fr.json @@ -3963,15 +3963,12 @@ "5e7157db126f1641": "Tickets indisponibles", "42ade0e14ff6af94": "Mettez à jour le serveur T3 Code de cet environnement pour parcourir les tickets.", "993dcd04611f9571": "Enregistrer de façon sécurisée", - "6a116665c8d9ad75": "Fermer la discussion annexe", - "c868f340c06cddf0": "Fermer le fil", - "f0ef94e00bcc0a92": "Fermer le sous-agent", "ccbe48efc8e30c52": "Supprimer la discussion annexe « {title} » ?", "3a859b690f41e899": "Cela efface définitivement son historique de conversation.", "980f2db81b9eb4b5": "Impossible de supprimer la discussion annexe", "c1844a6d9443df20": "Ajoute cette discussion annexe au prochain message du fil principal.", "e42d6bd2de470521": "Supprimer la discussion annexe", - "750af44c1cdd4667": "Ouvrir dans la vue principale", + "6a116665c8d9ad75": "Fermer la discussion annexe", "a5e57fdfde50aade": "Ajouter à la discussion", "492a438bf9dbd45d": "Cette discussion annexe a été supprimée.", "255a537ab23ddd2d": "Ce fil n’est plus disponible.", diff --git a/apps/web/src/i18n/translations/ja.json b/apps/web/src/i18n/translations/ja.json index a1e35e2610715..925d388aaac83 100644 --- a/apps/web/src/i18n/translations/ja.json +++ b/apps/web/src/i18n/translations/ja.json @@ -3953,15 +3953,12 @@ "5e7157db126f1641": "Issue を利用できません", "42ade0e14ff6af94": "Issue を参照するには、この環境の T3 Code サーバーを更新してください。", "993dcd04611f9571": "安全に保存", - "6a116665c8d9ad75": "サイドチャットを閉じる", - "c868f340c06cddf0": "スレッドを閉じる", - "f0ef94e00bcc0a92": "サブエージェントを閉じる", "ccbe48efc8e30c52": "サイドチャット「{title}」を削除しますか?", "3a859b690f41e899": "会話履歴が完全に消去されます。", "980f2db81b9eb4b5": "サイドチャットを削除できませんでした", "c1844a6d9443df20": "このサイドチャットをメインスレッドの次のメッセージに追加します。", "e42d6bd2de470521": "サイドチャットを削除", - "750af44c1cdd4667": "メインビューで開く", + "6a116665c8d9ad75": "サイドチャットを閉じる", "a5e57fdfde50aade": "チャットに追加", "492a438bf9dbd45d": "このサイドチャットは削除されました。", "255a537ab23ddd2d": "このスレッドは利用できなくなりました。", diff --git a/apps/web/src/i18n/translations/ko.json b/apps/web/src/i18n/translations/ko.json index daccb6affe5a8..f3db2a16565c7 100644 --- a/apps/web/src/i18n/translations/ko.json +++ b/apps/web/src/i18n/translations/ko.json @@ -3951,15 +3951,12 @@ "5e7157db126f1641": "이슈를 사용할 수 없음", "42ade0e14ff6af94": "이슈를 탐색하려면 이 환경의 T3 Code 서버를 업데이트하세요.", "993dcd04611f9571": "안전하게 저장", - "6a116665c8d9ad75": "사이드 채팅 닫기", - "c868f340c06cddf0": "스레드 닫기", - "f0ef94e00bcc0a92": "서브에이전트 닫기", "ccbe48efc8e30c52": "사이드 채팅 \"{title}\"을(를) 삭제할까요?", "3a859b690f41e899": "대화 기록이 영구적으로 삭제됩니다.", "980f2db81b9eb4b5": "사이드 채팅을 삭제할 수 없습니다", "c1844a6d9443df20": "이 사이드 채팅을 기본 스레드의 다음 메시지에 추가합니다.", "e42d6bd2de470521": "사이드 채팅 삭제", - "750af44c1cdd4667": "메인 보기에서 열기", + "6a116665c8d9ad75": "사이드 채팅 닫기", "a5e57fdfde50aade": "채팅에 추가", "492a438bf9dbd45d": "이 사이드 채팅은 삭제되었습니다.", "255a537ab23ddd2d": "이 스레드를 더 이상 사용할 수 없습니다.", diff --git a/apps/web/src/i18n/translations/pt-BR.json b/apps/web/src/i18n/translations/pt-BR.json index 052f352a28f09..13dbeaf291427 100644 --- a/apps/web/src/i18n/translations/pt-BR.json +++ b/apps/web/src/i18n/translations/pt-BR.json @@ -3963,15 +3963,12 @@ "5e7157db126f1641": "Issues indisponíveis", "42ade0e14ff6af94": "Atualize o servidor do T3 Code deste ambiente para navegar pelas issues.", "993dcd04611f9571": "Salvar com segurança", - "6a116665c8d9ad75": "Fechar chat paralelo", - "c868f340c06cddf0": "Fechar thread", - "f0ef94e00bcc0a92": "Fechar subagente", "ccbe48efc8e30c52": "Excluir o chat paralelo \"{title}\"?", "3a859b690f41e899": "Isso apaga permanentemente o histórico dele.", "980f2db81b9eb4b5": "Não foi possível excluir o chat paralelo", "c1844a6d9443df20": "Adiciona este chat paralelo à próxima mensagem da thread principal.", "e42d6bd2de470521": "Excluir chat paralelo", - "750af44c1cdd4667": "Abrir na visualização principal", + "6a116665c8d9ad75": "Fechar chat paralelo", "a5e57fdfde50aade": "Adicionar ao chat", "492a438bf9dbd45d": "Este chat paralelo foi excluído.", "255a537ab23ddd2d": "Esta thread não está mais disponível.", diff --git a/apps/web/src/i18n/translations/ru.json b/apps/web/src/i18n/translations/ru.json index 7f91c9be0cc94..fa60799c89a78 100644 --- a/apps/web/src/i18n/translations/ru.json +++ b/apps/web/src/i18n/translations/ru.json @@ -3963,15 +3963,12 @@ "5e7157db126f1641": "Issue недоступны", "42ade0e14ff6af94": "Обновите сервер T3 Code в этом окружении, чтобы просматривать issue.", "993dcd04611f9571": "Сохранить безопасно", - "6a116665c8d9ad75": "Закрыть боковой чат", - "c868f340c06cddf0": "Закрыть тред", - "f0ef94e00bcc0a92": "Закрыть субагента", "ccbe48efc8e30c52": "Удалить боковой чат «{title}»?", "3a859b690f41e899": "Его история беседы будет удалена безвозвратно.", "980f2db81b9eb4b5": "Не удалось удалить боковой чат", "c1844a6d9443df20": "Добавляет этот боковой чат к следующему сообщению основного треда.", "e42d6bd2de470521": "Удалить боковой чат", - "750af44c1cdd4667": "Открыть в основном окне", + "6a116665c8d9ad75": "Закрыть боковой чат", "a5e57fdfde50aade": "Добавить в чат", "492a438bf9dbd45d": "Этот боковой чат удалён.", "255a537ab23ddd2d": "Этот тред больше недоступен.", diff --git a/apps/web/src/i18n/translations/sv.json b/apps/web/src/i18n/translations/sv.json index 809732730e8c4..7cb5b4f31ead7 100644 --- a/apps/web/src/i18n/translations/sv.json +++ b/apps/web/src/i18n/translations/sv.json @@ -3963,15 +3963,12 @@ "5e7157db126f1641": "Ärenden är inte tillgängliga", "42ade0e14ff6af94": "Uppdatera T3 Code-servern i den här miljön för att bläddra bland ärenden.", "993dcd04611f9571": "Spara säkert", - "6a116665c8d9ad75": "Stäng sidochatt", - "c868f340c06cddf0": "Stäng tråd", - "f0ef94e00bcc0a92": "Stäng subagent", "ccbe48efc8e30c52": "Ta bort sidochatten ”{title}”?", "3a859b690f41e899": "Det här rensar dess konversationshistorik permanent.", "980f2db81b9eb4b5": "Kunde inte ta bort sidochatten", "c1844a6d9443df20": "Lägger till den här sidochatten i huvudtrådens nästa meddelande.", "e42d6bd2de470521": "Ta bort sidochatt", - "750af44c1cdd4667": "Öppna i huvudvyn", + "6a116665c8d9ad75": "Stäng sidochatt", "a5e57fdfde50aade": "Lägg till i chatten", "492a438bf9dbd45d": "Den här sidochatten togs bort.", "255a537ab23ddd2d": "Den här tråden är inte längre tillgänglig.", diff --git a/apps/web/src/i18n/translations/zh.json b/apps/web/src/i18n/translations/zh.json index 007cf2777b24b..264cdc880110f 100644 --- a/apps/web/src/i18n/translations/zh.json +++ b/apps/web/src/i18n/translations/zh.json @@ -3968,15 +3968,12 @@ "5e7157db126f1641": "issue 不可用", "42ade0e14ff6af94": "请更新此环境的 T3 Code 服务器以浏览 issue。", "993dcd04611f9571": "安全保存", - "6a116665c8d9ad75": "关闭侧聊", - "c868f340c06cddf0": "关闭会话", - "f0ef94e00bcc0a92": "关闭子智能体", "ccbe48efc8e30c52": "删除侧聊“{title}”?", "3a859b690f41e899": "这会永久清除它的对话记录。", "980f2db81b9eb4b5": "无法删除侧聊", "c1844a6d9443df20": "把这段侧聊附加到主会话的下一条消息中。", "e42d6bd2de470521": "删除侧聊", - "750af44c1cdd4667": "在主视图中打开", + "6a116665c8d9ad75": "关闭侧聊", "a5e57fdfde50aade": "添加到对话", "492a438bf9dbd45d": "这段侧聊已删除。", "255a537ab23ddd2d": "这个会话已不可用。", diff --git a/apps/web/src/lib/sideChatPane.ts b/apps/web/src/lib/sideChatPane.ts index 72343a41ca020..990f89e815c7e 100644 --- a/apps/web/src/lib/sideChatPane.ts +++ b/apps/web/src/lib/sideChatPane.ts @@ -107,7 +107,7 @@ export function openLinkedThreadRead(input: { return; } void input.navigate({ - to: "/linked/$viaEnvironmentId/$environmentId/$threadId", + to: "/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId", params: linkedThreadRouteParams(target), }); } diff --git a/apps/web/src/linkedThreadSurface.ts b/apps/web/src/linkedThreadSurface.ts index 5736e2ab38006..cc1202c97d2e2 100644 --- a/apps/web/src/linkedThreadSurface.ts +++ b/apps/web/src/linkedThreadSurface.ts @@ -60,7 +60,7 @@ export function linkedThreadRouteParams( ) { return { viaEnvironmentId: target.viaEnvironmentId, - environmentId: target.environmentId, - threadId: target.threadId, + linkedEnvironmentId: target.environmentId, + linkedThreadId: target.threadId, }; } diff --git a/apps/web/src/routeTree.gen.ts b/apps/web/src/routeTree.gen.ts index f5d7e53fb4f74..2d2e74ab58ef2 100644 --- a/apps/web/src/routeTree.gen.ts +++ b/apps/web/src/routeTree.gen.ts @@ -53,7 +53,7 @@ import { Route as ChatSettingsAccessRouteImport } from './routes/_chat.settings. import { Route as ChatSettingsAboutRouteImport } from './routes/_chat.settings.about' import { Route as ChatDraftDraftIdRouteImport } from './routes/_chat.draft.$draftId' import { Route as ChatEnvironmentIdThreadIdRouteImport } from './routes/_chat.$environmentId.$threadId' -import { Route as ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRouteImport } from './routes/_chat.linked.$viaEnvironmentId.$environmentId.$threadId' +import { Route as ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRouteImport } from './routes/_chat.linked.$viaEnvironmentId.$linkedEnvironmentId.$linkedThreadId' const WelcomeRoute = WelcomeRouteImport.update({ id: '/welcome', @@ -280,12 +280,14 @@ const ChatEnvironmentIdThreadIdRoute = path: '/$environmentId/$threadId', getParentRoute: () => ChatRoute, } as any) -const ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRoute = - ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRouteImport.update({ - id: '/linked/$viaEnvironmentId/$environmentId/$threadId', - path: '/linked/$viaEnvironmentId/$environmentId/$threadId', - getParentRoute: () => ChatRoute, - } as any) +const ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRoute = + ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRouteImport.update( + { + id: '/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId', + path: '/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId', + getParentRoute: () => ChatRoute, + } as any, + ) export interface FileRoutesByFullPath { '/': typeof ChatIndexRoute @@ -331,7 +333,7 @@ export interface FileRoutesByFullPath { '/settings/voice': typeof ChatSettingsVoiceRoute '/settings/worktrees': typeof ChatSettingsWorktreesRoute '/threads/$environmentId/$threadId': typeof ThreadsEnvironmentIdThreadIdRoute - '/linked/$viaEnvironmentId/$environmentId/$threadId': typeof ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRoute + '/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId': typeof ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRoute } export interface FileRoutesByTo { '/approve-agent': typeof ApproveAgentRoute @@ -377,7 +379,7 @@ export interface FileRoutesByTo { '/settings/voice': typeof ChatSettingsVoiceRoute '/settings/worktrees': typeof ChatSettingsWorktreesRoute '/threads/$environmentId/$threadId': typeof ThreadsEnvironmentIdThreadIdRoute - '/linked/$viaEnvironmentId/$environmentId/$threadId': typeof ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRoute + '/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId': typeof ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRoute } export interface FileRoutesById { __root__: typeof rootRouteImport @@ -425,7 +427,7 @@ export interface FileRoutesById { '/_chat/settings/voice': typeof ChatSettingsVoiceRoute '/_chat/settings/worktrees': typeof ChatSettingsWorktreesRoute '/threads/$environmentId/$threadId': typeof ThreadsEnvironmentIdThreadIdRoute - '/_chat/linked/$viaEnvironmentId/$environmentId/$threadId': typeof ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRoute + '/_chat/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId': typeof ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRoute } export interface FileRouteTypes { fileRoutesByFullPath: FileRoutesByFullPath @@ -473,7 +475,7 @@ export interface FileRouteTypes { | '/settings/voice' | '/settings/worktrees' | '/threads/$environmentId/$threadId' - | '/linked/$viaEnvironmentId/$environmentId/$threadId' + | '/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId' fileRoutesByTo: FileRoutesByTo to: | '/approve-agent' @@ -519,7 +521,7 @@ export interface FileRouteTypes { | '/settings/voice' | '/settings/worktrees' | '/threads/$environmentId/$threadId' - | '/linked/$viaEnvironmentId/$environmentId/$threadId' + | '/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId' id: | '__root__' | '/_chat' @@ -566,7 +568,7 @@ export interface FileRouteTypes { | '/_chat/settings/voice' | '/_chat/settings/worktrees' | '/threads/$environmentId/$threadId' - | '/_chat/linked/$viaEnvironmentId/$environmentId/$threadId' + | '/_chat/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId' fileRoutesById: FileRoutesById } export interface RootRouteChildren { @@ -891,11 +893,11 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof ChatEnvironmentIdThreadIdRouteImport parentRoute: typeof ChatRoute } - '/_chat/linked/$viaEnvironmentId/$environmentId/$threadId': { - id: '/_chat/linked/$viaEnvironmentId/$environmentId/$threadId' - path: '/linked/$viaEnvironmentId/$environmentId/$threadId' - fullPath: '/linked/$viaEnvironmentId/$environmentId/$threadId' - preLoaderRoute: typeof ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRouteImport + '/_chat/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId': { + id: '/_chat/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId' + path: '/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId' + fullPath: '/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId' + preLoaderRoute: typeof ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRouteImport parentRoute: typeof ChatRoute } } @@ -974,7 +976,7 @@ interface ChatRouteChildren { ChatIndexRoute: typeof ChatIndexRoute ChatEnvironmentIdThreadIdRoute: typeof ChatEnvironmentIdThreadIdRoute ChatDraftDraftIdRoute: typeof ChatDraftDraftIdRoute - ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRoute: typeof ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRoute + ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRoute: typeof ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRoute } const ChatRouteChildren: ChatRouteChildren = { @@ -986,8 +988,8 @@ const ChatRouteChildren: ChatRouteChildren = { ChatIndexRoute: ChatIndexRoute, ChatEnvironmentIdThreadIdRoute: ChatEnvironmentIdThreadIdRoute, ChatDraftDraftIdRoute: ChatDraftDraftIdRoute, - ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRoute: - ChatLinkedViaEnvironmentIdEnvironmentIdThreadIdRoute, + ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRoute: + ChatLinkedViaEnvironmentIdLinkedEnvironmentIdLinkedThreadIdRoute, } const ChatRouteWithChildren = ChatRoute._addFileChildren(ChatRouteChildren) diff --git a/apps/web/src/routes/_chat.linked.$viaEnvironmentId.$environmentId.$threadId.tsx b/apps/web/src/routes/_chat.linked.$viaEnvironmentId.$linkedEnvironmentId.$linkedThreadId.tsx similarity index 59% rename from apps/web/src/routes/_chat.linked.$viaEnvironmentId.$environmentId.$threadId.tsx rename to apps/web/src/routes/_chat.linked.$viaEnvironmentId.$linkedEnvironmentId.$linkedThreadId.tsx index f7a6cc0dc8a8f..85926925cd3d4 100644 --- a/apps/web/src/routes/_chat.linked.$viaEnvironmentId.$environmentId.$threadId.tsx +++ b/apps/web/src/routes/_chat.linked.$viaEnvironmentId.$linkedEnvironmentId.$linkedThreadId.tsx @@ -4,14 +4,17 @@ import { createFileRoute } from "@tanstack/react-router"; import { LinkedThreadPage } from "../components/chat/LinkedThreadPage"; // A thread on a linked environment this client is not connected to, read through `viaEnvironmentId`. -export const Route = createFileRoute("/_chat/linked/$viaEnvironmentId/$environmentId/$threadId")({ +// Its params are not named `environmentId` and `threadId`: those mean a thread this client can open. +export const Route = createFileRoute( + "/_chat/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId", +)({ component: function LinkedThreadRoute() { const params = Route.useParams(); return ( ); }, diff --git a/apps/web/src/threadRoutes.test.ts b/apps/web/src/threadRoutes.test.ts index 9b321b5d43cbc..c4fef5897c5f4 100644 --- a/apps/web/src/threadRoutes.test.ts +++ b/apps/web/src/threadRoutes.test.ts @@ -10,6 +10,7 @@ import { EMPTY_ENVIRONMENT_THREAD_STATE } from "@t3tools/client-runtime/state/th import { ThreadId } from "@t3tools/contracts"; import * as DateTime from "effect/DateTime"; import * as Option from "effect/Option"; +import { linkedThreadRouteParams } from "./linkedThreadSurface"; import { makeThreadProjectionFixture } from "./test-fixtures"; import { @@ -70,6 +71,17 @@ describe("threadRoutes", () => { expect(isThreadRoutePathname(router.state.location.pathname, ref)).toBe(false); }); + it("does not take a linked environment's thread route for a thread this client can open", () => { + // The layout reads every match's params untyped, as here. + const params: Record = linkedThreadRouteParams({ + viaEnvironmentId: "env-1" as never, + environmentId: "env-2" as never, + threadId: ThreadId.make("thread-there"), + }); + + expect(resolveThreadRouteTarget(params)).toBeNull(); + }); + it("resolves the backing thread while a draft route is being promoted", () => { const target = resolveThreadRouteTarget({ draftId: "draft-1" }); From 9374fbc9062255b069a5b6db28b5926aac77bde5 Mon Sep 17 00:00:00 2001 From: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Date: Fri, 20 Nov 2026 12:04:36 -0800 Subject: [PATCH 4/4] fix: side thread review findings Saved panels migrate their side chat tabs, a read-only tab takes focus, an embedded thread in another checkout does not offer Run in its host's terminal, and a connect that resolves after the user moved on navigates nowhere. Co-Authored-By: Claude Fable 5.2 --- .../features/threads/LinkedThreadSheet.tsx | 12 ++++++++++-- apps/web/src/components/ChatView.tsx | 6 +++++- .../components/chat/useRightPanelActions.ts | 19 +++++++++++++++---- apps/web/src/rightPanelStore.ts | 2 +- apps/web/src/state/linkedThreadView.ts | 9 +++++++-- apps/web/test/fakeEnvironment.ts | 4 ++-- 6 files changed, 40 insertions(+), 12 deletions(-) diff --git a/apps/mobile/src/features/threads/LinkedThreadSheet.tsx b/apps/mobile/src/features/threads/LinkedThreadSheet.tsx index 061aaa8372f4a..0096c9d576a91 100644 --- a/apps/mobile/src/features/threads/LinkedThreadSheet.tsx +++ b/apps/mobile/src/features/threads/LinkedThreadSheet.tsx @@ -17,7 +17,7 @@ import { } from "@t3tools/client-runtime/work-log/item-detail"; import { EnvironmentId, ThreadId } from "@t3tools/contracts"; import { T, useGT, useLocale, useMessages } from "gt-react-native"; -import { useRef, useState, useSyncExternalStore } from "react"; +import { useEffect, useRef, useState, useSyncExternalStore } from "react"; import type * as React from "react"; import { AppState, Pressable, ScrollView, View } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; @@ -290,9 +290,17 @@ export function LinkedThreadView(props: { const connection = useConnectLinkedEnvironment(target); const connectState = connection.state; const openThread = useOpenLinkedThread(); + const shown = useRef(true); + // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- records unmount, so a connect that resolves after the view is gone navigates nowhere + useEffect(() => { + shown.current = true; + return () => { + shown.current = false; + }; + }, []); const connect = async () => { const outcome = await connection.connect(); - if (outcome.type === "unreachable") return; + if (outcome.type === "unreachable" || !shown.current) return; // The read-only view gives way either way: the thread opens where the app is now connected, // or the add-environment screen takes its place. In the inspector the thread replaces it there. if (outcome.type === "connected") { diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 96e2529120600..f0c4543b6c24a 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -461,6 +461,7 @@ export default function ChatView(props: ChatViewProps) { embedded: parentPanel, } = props; const embedded = parentPanel !== undefined; + const panelHostShell = useQuietThreadShell(parentPanel?.hostRef ?? null); const canOperateThread = useEnvironmentScope(environmentId, AuthOrchestrationOperateScope); const canOperateTerminal = useEnvironmentScope(environmentId, AuthTerminalOperateScope); const draftId = routeKind === "draft" ? props.draftId : null; @@ -2898,6 +2899,9 @@ export default function ChatView(props: ChatViewProps) { if (activeThread) setThreadError(activeThread.id, message); }, }); + // An embedded thread's commands run in its host's terminal, which is the host's checkout. + const runsOutsideHostCheckout = + embedded && (activeThread?.worktreePath ?? null) !== (panelHostShell?.worktreePath ?? null); // A maximized panel covers the terminal drawer the command runs in. const runSideChatShellCommandStable = useStableCallback((command: string) => { if (activeThreadRef) useRightPanelStore.getState().setMaximized(activeThreadRef, false); @@ -3528,7 +3532,7 @@ export default function ChatView(props: ChatViewProps) { citationHistory={citationHistory} onCiteAssistantText={citeAssistantTextStable} onReplyToResponse={replyToResponseStable} - {...(activeProject + {...(activeProject && !runsOutsideHostCheckout ? { onRunShellCommand: parentPanel?.runShellCommand ?? runShellCommandStable } : {})} isWorking={isWorking} diff --git a/apps/web/src/components/chat/useRightPanelActions.ts b/apps/web/src/components/chat/useRightPanelActions.ts index 12d348de050b8..6769f93f2e192 100644 --- a/apps/web/src/components/chat/useRightPanelActions.ts +++ b/apps/web/src/components/chat/useRightPanelActions.ts @@ -8,6 +8,9 @@ import { formatFilePathForClipboard } from "@t3tools/client-runtime/media-action import { resolvePathLinkTarget } from "@t3tools/shared/fileLinks"; import { useStableCallback } from "../../hooks/useStableCallback"; import { type ScopedThreadRef, type RunId } from "@t3tools/contracts"; +import { scopeThreadRef } from "@t3tools/client-runtime/environment"; +import { sideThreadComposer, sideThreadKindOf } from "@t3tools/client-runtime/side-thread"; +import { readThreadShell } from "../../state/entities"; import { scopedThreadKey } from "@t3tools/client-runtime/environment"; import { useEffect } from "react"; import { @@ -208,10 +211,18 @@ export function useRightPanelActions(input: RightPanelActionsInput) { focusTerminal(activeThreadRef, surface.activeTerminalId); } if (surface.kind === "thread") { - requestWorkspaceFocus({ - area: "panel", - selector: `[data-side-chat-pane="${CSS.escape(surface.threadId)}"] [data-workspace-area="composer"] [contenteditable="true"]`, - }); + const kind = sideThreadKindOf( + readThreadShell(scopeThreadRef(activeThreadRef.environmentId, surface.threadId)), + ); + // A thread with no composer, or one not known yet, takes focus as any other tab does. + requestWorkspaceFocus( + kind !== null && sideThreadComposer(kind) === "composer" + ? { + area: "panel", + selector: `[data-side-chat-pane="${CSS.escape(surface.threadId)}"] [data-workspace-area="composer"] [contenteditable="true"]`, + } + : { area: "panel" }, + ); } if (surface.kind === "diff" && !diffOpen) { onDiffPanelOpen?.(); diff --git a/apps/web/src/rightPanelStore.ts b/apps/web/src/rightPanelStore.ts index 350820eec07b4..19d08158e23e9 100644 --- a/apps/web/src/rightPanelStore.ts +++ b/apps/web/src/rightPanelStore.ts @@ -130,7 +130,7 @@ export function decodeThreadSurface(surface: object): ThreadSurface | null { } const RIGHT_PANEL_STORAGE_KEY = "t3code:right-panel-state:v2"; -const RIGHT_PANEL_STORAGE_VERSION = 15; +const RIGHT_PANEL_STORAGE_VERSION = 16; export const PULL_REQUESTS_PANEL_REF = scopeThreadRef( EnvironmentId.make("pull-requests-panel"), diff --git a/apps/web/src/state/linkedThreadView.ts b/apps/web/src/state/linkedThreadView.ts index af05128c4ae33..adeb858c23cab 100644 --- a/apps/web/src/state/linkedThreadView.ts +++ b/apps/web/src/state/linkedThreadView.ts @@ -7,7 +7,7 @@ import { resolveLinkedThreadOpen, } from "@t3tools/client-runtime/linked-thread"; import type { EnvironmentId, ScopedThreadRef, ThreadId } from "@t3tools/contracts"; -import { useNavigate } from "@tanstack/react-router"; +import { useNavigate, useRouter } from "@tanstack/react-router"; import { AsyncResult, Atom } from "effect/reactivity"; import type { TurnItemSource } from "../components/chat/timelineRowContext"; @@ -182,6 +182,7 @@ export function useConnectLinkedEnvironment( surface: LinkedThreadSurface, ) { const navigate = useNavigate(); + const router = useRouter(); const setPrefill = useAtomSet(addEnvironmentPrefillAtom); const mayPair = useAtomValue( peerLinkEnvironment.pairClient.permissionAtom(surface.viaEnvironmentId), @@ -201,6 +202,9 @@ export function useConnectLinkedEnvironment( }; const connect = async () => { setState({ phase: "connecting" }); + const startedOn = router.state.location.href; + // Pairing takes a moment; a user who has gone elsewhere since is not moved again. + const stayed = () => router.state.location.href === startedOn; const outcome = await connectLinkedEnvironment({ label: surface.label, requestPairing: async () => { @@ -233,6 +237,7 @@ export function useConnectLinkedEnvironment( setState({ phase: "idle" }); // The thread opens where every thread on a connected environment does, so its tab is done. if (panelRef !== null) useRightPanelStore.getState().closeSurface(panelRef, surface.id); + if (!stayed()) return outcome; void navigate({ to: "/$environmentId/$threadId", params: buildThreadRouteParams(scopeThreadRef(surface.environmentId, surface.threadId)), @@ -247,7 +252,7 @@ export function useConnectLinkedEnvironment( host: outcome.host, }; setState({ phase: "manual", prefill }); - addWithCode(prefill); + if (stayed()) addWithCode(prefill); return outcome; }; return { state, connect, addWithCode }; diff --git a/apps/web/test/fakeEnvironment.ts b/apps/web/test/fakeEnvironment.ts index 5a15cdeb8eef7..71e8875bb56db 100644 --- a/apps/web/test/fakeEnvironment.ts +++ b/apps/web/test/fakeEnvironment.ts @@ -382,8 +382,8 @@ function projectionOf(thread: FakeThread): OrchestrationV2ThreadProjection { activeProviderThreadId: shell.activeProviderThreadId, lineage: shell.lineage, forkedFrom: null, - createdBy: "user", - creationSource: "web", + createdBy: shell.createdBy, + creationSource: shell.creationSource, createdAt: AT, updatedAt: AT, archivedAt: null,