From 07ba210025ac5475c313a394e49958774120c2ef Mon Sep 17 00:00:00 2001 From: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Date: Fri, 27 Nov 2026 22:54:53 -0800 Subject: [PATCH 01/14] feat(web,mobile): continue a thread on another machine from its menu A thread's menu and the command palette offer "Continue on another machine" where the thread's environment offers links and the client may operate threads. It opens a picker of the linked machines, each with the reason it cannot take the thread when there is one. The thread then shows its move above the composer: waiting for the turn to end (with a way to keep it here), under way, moved (with a way to open it there, over the link when the client is not connected to that machine), or failed (with a way to try again). Starting and cancelling a move are guarded client commands that need the operate grant. Co-Authored-By: Claude Fable 5.2 --- apps/mobile/src/Stack.tsx | 5 + .../src/features/keyboard/CommandPalette.tsx | 19 ++ .../layout/workspace-overlay-routes.ts | 1 + .../features/threads/ThreadDetailScreen.tsx | 16 +- .../features/threads/ThreadHandoffCard.tsx | 136 ++++++++++++++ .../features/threads/ThreadHandoffSheet.tsx | 138 ++++++++++++++ .../features/threads/thread-list-v2-items.tsx | 23 +++ apps/mobile/src/i18n/translations/de.json | 15 ++ apps/mobile/src/i18n/translations/en.json | 15 ++ apps/mobile/src/i18n/translations/es.json | 15 ++ apps/mobile/src/i18n/translations/fr.json | 15 ++ apps/mobile/src/i18n/translations/ja.json | 15 ++ apps/mobile/src/i18n/translations/ko.json | 15 ++ apps/mobile/src/i18n/translations/pt-BR.json | 15 ++ apps/mobile/src/i18n/translations/ru.json | 15 ++ apps/mobile/src/i18n/translations/sv.json | 15 ++ apps/mobile/src/i18n/translations/zh.json | 15 ++ apps/mobile/src/state/threadHandoff.ts | 20 +++ apps/web/src/components/ChatView.tsx | 31 ++-- .../CommandPaletteThreadActions.tsx | 2 + apps/web/src/components/Sidebar.tsx | 8 + .../components/chat/ThreadHandoffBanner.tsx | 168 +++++++++++++++++ .../components/chat/ThreadHandoffDialog.tsx | 170 ++++++++++++++++++ .../components/threadActionMenu.logic.test.ts | 4 +- .../src/components/threadActionMenu.logic.ts | 14 ++ apps/web/src/contextMenuFallback.ts | 7 + .../web/src/hooks/useThreadActionMenu.test.ts | 4 + apps/web/src/hooks/useThreadActionMenu.ts | 7 + apps/web/src/i18n/translations/de.json | 21 +++ apps/web/src/i18n/translations/en.json | 21 +++ apps/web/src/i18n/translations/es.json | 21 +++ apps/web/src/i18n/translations/fr.json | 21 +++ apps/web/src/i18n/translations/ja.json | 21 +++ apps/web/src/i18n/translations/ko.json | 21 +++ apps/web/src/i18n/translations/pt-BR.json | 21 +++ apps/web/src/i18n/translations/ru.json | 21 +++ apps/web/src/i18n/translations/sv.json | 21 +++ apps/web/src/i18n/translations/zh.json | 21 +++ apps/web/src/routes/__root.tsx | 2 + apps/web/src/state/threadHandoff.ts | 43 +++++ docs/user/remote-access.md | 6 +- .../src/state/commandPermissions.test.ts | 8 +- packages/client-runtime/src/state/models.ts | 3 + .../client-runtime/src/state/peerLinks.ts | 44 +++++ .../contracts/src/clientRpcPermissions.ts | 3 + 45 files changed, 1225 insertions(+), 17 deletions(-) create mode 100644 apps/mobile/src/features/threads/ThreadHandoffCard.tsx create mode 100644 apps/mobile/src/features/threads/ThreadHandoffSheet.tsx create mode 100644 apps/mobile/src/state/threadHandoff.ts create mode 100644 apps/web/src/components/chat/ThreadHandoffBanner.tsx create mode 100644 apps/web/src/components/chat/ThreadHandoffDialog.tsx create mode 100644 apps/web/src/state/threadHandoff.ts diff --git a/apps/mobile/src/Stack.tsx b/apps/mobile/src/Stack.tsx index 2868abf3d885d..be9ff3a0f0820 100644 --- a/apps/mobile/src/Stack.tsx +++ b/apps/mobile/src/Stack.tsx @@ -72,6 +72,7 @@ import { ThreadPullRequestsSheet } from "./features/threads/ThreadPullRequestsSh import { ThreadAgentsSheet } from "./features/threads/ThreadAgentsSheet"; import { LinkedThreadSheet } from "./features/threads/LinkedThreadSheet"; import { ThreadGuestShareSheet } from "./features/threads/ThreadGuestShareSheet"; +import { ThreadHandoffSheet } from "./features/threads/ThreadHandoffSheet"; import { ThreadBackgroundWorkSheet } from "./features/threads/ThreadBackgroundWorkSheet"; import { ThreadQueueSheet } from "./features/threads/ThreadQueueControl"; import { @@ -825,6 +826,10 @@ const RootStackConfig = createWorkspaceStackNavigator({ screen: ThreadGuestShareSheet, options: sheetRoute({ detent: 0.5 }), }), + ThreadHandoff: createNativeStackScreen({ + screen: ThreadHandoffSheet, + options: sheetRoute({ detent: 0.5, androidMaxDetent: 0.9 }), + }), GitOverview: createNativeStackScreen({ screen: GitOverviewSheet, linking: `${THREAD_LINKING_PREFIX}/git`, diff --git a/apps/mobile/src/features/keyboard/CommandPalette.tsx b/apps/mobile/src/features/keyboard/CommandPalette.tsx index df8e5fc93acc0..8da638f2fc0bd 100644 --- a/apps/mobile/src/features/keyboard/CommandPalette.tsx +++ b/apps/mobile/src/features/keyboard/CommandPalette.tsx @@ -55,6 +55,9 @@ import { import { useThreadSearch } from "../../state/queries"; import { requestThreadMessageJump } from "../threads/threadMessageJump"; import { useCanShareWithGuest } from "../threads/useCanShareWithGuest"; +import { useCanMoveThreads } from "../../state/threadHandoff"; +import { threadCanStartHandoff } from "@t3tools/client-runtime/state/peerLinks"; +import { threadRuntimeCanArchive } from "@t3tools/client-runtime/state/models"; import { threadEnvironment } from "../../state/threads"; import { useAtomCommand } from "../../state/use-atom-command"; import { serverEnvironment } from "../../state/server"; @@ -294,6 +297,7 @@ export function CommandPalette(props: { triageEnvironmentId !== null && serverConfigs.get(triageEnvironmentId)?.environment.capabilities.triage === true; const canShareWithGuest = useCanShareWithGuest(activeThreadRef?.environmentId ?? null); + const canMoveThreads = useCanMoveThreads(activeThreadRef?.environmentId ?? null); const contentMatchByKey = new Map( search.matches .filter((match) => match.source === "user" || match.source === "assistant") @@ -424,6 +428,20 @@ export function CommandPalette(props: { run: () => navigation.navigate("ThreadGuestShare", activeThreadRef), }); } + if ( + canMoveThreads && + activeThread != null && + threadCanStartHandoff(activeThread.handoff) && + threadRuntimeCanArchive(activeThread.runtime) + ) { + actions.push({ + key: "continueElsewhere", + kind: "action", + title: gt("Continue on another machine"), + searchTerms: ["continue", "move", "hand off", "handoff", "machine", "environment"], + run: () => navigation.navigate("ThreadHandoff", activeThreadRef), + }); + } } const projectItems: CommandPaletteItem[] = sidebarOrderedProjects .filter((project) => project.archivedAt == null) @@ -500,6 +518,7 @@ export function CommandPalette(props: { environments.length, canTriage, canShareWithGuest, + canMoveThreads, navigation, projects, sidebarOrderedProjects, diff --git a/apps/mobile/src/features/layout/workspace-overlay-routes.ts b/apps/mobile/src/features/layout/workspace-overlay-routes.ts index c4ebbb03a6654..671e4a6dc5b4a 100644 --- a/apps/mobile/src/features/layout/workspace-overlay-routes.ts +++ b/apps/mobile/src/features/layout/workspace-overlay-routes.ts @@ -31,6 +31,7 @@ const LISTED_OVERLAY_ROUTES: ReadonlySet = new Set([ "ThreadAgents", "ThreadBackgroundWork", "ThreadGuestShare", + "ThreadHandoff", "ThreadPullRequests", "ThreadQueue", "ThreadReviewComment", diff --git a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx b/apps/mobile/src/features/threads/ThreadDetailScreen.tsx index 6830467180180..8705d65fadac1 100644 --- a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx +++ b/apps/mobile/src/features/threads/ThreadDetailScreen.tsx @@ -16,6 +16,8 @@ import { parseThreadKey, threadKey } from "@t3tools/client-runtime/state/entitie import { createThreadVisitTracker } from "@t3tools/client-runtime/state/thread-visits"; import { useChildThreadInputs, useThreadReportedModelSelection } from "../../state/entities"; import { UsageLimitRecoveryCard } from "./UsageLimitRecoveryCard"; +import { threadHandoffClosesComposer } from "@t3tools/client-runtime/state/peerLinks"; +import { ThreadHandoffCard } from "./ThreadHandoffCard"; import { useFocusEffect, useIsFocused, useNavigation } from "@react-navigation/native"; import { useAppActive } from "../../lib/appState"; import { @@ -1008,7 +1010,9 @@ function ThreadDetailBody( const activeUserInputRequestId = props.activePendingUserInput?.requestId ?? null; const questionInFlow = Platform.OS === "android" && activeUserInputRequestId !== null; const composerSlotHidden = - activeUserInputRequestId !== null || props.creationState?.kind === "failed"; + activeUserInputRequestId !== null || + props.creationState?.kind === "failed" || + threadHandoffClosesComposer(props.selectedThread.handoff); const pendingMessageEditBlocked = queuedRunEditBlockedReason( { openQuestionCount: activeUserInputRequestId === null ? 0 : 1 }, @@ -1745,6 +1749,16 @@ function ThreadDetailBody( /> ) : null} + + + (null); + const handoff = thread.handoff; + if (handoff === null || (handoff.state === "failed" && dismissed === handoff.handoffId)) { + return null; + } + const machine = handoff.label; + + const keepHere = async () => { + setCancelling(true); + const result = await cancel({ + environmentId: thread.environmentId, + input: { threadId: thread.id }, + }); + setCancelling(false); + if (result._tag !== "Failure" || isAtomCommandInterrupted(result)) return; + const failure = squashAtomCommandFailure(result); + Dialog.alert( + gt("Could not cancel the move"), + failure instanceof Error ? failure.message : gt("Try again."), + ); + }; + + const openThere = () => { + if (handoff.state !== "departed") return; + if (presentationById.get(handoff.environmentId)?.connection.phase === "connected") { + openThread({ environmentId: handoff.environmentId, threadId: handoff.threadId }); + return; + } + // Without a connection to that machine, this one reads the thread over its link. + openLinkedRead( + { environmentId: handoff.environmentId, threadId: handoff.threadId }, + { viaEnvironmentId: thread.environmentId, label: machine }, + thread.title, + ); + }; + + const title = + handoff.state === "pending" + ? gt("Moving to {machine} when this turn ends", { machine }) + : handoff.state === "departing" + ? gt("Moving to {machine}…", { machine }) + : handoff.state === "departed" + ? gt("This thread continues on {machine}", { machine }) + : gt("Could not move to {machine}", { machine }); + const detail = + handoff.state === "pending" + ? gt("Sending a message keeps it here instead.") + : handoff.state === "departed" + ? gt("This copy is read-only.") + : handoff.state === "failed" + ? handoff.lastError + : null; + + return ( + + + {title} + + {detail === null ? null : {detail}} + {handoff.state === "pending" ? ( + + ), + }; + case "departing": + return { id, variant: "info", icon, title: gt("Moving to {machine}…", { machine }) }; + case "departed": { + const there = scopeThreadRef(handoff.environmentId, handoff.threadId); + return { + id, + variant: "info", + icon, + title: gt("This thread continues on {machine}", { machine }), + description: gt("This copy is read-only."), + actions: ( + + ), + }; + } + case "failed": + if (dismissed.has(handoff.handoffId)) return null; + return { + id, + variant: "error", + icon: , + title: gt("Could not move to {machine}", { machine }), + description: handoff.lastError, + ...(canMove + ? { + actions: ( + + ), + } + : {}), + dismissLabel: gt("Dismiss"), + onDismiss: () => + appAtomRegistry.set( + dismissedThreadHandoffsAtom, + new Set([...dismissed, handoff.handoffId]), + ), + }; + } +} diff --git a/apps/web/src/components/chat/ThreadHandoffDialog.tsx b/apps/web/src/components/chat/ThreadHandoffDialog.tsx new file mode 100644 index 0000000000000..a510f8c6376fc --- /dev/null +++ b/apps/web/src/components/chat/ThreadHandoffDialog.tsx @@ -0,0 +1,170 @@ +import { useAtomValue } from "@effect/atom-react"; +import { + isAtomCommandInterrupted, + squashAtomCommandFailure, +} from "@t3tools/client-runtime/state/runtime"; +import type { EnvironmentId, ScopedThreadRef } from "@t3tools/contracts"; +import { Link } from "@tanstack/react-router"; +import { T, useGT, Var } from "gt-react"; +import { useState } from "react"; + +import { appAtomRegistry } from "~/rpc/atomRegistry"; +import { useEnvironmentMachines } from "~/state/environments"; +import { useEnvironmentQuery } from "~/state/query"; +import { threadHandoffDialogThreadAtom, threadHandoffEnvironment } from "~/state/threadHandoff"; +import { useAtomCommand } from "~/state/use-atom-command"; +import { EnvironmentMachineIcon } from "../EnvironmentMachineIcon"; +import { Button } from "../ui/button"; +import { + Dialog, + DialogDescription, + DialogFooter, + DialogHeader, + DialogPanel, + DialogPopup, + DialogTitle, +} from "../ui/dialog"; +import { Radio, RadioGroup } from "../ui/radio-group"; +import { Spinner } from "../ui/spinner"; +import { stackedThreadToast, toastManager } from "../ui/toast"; + +export function ThreadHandoffDialogHost() { + const threadRef = useAtomValue(threadHandoffDialogThreadAtom); + if (threadRef === null) return null; + return ( + appAtomRegistry.set(threadHandoffDialogThreadAtom, null)} + /> + ); +} + +function ThreadHandoffDialog({ + threadRef, + onClose, +}: { + readonly threadRef: ScopedThreadRef; + readonly onClose: () => void; +}) { + const gt = useGT(); + const machines = useEnvironmentMachines(); + const targets = useEnvironmentQuery( + threadHandoffEnvironment.options({ + environmentId: threadRef.environmentId, + input: { threadId: threadRef.threadId }, + }), + ); + const start = useAtomCommand(threadHandoffEnvironment.start, { reportFailure: false }); + const [picked, setPicked] = useState(null); + const options = targets.data?.options ?? []; + const movable = options.filter((option) => option.reason === null); + const chosen = + movable.find((option) => option.environmentId === picked) ?? + (movable.length === 1 ? movable[0] : undefined); + + // The move outlasts the dialog: the thread's own notice shows how it goes. + const move = () => { + if (chosen === undefined) return; + onClose(); + void start({ + environmentId: threadRef.environmentId, + input: { threadId: threadRef.threadId, environmentId: chosen.environmentId }, + }).then((result) => { + if (result._tag !== "Failure" || isAtomCommandInterrupted(result)) return; + const error = squashAtomCommandFailure(result); + toastManager.add( + stackedThreadToast({ + type: "error", + title: gt("Could not move the thread to {machine}", { machine: chosen.label }), + ...(error instanceof Error ? { description: error.message } : {}), + }), + ); + }); + }; + + return ( + { + if (!open) onClose(); + }} + > + + + + Continue on another machine + + + + The thread moves with its conversation and its code, including commits you have not + pushed and uncommitted changes. This copy becomes read-only. + + + + + {targets.data === null && targets.error === null ? ( +

+ + Asking linked machines… +

+ ) : targets.data === null ? ( +

+ {targets.error} +

+ ) : options.length === 0 ? ( +

+ {gt("This machine has no linked machines.")}{" "} + + {gt("Link one in Settings")} + +

+ ) : ( + setPicked(value as EnvironmentId)} + > + {options.map((option) => ( + + ))} + + )} +
+ + + + +
+
+ ); +} diff --git a/apps/web/src/components/threadActionMenu.logic.test.ts b/apps/web/src/components/threadActionMenu.logic.test.ts index d73a50f7a1b34..7c4d85340f774 100644 --- a/apps/web/src/components/threadActionMenu.logic.test.ts +++ b/apps/web/src/components/threadActionMenu.logic.test.ts @@ -66,14 +66,16 @@ describe("buildThreadActionMenuItems", () => { }, ); - it("disables archive and turning into a project while the thread is running", () => { + it("disables archive, moving and turning into a project while the thread is running", () => { const items = buildThreadActionMenuItems({ ...baseState, isRunning: true, canTurnIntoProject: true, + canContinueElsewhere: true, }); expect(items.find((item) => item.id === "archive")?.disabled).toBe(true); expect(items.find((item) => item.id === "turn-into-project")?.disabled).toBe(true); + expect(items.find((item) => item.id === "continue-elsewhere")?.disabled).toBe(true); }); it.each([ diff --git a/apps/web/src/components/threadActionMenu.logic.ts b/apps/web/src/components/threadActionMenu.logic.ts index de3a8bc76d03e..81160724f8732 100644 --- a/apps/web/src/components/threadActionMenu.logic.ts +++ b/apps/web/src/components/threadActionMenu.logic.ts @@ -24,6 +24,7 @@ export type ThreadActionMenuId = | "regenerate-title" | "mark-unread" | "share-guest" + | "continue-elsewhere" | "copy" | "copy-path" | "copy-branch" @@ -125,6 +126,8 @@ export interface ThreadActionMenuState { readonly snoozePresets: ReadonlyArray; /** Guest links need their own grant, so the caller checks it instead of `canOperate`. */ readonly canShareWithGuest?: boolean; + /** The thread's machine offers links, this client may move threads, and no move is under way. */ + readonly canContinueElsewhere?: boolean; /** A No project thread with its own folder, on a server that can promote it. */ readonly canTurnIntoProject?: boolean; } @@ -249,6 +252,17 @@ export function buildThreadActionMenuItems( ...(state.canShareWithGuest ? [{ id: "share-guest" as const, label: resolve(msg("Share with guest")), icon: "user-plus" }] : []), + ...(state.canContinueElsewhere + ? [ + { + id: "continue-elsewhere" as const, + label: resolve(msg("Continue on another machine…")), + icon: "monitor-up", + // A move waits for nothing: the server refuses one while a turn runs. + disabled: state.isRunning, + }, + ] + : []), ...(state.projectFilter ? [ { diff --git a/apps/web/src/contextMenuFallback.ts b/apps/web/src/contextMenuFallback.ts index 7754e191f4722..4a7b2b4a3c0d7 100644 --- a/apps/web/src/contextMenuFallback.ts +++ b/apps/web/src/contextMenuFallback.ts @@ -127,6 +127,13 @@ const ICON_PATHS: Record ({ }), useProjects: () => [{ id: "project", environmentId: "secondary" }], })); +vi.mock("../state/threadHandoff", () => ({ + openThreadHandoffDialog: () => {}, + readCanMoveThreads: () => false, +})); vi.mock("../state/environments", () => ({ usePrimaryEnvironmentId: () => "primary" })); vi.mock("../state/threads", () => ({ threadEnvironment: { updateMetadata: "metadata" } })); vi.mock("../state/use-atom-command", () => ({ diff --git a/apps/web/src/hooks/useThreadActionMenu.ts b/apps/web/src/hooks/useThreadActionMenu.ts index 4a5acffafa9eb..644e90da72870 100644 --- a/apps/web/src/hooks/useThreadActionMenu.ts +++ b/apps/web/src/hooks/useThreadActionMenu.ts @@ -31,6 +31,8 @@ import { stackedThreadToast, toastManager } from "../components/ui/toast"; import { copyThreadReference } from "../lib/copyThreadReference"; import { m } from "../i18n/messages"; import { threadChipCopyTarget } from "@t3tools/client-runtime/thread-reference"; +import { threadCanStartHandoff } from "@t3tools/client-runtime/state/peerLinks"; +import { openThreadHandoffDialog, readCanMoveThreads } from "../state/threadHandoff"; import { threadEnvironment } from "../state/threads"; import { threadTriagePermitted, useOrchestrationCommand } from "../state/use-orchestration-command"; import { readEnvironmentScope } from "../state/session"; @@ -152,6 +154,8 @@ export function useThreadActionMenu(input: { supports, snoozePresets, canShareWithGuest, + canContinueElsewhere: + threadCanStartHandoff(thread.handoff) && readCanMoveThreads(threadRef.environmentId), canTurnIntoProject: canTurnThreadIntoProject(threadRef), }); const run = async (action: ThreadActionMenuId) => { @@ -271,6 +275,9 @@ export function useThreadActionMenu(input: { case "mark-unread": markThreadUnread(threadRef); return; + case "continue-elsewhere": + openThreadHandoffDialog(threadRef); + return; case "share-guest": openGuestShareDialog(threadRef); return; diff --git a/apps/web/src/i18n/translations/de.json b/apps/web/src/i18n/translations/de.json index 1cc205e05bd69..9293b6013cd3e 100644 --- a/apps/web/src/i18n/translations/de.json +++ b/apps/web/src/i18n/translations/de.json @@ -2850,6 +2850,7 @@ "6dd1f458bcd6a2ea": "Wird neu erzeugt…", "de30fdae5b3fea98": "Titel neu erzeugen", "dffd2e20f7ff5aa1": "Als ungelesen markieren", + "d709a32da2c8bdac": "Auf einem anderen Rechner fortsetzen…", "3364346f40934e88": "Alle Projekte anzeigen", "666f3ac177c116b6": "Nach {project} filtern", "1385e2d8bd696370": "In Projekt umwandeln", @@ -4346,6 +4347,17 @@ "f67b82db6ff66321": "Vorheriger Treffer", "bac07cd397c7d1a8": "Nächster Treffer", "add695e6e4871706": "Suche schließen", + "4c31fb11f7b5721e": "Wird nach {machine} verschoben", + "73a8d7a040b51158": "Wird auf {machine} fortgesetzt", + "8f46ca44db8b107b": "Wird nach {machine} verschoben, sobald diese Runde endet", + "b3da0064b6c4d977": "Wenn du eine Nachricht sendest, bleibt er stattdessen hier.", + "cc93bcdd28a2223e": "Das Verschieben konnte nicht abgebrochen werden", + "00de64d19d985ed3": "Hier behalten", + "e7ba3939542e8ee1": "Wird nach {machine} verschoben…", + "c3f86e567586e075": "Dieser Thread wird auf {machine} fortgesetzt", + "6de54bd779ddbea2": "Diese Kopie ist schreibgeschützt.", + "6ef05430a4278089": "Auf {machine} öffnen", + "7417d72c5c18c78f": "Verschieben nach {machine} fehlgeschlagen", "ac6f0547a17af482": "läuft", "ff6a691011a6c521": "fehlgeschlagen", "dcc2eb7f42d0ac64": "gestoppt", @@ -4764,6 +4776,15 @@ "9eb2900e080885a9": "Andere Modelle", "692ab6310c81b85f": "Modell wählen", "fe8ed6127f1d8a28": "Erneut versuchen", + "0d99aa07d84da48f": "Der Thread konnte nicht nach {machine} verschoben werden", + "16f8dc3158c3bb13": "Dieser Rechner hat keine verknüpften Rechner.", + "d5d1c6fe8ec7b980": "Verknüpfe einen in den Einstellungen", + "b7e27e07d1d142cc": "Rechner, auf dem fortgesetzt wird", + "24b1927fc2e8a7a9": "Thread verschieben", + "b86bf0a7bb25c28a": "Nach {machine} verschieben", + "5c22704c8f35eb62": "Auf einem anderen Rechner fortsetzen", + "f174b5d3c91658f9": "Der Thread zieht mit seiner Unterhaltung und seinem Code um, einschließlich nicht gepushter Commits und nicht committeter Änderungen. Diese Kopie wird schreibgeschützt.", + "619892264737e0aa": "Verknüpfte Rechner werden gefragt…", "b587aeb10f238d17": "Modell herunterladen", "c89e52c7e756475e": "Download erfordert einen Admin", "0ce52f02e2622a13": [ diff --git a/apps/web/src/i18n/translations/en.json b/apps/web/src/i18n/translations/en.json index b73b31ad0d328..89c26e5b7be0f 100644 --- a/apps/web/src/i18n/translations/en.json +++ b/apps/web/src/i18n/translations/en.json @@ -2849,6 +2849,7 @@ "6dd1f458bcd6a2ea": "Regenerating…", "de30fdae5b3fea98": "Regenerate title", "dffd2e20f7ff5aa1": "Mark unread", + "d709a32da2c8bdac": "Continue on another machine…", "3364346f40934e88": "Show all projects", "666f3ac177c116b6": "Filter by {project}", "1385e2d8bd696370": "Turn into project", @@ -4345,6 +4346,17 @@ "f67b82db6ff66321": "Previous match", "bac07cd397c7d1a8": "Next match", "add695e6e4871706": "Close find", + "4c31fb11f7b5721e": "Moving to {machine}", + "73a8d7a040b51158": "Continues on {machine}", + "8f46ca44db8b107b": "Moving to {machine} when this turn ends", + "b3da0064b6c4d977": "Sending a message keeps it here instead.", + "cc93bcdd28a2223e": "Could not cancel the move", + "00de64d19d985ed3": "Keep it here", + "e7ba3939542e8ee1": "Moving to {machine}…", + "c3f86e567586e075": "This thread continues on {machine}", + "6de54bd779ddbea2": "This copy is read-only.", + "6ef05430a4278089": "Open on {machine}", + "7417d72c5c18c78f": "Could not move to {machine}", "ac6f0547a17af482": "running", "ff6a691011a6c521": "failed", "dcc2eb7f42d0ac64": "stopped", @@ -4763,6 +4775,15 @@ "9eb2900e080885a9": "Other models", "692ab6310c81b85f": "Choose a model", "fe8ed6127f1d8a28": "Try again", + "0d99aa07d84da48f": "Could not move the thread to {machine}", + "16f8dc3158c3bb13": "This machine has no linked machines.", + "d5d1c6fe8ec7b980": "Link one in Settings", + "b7e27e07d1d142cc": "Machine to continue on", + "24b1927fc2e8a7a9": "Move thread", + "b86bf0a7bb25c28a": "Move to {machine}", + "5c22704c8f35eb62": "Continue on another machine", + "f174b5d3c91658f9": "The thread moves with its conversation and its code, including commits you have not pushed and uncommitted changes. This copy becomes read-only.", + "619892264737e0aa": "Asking linked machines…", "b587aeb10f238d17": "Download model", "c89e52c7e756475e": "Needs an admin to download", "0ce52f02e2622a13": [ diff --git a/apps/web/src/i18n/translations/es.json b/apps/web/src/i18n/translations/es.json index 3b0d74659a93a..3c20895e88fa2 100644 --- a/apps/web/src/i18n/translations/es.json +++ b/apps/web/src/i18n/translations/es.json @@ -2849,6 +2849,7 @@ "6dd1f458bcd6a2ea": "Regenerando…", "de30fdae5b3fea98": "Regenerar título", "dffd2e20f7ff5aa1": "Marcar como no leído", + "d709a32da2c8bdac": "Continuar en otra máquina…", "3364346f40934e88": "Mostrar todos los proyectos", "666f3ac177c116b6": "Filtrar por {project}", "1385e2d8bd696370": "Convertir en proyecto", @@ -4343,6 +4344,17 @@ "f67b82db6ff66321": "Coincidencia anterior", "bac07cd397c7d1a8": "Coincidencia siguiente", "add695e6e4871706": "Cerrar búsqueda", + "4c31fb11f7b5721e": "Moviendo a {machine}", + "73a8d7a040b51158": "Continúa en {machine}", + "8f46ca44db8b107b": "Se moverá a {machine} cuando termine este turno", + "b3da0064b6c4d977": "Si envías un mensaje, se queda aquí.", + "cc93bcdd28a2223e": "No se pudo cancelar el traslado", + "00de64d19d985ed3": "Dejarlo aquí", + "e7ba3939542e8ee1": "Moviendo a {machine}…", + "c3f86e567586e075": "Este hilo continúa en {machine}", + "6de54bd779ddbea2": "Esta copia es de solo lectura.", + "6ef05430a4278089": "Abrir en {machine}", + "7417d72c5c18c78f": "No se pudo mover a {machine}", "ac6f0547a17af482": "en curso", "ff6a691011a6c521": "fallida", "dcc2eb7f42d0ac64": "detenida", @@ -4761,6 +4773,15 @@ "9eb2900e080885a9": "Otros modelos", "692ab6310c81b85f": "Elige un modelo", "fe8ed6127f1d8a28": "Volver a intentar", + "0d99aa07d84da48f": "No se pudo mover el hilo a {machine}", + "16f8dc3158c3bb13": "Esta máquina no tiene máquinas vinculadas.", + "d5d1c6fe8ec7b980": "Vincula una en Ajustes", + "b7e27e07d1d142cc": "Máquina en la que continuar", + "24b1927fc2e8a7a9": "Mover hilo", + "b86bf0a7bb25c28a": "Mover a {machine}", + "5c22704c8f35eb62": "Continuar en otra máquina", + "f174b5d3c91658f9": "El hilo se mueve con su conversación y su código, incluidos los commits que no has enviado y los cambios sin confirmar. Esta copia pasa a ser de solo lectura.", + "619892264737e0aa": "Consultando las máquinas vinculadas…", "b587aeb10f238d17": "Descargar modelo", "c89e52c7e756475e": "Necesita un administrador para descargarlo", "0ce52f02e2622a13": [ diff --git a/apps/web/src/i18n/translations/fr.json b/apps/web/src/i18n/translations/fr.json index 35ef267f55bae..b67b1f16753e4 100644 --- a/apps/web/src/i18n/translations/fr.json +++ b/apps/web/src/i18n/translations/fr.json @@ -2849,6 +2849,7 @@ "6dd1f458bcd6a2ea": "Régénération…", "de30fdae5b3fea98": "Régénérer le titre", "dffd2e20f7ff5aa1": "Marquer comme non lu", + "d709a32da2c8bdac": "Continuer sur une autre machine…", "3364346f40934e88": "Afficher tous les projets", "666f3ac177c116b6": "Filtrer par {project}", "1385e2d8bd696370": "Transformer en projet", @@ -4344,6 +4345,17 @@ "f67b82db6ff66321": "Résultat précédent", "bac07cd397c7d1a8": "Résultat suivant", "add695e6e4871706": "Fermer la recherche", + "4c31fb11f7b5721e": "Déplacement vers {machine}", + "73a8d7a040b51158": "Se poursuit sur {machine}", + "8f46ca44db8b107b": "Déplacement vers {machine} à la fin de ce tour", + "b3da0064b6c4d977": "Envoyer un message le garde ici.", + "cc93bcdd28a2223e": "Impossible d’annuler le déplacement", + "00de64d19d985ed3": "Le garder ici", + "e7ba3939542e8ee1": "Déplacement vers {machine}…", + "c3f86e567586e075": "Ce fil se poursuit sur {machine}", + "6de54bd779ddbea2": "Cette copie est en lecture seule.", + "6ef05430a4278089": "Ouvrir sur {machine}", + "7417d72c5c18c78f": "Impossible de déplacer vers {machine}", "ac6f0547a17af482": "en cours", "ff6a691011a6c521": "en échec", "dcc2eb7f42d0ac64": "arrêtée", @@ -4762,6 +4774,15 @@ "9eb2900e080885a9": "Autres modèles", "692ab6310c81b85f": "Choisir un modèle", "fe8ed6127f1d8a28": "Réessayer", + "0d99aa07d84da48f": "Impossible de déplacer le fil vers {machine}", + "16f8dc3158c3bb13": "Cette machine n’a aucune machine associée.", + "d5d1c6fe8ec7b980": "Associez-en une dans les Paramètres", + "b7e27e07d1d142cc": "Machine sur laquelle continuer", + "24b1927fc2e8a7a9": "Déplacer le fil", + "b86bf0a7bb25c28a": "Déplacer vers {machine}", + "5c22704c8f35eb62": "Continuer sur une autre machine", + "f174b5d3c91658f9": "Le fil est déplacé avec sa conversation et son code, y compris les commits non poussés et les modifications non commitées. Cette copie passe en lecture seule.", + "619892264737e0aa": "Interrogation des machines associées…", "b587aeb10f238d17": "Télécharger le modèle", "c89e52c7e756475e": "Téléchargement réservé à un administrateur", "0ce52f02e2622a13": [ diff --git a/apps/web/src/i18n/translations/ja.json b/apps/web/src/i18n/translations/ja.json index 573595f4cd067..8a44abd531a18 100644 --- a/apps/web/src/i18n/translations/ja.json +++ b/apps/web/src/i18n/translations/ja.json @@ -2847,6 +2847,7 @@ "6dd1f458bcd6a2ea": "再生成しています…", "de30fdae5b3fea98": "タイトルを再生成", "dffd2e20f7ff5aa1": "未読にする", + "d709a32da2c8bdac": "別のマシンで続ける…", "3364346f40934e88": "すべてのプロジェクトを表示", "666f3ac177c116b6": "{project} で絞り込み", "1385e2d8bd696370": "プロジェクトに変換", @@ -4333,6 +4334,17 @@ "f67b82db6ff66321": "前の一致", "bac07cd397c7d1a8": "次の一致", "add695e6e4871706": "検索を閉じる", + "4c31fb11f7b5721e": "{machine} に移動中", + "73a8d7a040b51158": "{machine} で継続中", + "8f46ca44db8b107b": "このターンが終わると {machine} に移動します", + "b3da0064b6c4d977": "メッセージを送信すると、ここに残ります。", + "cc93bcdd28a2223e": "移動をキャンセルできませんでした", + "00de64d19d985ed3": "ここに残す", + "e7ba3939542e8ee1": "{machine} に移動中…", + "c3f86e567586e075": "このスレッドは {machine} で続いています", + "6de54bd779ddbea2": "このコピーは読み取り専用です。", + "6ef05430a4278089": "{machine} で開く", + "7417d72c5c18c78f": "{machine} に移動できませんでした", "ac6f0547a17af482": "実行中", "ff6a691011a6c521": "失敗", "dcc2eb7f42d0ac64": "停止", @@ -4751,6 +4763,15 @@ "9eb2900e080885a9": "その他のモデル", "692ab6310c81b85f": "モデルを選択", "fe8ed6127f1d8a28": "再試行", + "0d99aa07d84da48f": "スレッドを {machine} に移動できませんでした", + "16f8dc3158c3bb13": "このマシンにはリンクされたマシンがありません。", + "d5d1c6fe8ec7b980": "設定でリンクする", + "b7e27e07d1d142cc": "続行するマシン", + "24b1927fc2e8a7a9": "スレッドを移動", + "b86bf0a7bb25c28a": "{machine} に移動", + "5c22704c8f35eb62": "別のマシンで続ける", + "f174b5d3c91658f9": "スレッドは会話とコードごと移動します。プッシュしていないコミットや未コミットの変更も含まれます。このコピーは読み取り専用になります。", + "619892264737e0aa": "リンクされたマシンに問い合わせ中…", "b587aeb10f238d17": "モデルをダウンロード", "c89e52c7e756475e": "ダウンロードには管理者が必要です", "0ce52f02e2622a13": [ diff --git a/apps/web/src/i18n/translations/ko.json b/apps/web/src/i18n/translations/ko.json index 943408228f49b..eb25e226e8815 100644 --- a/apps/web/src/i18n/translations/ko.json +++ b/apps/web/src/i18n/translations/ko.json @@ -2848,6 +2848,7 @@ "6dd1f458bcd6a2ea": "다시 생성하는 중…", "de30fdae5b3fea98": "제목 다시 생성", "dffd2e20f7ff5aa1": "읽지 않음으로 표시", + "d709a32da2c8bdac": "다른 머신에서 계속…", "3364346f40934e88": "모든 프로젝트 표시", "666f3ac177c116b6": "{project}(으)로 필터", "1385e2d8bd696370": "프로젝트로 전환", @@ -4330,6 +4331,17 @@ "f67b82db6ff66321": "이전 일치 항목", "bac07cd397c7d1a8": "다음 일치 항목", "add695e6e4871706": "찾기 닫기", + "4c31fb11f7b5721e": "{machine}(으)로 이동 중", + "73a8d7a040b51158": "{machine}에서 계속됨", + "8f46ca44db8b107b": "이번 턴이 끝나면 {machine}(으)로 이동합니다", + "b3da0064b6c4d977": "메시지를 보내면 여기에 그대로 남습니다.", + "cc93bcdd28a2223e": "이동을 취소할 수 없습니다", + "00de64d19d985ed3": "여기에 유지", + "e7ba3939542e8ee1": "{machine}(으)로 이동 중…", + "c3f86e567586e075": "이 스레드는 {machine}에서 계속됩니다", + "6de54bd779ddbea2": "이 사본은 읽기 전용입니다.", + "6ef05430a4278089": "{machine}에서 열기", + "7417d72c5c18c78f": "{machine}(으)로 이동할 수 없습니다", "ac6f0547a17af482": "실행 중", "ff6a691011a6c521": "실패", "dcc2eb7f42d0ac64": "중지됨", @@ -4748,6 +4760,15 @@ "9eb2900e080885a9": "기타 모델", "692ab6310c81b85f": "모델 선택", "fe8ed6127f1d8a28": "다시 시도", + "0d99aa07d84da48f": "스레드를 {machine}(으)로 이동할 수 없습니다", + "16f8dc3158c3bb13": "이 머신에는 연결된 머신이 없습니다.", + "d5d1c6fe8ec7b980": "설정에서 연결하기", + "b7e27e07d1d142cc": "계속할 머신", + "24b1927fc2e8a7a9": "스레드 이동", + "b86bf0a7bb25c28a": "{machine}(으)로 이동", + "5c22704c8f35eb62": "다른 머신에서 계속", + "f174b5d3c91658f9": "스레드는 대화와 코드와 함께 이동하며, 푸시하지 않은 커밋과 커밋하지 않은 변경 사항도 포함됩니다. 이 사본은 읽기 전용이 됩니다.", + "619892264737e0aa": "연결된 머신에 확인 중…", "b587aeb10f238d17": "모델 다운로드", "c89e52c7e756475e": "다운로드하려면 관리자가 필요합니다", "0ce52f02e2622a13": [ diff --git a/apps/web/src/i18n/translations/pt-BR.json b/apps/web/src/i18n/translations/pt-BR.json index 4b8e21c7852dc..fd33bda9377df 100644 --- a/apps/web/src/i18n/translations/pt-BR.json +++ b/apps/web/src/i18n/translations/pt-BR.json @@ -2849,6 +2849,7 @@ "6dd1f458bcd6a2ea": "Gerando novamente…", "de30fdae5b3fea98": "Gerar título novamente", "dffd2e20f7ff5aa1": "Marcar como não lida", + "d709a32da2c8bdac": "Continuar em outra máquina…", "3364346f40934e88": "Mostrar todos os projetos", "666f3ac177c116b6": "Filtrar por {project}", "1385e2d8bd696370": "Transformar em projeto", @@ -4343,6 +4344,17 @@ "f67b82db6ff66321": "Resultado anterior", "bac07cd397c7d1a8": "Próximo resultado", "add695e6e4871706": "Fechar a localização", + "4c31fb11f7b5721e": "Movendo para {machine}", + "73a8d7a040b51158": "Continua em {machine}", + "8f46ca44db8b107b": "Será movida para {machine} quando este turno terminar", + "b3da0064b6c4d977": "Enviar uma mensagem a mantém aqui.", + "cc93bcdd28a2223e": "Não foi possível cancelar a movimentação", + "00de64d19d985ed3": "Manter aqui", + "e7ba3939542e8ee1": "Movendo para {machine}…", + "c3f86e567586e075": "Esta thread continua em {machine}", + "6de54bd779ddbea2": "Esta cópia é somente leitura.", + "6ef05430a4278089": "Abrir em {machine}", + "7417d72c5c18c78f": "Não foi possível mover para {machine}", "ac6f0547a17af482": "em execução", "ff6a691011a6c521": "com falha", "dcc2eb7f42d0ac64": "parada", @@ -4761,6 +4773,15 @@ "9eb2900e080885a9": "Outros modelos", "692ab6310c81b85f": "Escolha um modelo", "fe8ed6127f1d8a28": "Tentar novamente", + "0d99aa07d84da48f": "Não foi possível mover a thread para {machine}", + "16f8dc3158c3bb13": "Esta máquina não tem máquinas vinculadas.", + "d5d1c6fe8ec7b980": "Vincule uma em Configurações", + "b7e27e07d1d142cc": "Máquina na qual continuar", + "24b1927fc2e8a7a9": "Mover thread", + "b86bf0a7bb25c28a": "Mover para {machine}", + "5c22704c8f35eb62": "Continuar em outra máquina", + "f174b5d3c91658f9": "A thread é movida com a conversa e o código, incluindo commits que você não enviou e alterações não commitadas. Esta cópia passa a ser somente leitura.", + "619892264737e0aa": "Consultando as máquinas vinculadas…", "b587aeb10f238d17": "Baixar modelo", "c89e52c7e756475e": "Precisa de um administrador para baixar", "0ce52f02e2622a13": [ diff --git a/apps/web/src/i18n/translations/ru.json b/apps/web/src/i18n/translations/ru.json index c083d6bfb6464..f50e4c9e1456f 100644 --- a/apps/web/src/i18n/translations/ru.json +++ b/apps/web/src/i18n/translations/ru.json @@ -2849,6 +2849,7 @@ "6dd1f458bcd6a2ea": "Генерация…", "de30fdae5b3fea98": "Сгенерировать название заново", "dffd2e20f7ff5aa1": "Отметить непрочитанным", + "d709a32da2c8bdac": "Продолжить на другой машине…", "3364346f40934e88": "Показать все проекты", "666f3ac177c116b6": "Фильтр: {project}", "1385e2d8bd696370": "Превратить в проект", @@ -4343,6 +4344,17 @@ "f67b82db6ff66321": "Предыдущее совпадение", "bac07cd397c7d1a8": "Следующее совпадение", "add695e6e4871706": "Закрыть поиск", + "4c31fb11f7b5721e": "Переносится на {machine}", + "73a8d7a040b51158": "Продолжается на {machine}", + "8f46ca44db8b107b": "Перенесётся на {machine}, когда закончится этот ход", + "b3da0064b6c4d977": "Если отправить сообщение, он останется здесь.", + "cc93bcdd28a2223e": "Не удалось отменить перенос", + "00de64d19d985ed3": "Оставить здесь", + "e7ba3939542e8ee1": "Переносится на {machine}…", + "c3f86e567586e075": "Этот тред продолжается на {machine}", + "6de54bd779ddbea2": "Эта копия доступна только для чтения.", + "6ef05430a4278089": "Открыть на {machine}", + "7417d72c5c18c78f": "Не удалось перенести на {machine}", "ac6f0547a17af482": "выполняется", "ff6a691011a6c521": "ошибка", "dcc2eb7f42d0ac64": "остановлен", @@ -4761,6 +4773,15 @@ "9eb2900e080885a9": "Другие модели", "692ab6310c81b85f": "Выберите модель", "fe8ed6127f1d8a28": "Повторить", + "0d99aa07d84da48f": "Не удалось перенести тред на {machine}", + "16f8dc3158c3bb13": "У этой машины нет привязанных машин.", + "d5d1c6fe8ec7b980": "Привяжите машину в Настройках", + "b7e27e07d1d142cc": "Машина, на которой продолжить", + "24b1927fc2e8a7a9": "Перенести тред", + "b86bf0a7bb25c28a": "Перенести на {machine}", + "5c22704c8f35eb62": "Продолжить на другой машине", + "f174b5d3c91658f9": "Тред переносится вместе с перепиской и кодом, включая неотправленные коммиты и незакоммиченные изменения. Эта копия станет доступной только для чтения.", + "619892264737e0aa": "Опрашиваем привязанные машины…", "b587aeb10f238d17": "Скачать модель", "c89e52c7e756475e": "Для загрузки нужен администратор", "0ce52f02e2622a13": [ diff --git a/apps/web/src/i18n/translations/sv.json b/apps/web/src/i18n/translations/sv.json index b6856b8faefc3..d5e30c91560dd 100644 --- a/apps/web/src/i18n/translations/sv.json +++ b/apps/web/src/i18n/translations/sv.json @@ -2849,6 +2849,7 @@ "6dd1f458bcd6a2ea": "Genererar om…", "de30fdae5b3fea98": "Generera om titel", "dffd2e20f7ff5aa1": "Markera som oläst", + "d709a32da2c8bdac": "Fortsätt på en annan dator…", "3364346f40934e88": "Visa alla projekt", "666f3ac177c116b6": "Filtrera efter {project}", "1385e2d8bd696370": "Gör om till projekt", @@ -4344,6 +4345,17 @@ "f67b82db6ff66321": "Föregående träff", "bac07cd397c7d1a8": "Nästa träff", "add695e6e4871706": "Stäng sökningen", + "4c31fb11f7b5721e": "Flyttas till {machine}", + "73a8d7a040b51158": "Fortsätter på {machine}", + "8f46ca44db8b107b": "Flyttas till {machine} när den här omgången är klar", + "b3da0064b6c4d977": "Om du skickar ett meddelande stannar den här i stället.", + "cc93bcdd28a2223e": "Det gick inte att avbryta flytten", + "00de64d19d985ed3": "Behåll den här", + "e7ba3939542e8ee1": "Flyttas till {machine}…", + "c3f86e567586e075": "Den här tråden fortsätter på {machine}", + "6de54bd779ddbea2": "Den här kopian är skrivskyddad.", + "6ef05430a4278089": "Öppna på {machine}", + "7417d72c5c18c78f": "Det gick inte att flytta till {machine}", "ac6f0547a17af482": "körs", "ff6a691011a6c521": "misslyckad", "dcc2eb7f42d0ac64": "stoppad", @@ -4762,6 +4774,15 @@ "9eb2900e080885a9": "Andra modeller", "692ab6310c81b85f": "Välj en modell", "fe8ed6127f1d8a28": "Försök igen", + "0d99aa07d84da48f": "Det gick inte att flytta tråden till {machine}", + "16f8dc3158c3bb13": "Den här datorn har inga länkade datorer.", + "d5d1c6fe8ec7b980": "Länka en i Inställningar", + "b7e27e07d1d142cc": "Dator att fortsätta på", + "24b1927fc2e8a7a9": "Flytta tråd", + "b86bf0a7bb25c28a": "Flytta till {machine}", + "5c22704c8f35eb62": "Fortsätt på en annan dator", + "f174b5d3c91658f9": "Tråden flyttas med sin konversation och sin kod, inklusive commits som du inte har pushat och ändringar som inte är committade. Den här kopian blir skrivskyddad.", + "619892264737e0aa": "Frågar länkade datorer…", "b587aeb10f238d17": "Ladda ned modell", "c89e52c7e756475e": "Kräver en administratör för att laddas ned", "0ce52f02e2622a13": [ diff --git a/apps/web/src/i18n/translations/zh.json b/apps/web/src/i18n/translations/zh.json index ab80e528e6b72..712b5cb67e749 100644 --- a/apps/web/src/i18n/translations/zh.json +++ b/apps/web/src/i18n/translations/zh.json @@ -2853,6 +2853,7 @@ "6dd1f458bcd6a2ea": "正在重新生成…", "de30fdae5b3fea98": "重新生成标题", "dffd2e20f7ff5aa1": "标为未读", + "d709a32da2c8bdac": "在另一台机器上继续…", "3364346f40934e88": "显示所有项目", "666f3ac177c116b6": "按 {project} 筛选", "1385e2d8bd696370": "转换为项目", @@ -4349,6 +4350,17 @@ "f67b82db6ff66321": "上一个匹配项", "bac07cd397c7d1a8": "下一个匹配项", "add695e6e4871706": "关闭查找", + "4c31fb11f7b5721e": "正在移至 {machine}", + "73a8d7a040b51158": "已在 {machine} 上继续", + "8f46ca44db8b107b": "本轮结束后将移至 {machine}", + "b3da0064b6c4d977": "发送消息会让它留在这里。", + "cc93bcdd28a2223e": "无法取消移动", + "00de64d19d985ed3": "留在这里", + "e7ba3939542e8ee1": "正在移至 {machine}…", + "c3f86e567586e075": "此会话已在 {machine} 上继续", + "6de54bd779ddbea2": "此副本为只读。", + "6ef05430a4278089": "在 {machine} 上打开", + "7417d72c5c18c78f": "无法移至 {machine}", "ac6f0547a17af482": "运行中", "ff6a691011a6c521": "失败", "dcc2eb7f42d0ac64": "已停止", @@ -4767,6 +4779,15 @@ "9eb2900e080885a9": "其他模型", "692ab6310c81b85f": "选择模型", "fe8ed6127f1d8a28": "重试", + "0d99aa07d84da48f": "无法将会话移至 {machine}", + "16f8dc3158c3bb13": "这台机器没有已关联的机器。", + "d5d1c6fe8ec7b980": "在设置中关联一台", + "b7e27e07d1d142cc": "要继续的机器", + "24b1927fc2e8a7a9": "移动会话", + "b86bf0a7bb25c28a": "移至 {machine}", + "5c22704c8f35eb62": "在另一台机器上继续", + "f174b5d3c91658f9": "会话会连同对话和代码一起移动,包括尚未推送的提交和未提交的更改。此副本将变为只读。", + "619892264737e0aa": "正在询问已关联的机器…", "b587aeb10f238d17": "下载模型", "c89e52c7e756475e": "需要管理员下载", "0ce52f02e2622a13": [ diff --git a/apps/web/src/routes/__root.tsx b/apps/web/src/routes/__root.tsx index 4ddab939ab7d3..50c7f0e6484e2 100644 --- a/apps/web/src/routes/__root.tsx +++ b/apps/web/src/routes/__root.tsx @@ -19,6 +19,7 @@ import { AppSidebarLayout } from "../components/AppSidebarLayout"; import { CommandPalette } from "../components/CommandPalette"; import { CustomSnoozeDialogHost } from "../components/CustomSnoozeDialog"; import { GuestShareDialogHost } from "../components/chat/GuestShareControls"; +import { ThreadHandoffDialogHost } from "../components/chat/ThreadHandoffDialog"; import { UseInAnotherAppDialogHost } from "../components/mcp/UseInAnotherAppDialog"; import { AddProjectToMachineDialogHost } from "../components/AddProjectToMachineDialog"; import { ConfirmDialogHost } from "../components/ConfirmDialogHost"; @@ -208,6 +209,7 @@ function RootRouteBranch() { + diff --git a/apps/web/src/state/threadHandoff.ts b/apps/web/src/state/threadHandoff.ts new file mode 100644 index 0000000000000..52f573d6185cc --- /dev/null +++ b/apps/web/src/state/threadHandoff.ts @@ -0,0 +1,43 @@ +import { offersLinkedEnvironments } from "@t3tools/client-runtime/link-request"; +import { createThreadHandoffEnvironmentAtoms } from "@t3tools/client-runtime/state/peerLinks"; +import type { EnvironmentId, ScopedThreadRef } from "@t3tools/contracts"; +import { Atom } from "effect/reactivity"; + +import { connectionAtomRuntime } from "../connection/runtime"; +import { appAtomRegistry } from "../rpc/atomRegistry"; +import { environmentPresentations } from "./presentation"; + +export const threadHandoffEnvironment = createThreadHandoffEnvironmentAtoms(connectionAtomRuntime); + +/** Whether `environmentId` offers links and this client may move its threads over one. */ +export const canMoveThreadsAtom = Atom.family((environmentId: EnvironmentId) => + Atom.make( + (get) => + offersLinkedEnvironments( + get(environmentPresentations.serverConfigsAtom).get(environmentId), + ) && get(threadHandoffEnvironment.start.permissionAtom(environmentId)), + ).pipe(Atom.withLabel(`thread-handoff:available:${environmentId}`)), +); + +export function readCanMoveThreads(environmentId: EnvironmentId): boolean { + return appAtomRegistry.get(canMoveThreadsAtom(environmentId)); +} + +/** + * Which thread has the "Continue on another machine" dialog open. The thread menu and the + * command palette both close as their command runs, so the root renders the dialog once. + */ +export const threadHandoffDialogThreadAtom = Atom.make(null).pipe( + Atom.keepAlive, + Atom.withLabel("thread-handoff:dialog-thread"), +); + +export function openThreadHandoffDialog(threadRef: ScopedThreadRef): void { + appAtomRegistry.set(threadHandoffDialogThreadAtom, threadRef); +} + +/** Failed moves whose notice the user closed. The thread keeps the failure until it moves again. */ +export const dismissedThreadHandoffsAtom = Atom.make>(new Set()).pipe( + Atom.keepAlive, + Atom.withLabel("thread-handoff:dismissed"), +); diff --git a/docs/user/remote-access.md b/docs/user/remote-access.md index c8c422dc2a209..8c9806de0ebce 100644 --- a/docs/user/remote-access.md +++ b/docs/user/remote-access.md @@ -86,9 +86,11 @@ Open a delegated task or thread link on a linked machine to follow it live (read ### Continue a thread on another machine -A thread can move to a linked machine with its conversation and its code: commits you have not pushed, uncommitted edits and new files. Tell the agent to move it, for example "I need to wrap up, move this to my VPS". It finishes its reply first, then the thread moves and picks up where it said it would. Sending a message before then cancels the move. +A thread can move to a linked machine with its conversation and its code: commits you have not pushed, uncommitted edits and new files. Choose **Continue on another machine** from the thread's menu or the command palette (the thread's long-press menu on mobile), then pick the machine. The thread has to be idle. -The thread continues there in a new worktree of the project with the same repository, and the copy here becomes read-only. Ignored files such as `.env` stay behind, and a move larger than 50 MB asks you to push the branch first. A long conversation arrives as its first request and most recent turns, not in full. +You can also tell the agent to move it, for example "I need to wrap up, move this to my VPS". It finishes its reply first, then the thread moves and picks up where it said it would. Sending a message before then cancels the move. + +The thread continues there in a new worktree of the project with the same repository, and the copy here becomes read-only with a way to open it there. Ignored files such as `.env` stay behind, and a move larger than 50 MB asks you to push the branch first. A long conversation arrives as its first request and most recent turns, not in full. If the other machine's branch has commits this one lacks, the move is refused and nothing changes on either side. diff --git a/packages/client-runtime/src/state/commandPermissions.test.ts b/packages/client-runtime/src/state/commandPermissions.test.ts index 225922ccca137..8bf0558f9ba1a 100644 --- a/packages/client-runtime/src/state/commandPermissions.test.ts +++ b/packages/client-runtime/src/state/commandPermissions.test.ts @@ -570,11 +570,15 @@ it.effect("requires access management to answer a link request", () => }), ); -it.effect("requires thread operation to answer a feedback card", () => +it.effect.each([ + WS_METHODS.agentFeedbackAnswerRequest, + WS_METHODS.threadHandoffStart, + WS_METHODS.threadHandoffCancel, +] as const)("requires thread operation for %s", (tag) => Effect.gen(function* () { const registry = yield* setup; registry.set(sessions(env), AsyncResult.success(grant(false))); - const answer = createCommandPermissions(runtime, WS_METHODS.agentFeedbackAnswerRequest); + const answer = createCommandPermissions(runtime, tag); expect(registry.get(answer.permissionAtom(env))).toBe(false); expect((yield* answer.authorize(registry, env).pipe(Effect.flip)).requiredPermission).toBe( AuthOrchestrationOperateScope, diff --git a/packages/client-runtime/src/state/models.ts b/packages/client-runtime/src/state/models.ts index ac1b1101d5a94..cc217e8ac20b0 100644 --- a/packages/client-runtime/src/state/models.ts +++ b/packages/client-runtime/src/state/models.ts @@ -198,6 +198,8 @@ export interface EnvironmentThreadShell { readonly linkOrigin: OrchestrationV2ThreadShell["linkOrigin"] | null; /** The thread in a linked environment that delegated this one, if one did. */ readonly delegatedFrom: OrchestrationV2ThreadShell["delegatedFrom"] | null; + /** A move to a linked environment: waiting, under way, done, or failed. */ + readonly handoff: NonNullable | null; /** The workflow run this thread is an agent step of, if it is one. */ readonly workflowRun: OrchestrationV2ThreadShell["workflowRun"] | null; readonly activeProviderThreadId: OrchestrationV2ThreadShell["activeProviderThreadId"]; @@ -352,6 +354,7 @@ export function presentThreadShell( forkedFrom: thread.forkedFrom, linkOrigin: thread.linkOrigin ?? null, delegatedFrom: thread.delegatedFrom ?? null, + handoff: thread.handoff ?? null, workflowRun: thread.workflowRun ?? null, activeProviderThreadId: thread.activeProviderThreadId, latestRun, diff --git a/packages/client-runtime/src/state/peerLinks.ts b/packages/client-runtime/src/state/peerLinks.ts index 3be676d3e5dc2..1bbb0726f86aa 100644 --- a/packages/client-runtime/src/state/peerLinks.ts +++ b/packages/client-runtime/src/state/peerLinks.ts @@ -1,5 +1,6 @@ import { type EnvironmentId, + type OrchestrationV2ThreadShell, type PeerLinkSummary, type PeerLinkThreadInput, WS_METHODS, @@ -169,6 +170,49 @@ export function createPeerLinkEnvironmentAtoms( }; } +/** Moving threads to linked environments, as one environment's server does it. */ +export function createThreadHandoffEnvironmentAtoms( + runtime: Atom.AtomRuntime, +) { + const sameThread = { + mode: "singleFlight" as const, + key: (target: { + readonly environmentId: EnvironmentId; + readonly input: { threadId: string }; + }) => JSON.stringify([target.environmentId, target.input.threadId]), + }; + return { + options: createEnvironmentRpcQueryAtomFamily(runtime, { + label: "environment-data:thread-handoff:options", + tag: WS_METHODS.threadHandoffOptions, + // Each read asks every linked environment for a matching project. + staleTimeMs: 15_000, + }), + start: createEnvironmentRpcCommand(runtime, { + label: "environment-data:thread-handoff:start", + tag: WS_METHODS.threadHandoffStart, + concurrency: sameThread, + }), + cancel: createEnvironmentRpcCommand(runtime, { + label: "environment-data:thread-handoff:cancel", + tag: WS_METHODS.threadHandoffCancel, + concurrency: sameThread, + }), + }; +} + +type ThreadHandoff = NonNullable; + +/** A thread can start a move unless one is waiting, under way or done. */ +export const threadCanStartHandoff = (handoff: ThreadHandoff | null | undefined): boolean => + handoff == null || handoff.state === "failed"; + +/** The copy left behind takes no messages once the move is under way. */ +export const threadHandoffClosesComposer = ( + handoff: ThreadHandoff | null | undefined, +): handoff is Extract => + handoff?.state === "departing" || handoff?.state === "departed"; + const EXPIRY_WARNING_DAYS = 5; export type PeerLinkHealth = diff --git a/packages/contracts/src/clientRpcPermissions.ts b/packages/contracts/src/clientRpcPermissions.ts index 4fee4fceb90b0..27a34f83ad9b4 100644 --- a/packages/contracts/src/clientRpcPermissions.ts +++ b/packages/contracts/src/clientRpcPermissions.ts @@ -103,6 +103,9 @@ export const CLIENT_GUARDED_RPC_SCOPES = { [WS_METHODS.peerLinksAnswerRequest]: AuthAccessWriteScope, [WS_METHODS.peerLinksPairClient]: AuthAccessWriteScope, [WS_METHODS.peerLinksPairLink]: AuthAccessWriteScope, + // Moving a thread ends its work here and starts it on the linked environment. + [WS_METHODS.threadHandoffStart]: AuthOrchestrationOperateScope, + [WS_METHODS.threadHandoffCancel]: AuthOrchestrationOperateScope, // Send stores and sends a report from a thread's turn: the bar of running that thread. [WS_METHODS.agentFeedbackAnswerRequest]: AuthOrchestrationOperateScope, } as const; From e2932b7b4da31333b43f2085471b8e5cf4437f52 Mon Sep 17 00:00:00 2001 From: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Date: Fri, 27 Nov 2026 23:39:44 -0800 Subject: [PATCH 02/14] feat(web,mobile): a moved thread reads as one thread where it continues Opening a thread that moved to another machine now takes the client to where it continues instead of showing a read-only copy with a card. With its own connection to that machine the client opens the thread there; without one it reads it over the link and pairs with the machine by itself, as "Connect to interact" does when pressed. The message that starts the thread's first turn there names the thread it came from, and clients draw it as a "Moved here from " divider between the earlier conversation and what follows. Thread lists drop the copy left behind once they list the thread it continues as. Co-Authored-By: Claude Fable 5.2 --- .../src/features/threads/ThreadFeed.tsx | 10 ++++ .../features/threads/ThreadHandoffCard.tsx | 46 +++++++++++++++++-- .../features/threads/thread-handoff-row.tsx | 23 ++++++++++ apps/mobile/src/i18n/translations/de.json | 3 ++ apps/mobile/src/i18n/translations/en.json | 3 ++ apps/mobile/src/i18n/translations/es.json | 3 ++ apps/mobile/src/i18n/translations/fr.json | 3 ++ apps/mobile/src/i18n/translations/ja.json | 3 ++ apps/mobile/src/i18n/translations/ko.json | 3 ++ apps/mobile/src/i18n/translations/pt-BR.json | 3 ++ apps/mobile/src/i18n/translations/ru.json | 3 ++ apps/mobile/src/i18n/translations/sv.json | 3 ++ apps/mobile/src/i18n/translations/zh.json | 3 ++ .../orchestration-v2/ThreadImportService.ts | 10 +++- apps/web/src/components/ChatView.tsx | 2 + apps/web/src/components/Sidebar.logic.ts | 5 +- .../src/components/chat/LinkedThreadPage.tsx | 3 ++ .../src/components/chat/LinkedThreadPane.tsx | 14 +++++- .../components/chat/ThreadHandoffBanner.tsx | 28 ++++++++++- .../chat/TimelineUserMessageRow.tsx | 21 +++++++++ apps/web/src/i18n/translations/de.json | 2 + apps/web/src/i18n/translations/en.json | 2 + apps/web/src/i18n/translations/es.json | 2 + apps/web/src/i18n/translations/fr.json | 2 + apps/web/src/i18n/translations/ja.json | 2 + apps/web/src/i18n/translations/ko.json | 2 + apps/web/src/i18n/translations/pt-BR.json | 2 + apps/web/src/i18n/translations/ru.json | 2 + apps/web/src/i18n/translations/sv.json | 2 + apps/web/src/i18n/translations/zh.json | 2 + ...d.$linkedEnvironmentId.$linkedThreadId.tsx | 6 +++ apps/web/src/state/linkedThreadView.ts | 5 +- .../src/state/threadShell.test.ts | 28 +++++++++++ .../client-runtime/src/state/threadShell.ts | 39 ++++++++++++++++ packages/contracts/src/orchestratorMcp.ts | 13 ++++++ 35 files changed, 292 insertions(+), 11 deletions(-) diff --git a/apps/mobile/src/features/threads/ThreadFeed.tsx b/apps/mobile/src/features/threads/ThreadFeed.tsx index eb4f2c92a9516..199a07ba75634 100644 --- a/apps/mobile/src/features/threads/ThreadFeed.tsx +++ b/apps/mobile/src/features/threads/ThreadFeed.tsx @@ -37,6 +37,7 @@ import { } from "./thread-context-divider"; import { ThreadHandoffDivider, + ThreadMovedDivider, ThreadHandoffRow, ThreadModelSwitchDivider, } from "./thread-handoff-row"; @@ -76,6 +77,7 @@ import { type ChatFileAttachment, type ChatImageAttachment, type EnvironmentId, + isThreadMoveMessage, type MessageId, type OrchestrationV2ProjectedTurnItem, type RunId, @@ -2336,6 +2338,14 @@ function renderFeedEntry( /> ); } + if (isUser && isThreadMoveMessage(message)) { + return ( + + ); + } if (isCompactionCommandFeedEntry(entry)) { // Stands in for the compaction item until the provider reports it. const active = props.unsettledTurnId !== null && message.runId === props.unsettledTurnId; diff --git a/apps/mobile/src/features/threads/ThreadHandoffCard.tsx b/apps/mobile/src/features/threads/ThreadHandoffCard.tsx index 47bb37dbebd91..677c1c64363b2 100644 --- a/apps/mobile/src/features/threads/ThreadHandoffCard.tsx +++ b/apps/mobile/src/features/threads/ThreadHandoffCard.tsx @@ -1,11 +1,11 @@ -import { useNavigation } from "@react-navigation/native"; +import { StackActions, useNavigation } from "@react-navigation/native"; import { isAtomCommandInterrupted, squashAtomCommandFailure, } from "@t3tools/client-runtime/state/runtime"; import type { EnvironmentThreadShell } from "@t3tools/client-runtime/state/shell"; import { useGT } from "gt-react-native"; -import { useState } from "react"; +import { useEffect, useEffectEvent, useState } from "react"; import { View } from "react-native"; import { AppText as Text } from "../../components/ui/AppText"; @@ -13,13 +13,19 @@ import { Button } from "../../components/ui/Button"; import * as Dialog from "../../components/ui/Dialog"; import { cn } from "../../lib/cn"; import { useEnvironments } from "../../state/environments"; +import { useConnectLinkedEnvironment } from "../../state/linkedThread"; import { threadHandoffEnvironment, useCanMoveThreads } from "../../state/threadHandoff"; import { useAtomCommand } from "../../state/use-atom-command"; import { useOpenLinkedThread, useOpenLinkedThreadRead } from "./useOpenLinkedThread"; +/** Machines an unasked connect was tried for; a failed one leaves the card's button after that. */ +const followTried = new Set(); + /** * A thread's move to a linked machine: waiting for its turn to end (with a way to keep it here), - * under way, moved (with a way to open it there), or failed (with a way to try again). + * under way, or failed (with a way to try again). A moved thread is followed to where it + * continues, pairing with that machine first when needed, so it reads as one thread; the card + * stays only when this device cannot reach the machine. */ export function ThreadHandoffCard({ thread }: { readonly thread: EnvironmentThreadShell }) { const gt = useGT(); @@ -32,6 +38,36 @@ export function ThreadHandoffCard({ thread }: { readonly thread: EnvironmentThre const [cancelling, setCancelling] = useState(false); const [dismissed, setDismissed] = useState(null); const handoff = thread.handoff; + const moved = handoff?.state === "departed" ? handoff : null; + const movedId = moved?.handoffId; + const connectedThere = + moved !== null && presentationById.get(moved.environmentId)?.connection.phase === "connected"; + const connection = useConnectLinkedEnvironment({ + viaEnvironmentId: thread.environmentId, + environmentId: moved?.environmentId ?? thread.environmentId, + threadId: moved?.threadId ?? thread.id, + label: moved?.label ?? "", + title: thread.title, + }); + const follow = useEffectEvent((reachable: boolean) => { + if (moved === null) return; + if (reachable) { + navigation.dispatch( + StackActions.replace("Thread", { + environmentId: moved.environmentId, + threadId: moved.threadId, + }), + ); + return; + } + if (followTried.has(moved.environmentId)) return; + followTried.add(moved.environmentId); + void connection.connect(); + }); + // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- a move the server reports takes the screen to the thread it continues as, pairing over the network first + useEffect(() => { + if (movedId !== undefined) follow(connectedThere); + }, [movedId, connectedThere]); if (handoff === null || (handoff.state === "failed" && dismissed === handoff.handoffId)) { return null; } @@ -72,7 +108,9 @@ export function ThreadHandoffCard({ thread }: { readonly thread: EnvironmentThre : handoff.state === "departing" ? gt("Moving to {machine}…", { machine }) : handoff.state === "departed" - ? gt("This thread continues on {machine}", { machine }) + ? connection.state.phase === "connecting" + ? gt("Connecting to {machine}…", { machine }) + : gt("This thread continues on {machine}", { machine }) : gt("Could not move to {machine}", { machine }); const detail = handoff.state === "pending" diff --git a/apps/mobile/src/features/threads/thread-handoff-row.tsx b/apps/mobile/src/features/threads/thread-handoff-row.tsx index 7158a9968bcc6..b9a3196e937b9 100644 --- a/apps/mobile/src/features/threads/thread-handoff-row.tsx +++ b/apps/mobile/src/features/threads/thread-handoff-row.tsx @@ -28,6 +28,7 @@ import { AppText as Text } from "../../components/ui/AppText"; import { SymbolView } from "../../components/ui/AppSymbol"; import { ProviderIcon, ProviderInstanceIcon } from "../../components/ProviderIcon"; import { environmentThreadDetails } from "../../state/threads"; +import { useEnvironments } from "../../state/environments"; import { serverEnvironment } from "../../state/server"; import { ThreadContextDivider } from "./thread-context-divider"; @@ -52,6 +53,28 @@ function handoffEndpointsAtom( }); } +/** Where a thread that moved from another machine picks up; what is above it happened there. */ +export function ThreadMovedDivider(props: { + environmentId: EnvironmentId | undefined; + iconColor: ColorValue; +}) { + const gt = useGT(); + const machine = useEnvironments().environments.find( + (environment) => environment.environmentId === props.environmentId, + )?.label; + return ( + + ); +} + /** A same-harness model or effort change. Shows only what changed. */ export function ThreadModelSwitchDivider(props: { environmentId: EnvironmentId; diff --git a/apps/mobile/src/i18n/translations/de.json b/apps/mobile/src/i18n/translations/de.json index db40098c6b7fc..9b37b89fbd8e4 100644 --- a/apps/mobile/src/i18n/translations/de.json +++ b/apps/mobile/src/i18n/translations/de.json @@ -4773,6 +4773,9 @@ "7417d72c5c18c78f": "Verschieben nach {machine} fehlgeschlagen", "b3da0064b6c4d977": "Wenn du eine Nachricht sendest, bleibt er stattdessen hier.", "6de54bd779ddbea2": "Diese Kopie ist schreibgeschützt.", + "f5845b85e968be0a": "Verbindung zu {machine} wird hergestellt…", + "5cb99caa0ee7d72d": "Von {machine} hierher verschoben", + "65285be62f1e3db4": "Von einem anderen Rechner hierher verschoben", "00de64d19d985ed3": "Hier behalten", "6ef05430a4278089": "Auf {machine} öffnen", "af227160f4ea1d2a": "Der Thread konnte nicht verschoben werden.", diff --git a/apps/mobile/src/i18n/translations/en.json b/apps/mobile/src/i18n/translations/en.json index a9ce33e1bee8a..6551127d9a502 100644 --- a/apps/mobile/src/i18n/translations/en.json +++ b/apps/mobile/src/i18n/translations/en.json @@ -4775,6 +4775,9 @@ "7417d72c5c18c78f": "Could not move to {machine}", "b3da0064b6c4d977": "Sending a message keeps it here instead.", "6de54bd779ddbea2": "This copy is read-only.", + "f5845b85e968be0a": "Connecting to {machine}…", + "5cb99caa0ee7d72d": "Moved here from {machine}", + "65285be62f1e3db4": "Moved here from another machine", "00de64d19d985ed3": "Keep it here", "6ef05430a4278089": "Open on {machine}", "af227160f4ea1d2a": "Could not move the thread.", diff --git a/apps/mobile/src/i18n/translations/es.json b/apps/mobile/src/i18n/translations/es.json index 17fce8fc720f7..40217de9d0059 100644 --- a/apps/mobile/src/i18n/translations/es.json +++ b/apps/mobile/src/i18n/translations/es.json @@ -4766,6 +4766,9 @@ "7417d72c5c18c78f": "No se pudo mover a {machine}", "b3da0064b6c4d977": "Si envías un mensaje, se queda aquí.", "6de54bd779ddbea2": "Esta copia es de solo lectura.", + "f5845b85e968be0a": "Conectando con {machine}…", + "5cb99caa0ee7d72d": "Movido aquí desde {machine}", + "65285be62f1e3db4": "Movido aquí desde otra máquina", "00de64d19d985ed3": "Dejarlo aquí", "6ef05430a4278089": "Abrir en {machine}", "af227160f4ea1d2a": "No se pudo mover el hilo.", diff --git a/apps/mobile/src/i18n/translations/fr.json b/apps/mobile/src/i18n/translations/fr.json index 556a8ff60e80e..ff134d55348cb 100644 --- a/apps/mobile/src/i18n/translations/fr.json +++ b/apps/mobile/src/i18n/translations/fr.json @@ -4767,6 +4767,9 @@ "7417d72c5c18c78f": "Impossible de déplacer vers {machine}", "b3da0064b6c4d977": "Envoyer un message le garde ici.", "6de54bd779ddbea2": "Cette copie est en lecture seule.", + "f5845b85e968be0a": "Connexion à {machine}…", + "5cb99caa0ee7d72d": "Déplacé ici depuis {machine}", + "65285be62f1e3db4": "Déplacé ici depuis une autre machine", "00de64d19d985ed3": "Le garder ici", "6ef05430a4278089": "Ouvrir sur {machine}", "af227160f4ea1d2a": "Impossible de déplacer le fil.", diff --git a/apps/mobile/src/i18n/translations/ja.json b/apps/mobile/src/i18n/translations/ja.json index ab65fa51defaa..c94a06975def0 100644 --- a/apps/mobile/src/i18n/translations/ja.json +++ b/apps/mobile/src/i18n/translations/ja.json @@ -4746,6 +4746,9 @@ "7417d72c5c18c78f": "{machine} に移動できませんでした", "b3da0064b6c4d977": "メッセージを送信すると、ここに残ります。", "6de54bd779ddbea2": "このコピーは読み取り専用です。", + "f5845b85e968be0a": "{machine} に接続中…", + "5cb99caa0ee7d72d": "{machine} からここに移動しました", + "65285be62f1e3db4": "別のマシンからここに移動しました", "00de64d19d985ed3": "ここに残す", "6ef05430a4278089": "{machine} で開く", "af227160f4ea1d2a": "スレッドを移動できませんでした。", diff --git a/apps/mobile/src/i18n/translations/ko.json b/apps/mobile/src/i18n/translations/ko.json index 382e80f42da15..53abbaae78cf0 100644 --- a/apps/mobile/src/i18n/translations/ko.json +++ b/apps/mobile/src/i18n/translations/ko.json @@ -4751,6 +4751,9 @@ "7417d72c5c18c78f": "{machine}(으)로 이동할 수 없습니다", "b3da0064b6c4d977": "메시지를 보내면 여기에 그대로 남습니다.", "6de54bd779ddbea2": "이 사본은 읽기 전용입니다.", + "f5845b85e968be0a": "{machine}에 연결 중…", + "5cb99caa0ee7d72d": "{machine}에서 여기로 이동됨", + "65285be62f1e3db4": "다른 머신에서 여기로 이동됨", "00de64d19d985ed3": "여기에 유지", "6ef05430a4278089": "{machine}에서 열기", "af227160f4ea1d2a": "스레드를 이동할 수 없습니다.", diff --git a/apps/mobile/src/i18n/translations/pt-BR.json b/apps/mobile/src/i18n/translations/pt-BR.json index 6333a2a0f501e..30ad964afdd48 100644 --- a/apps/mobile/src/i18n/translations/pt-BR.json +++ b/apps/mobile/src/i18n/translations/pt-BR.json @@ -4767,6 +4767,9 @@ "7417d72c5c18c78f": "Não foi possível mover para {machine}", "b3da0064b6c4d977": "Enviar uma mensagem a mantém aqui.", "6de54bd779ddbea2": "Esta cópia é somente leitura.", + "f5845b85e968be0a": "Conectando a {machine}…", + "5cb99caa0ee7d72d": "Movida para cá de {machine}", + "65285be62f1e3db4": "Movida para cá de outra máquina", "00de64d19d985ed3": "Manter aqui", "6ef05430a4278089": "Abrir em {machine}", "af227160f4ea1d2a": "Não foi possível mover a thread.", diff --git a/apps/mobile/src/i18n/translations/ru.json b/apps/mobile/src/i18n/translations/ru.json index a26602e85d6cd..166113f0568e2 100644 --- a/apps/mobile/src/i18n/translations/ru.json +++ b/apps/mobile/src/i18n/translations/ru.json @@ -4845,6 +4845,9 @@ "7417d72c5c18c78f": "Не удалось перенести на {machine}", "b3da0064b6c4d977": "Если отправить сообщение, он останется здесь.", "6de54bd779ddbea2": "Эта копия доступна только для чтения.", + "f5845b85e968be0a": "Подключение к {machine}…", + "5cb99caa0ee7d72d": "Перенесён сюда с {machine}", + "65285be62f1e3db4": "Перенесён сюда с другой машины", "00de64d19d985ed3": "Оставить здесь", "6ef05430a4278089": "Открыть на {machine}", "af227160f4ea1d2a": "Не удалось перенести тред.", diff --git a/apps/mobile/src/i18n/translations/sv.json b/apps/mobile/src/i18n/translations/sv.json index 80c87f70166c8..7a78fc1455d0f 100644 --- a/apps/mobile/src/i18n/translations/sv.json +++ b/apps/mobile/src/i18n/translations/sv.json @@ -4773,6 +4773,9 @@ "7417d72c5c18c78f": "Det gick inte att flytta till {machine}", "b3da0064b6c4d977": "Om du skickar ett meddelande stannar den här i stället.", "6de54bd779ddbea2": "Den här kopian är skrivskyddad.", + "f5845b85e968be0a": "Ansluter till {machine}…", + "5cb99caa0ee7d72d": "Flyttad hit från {machine}", + "65285be62f1e3db4": "Flyttad hit från en annan dator", "00de64d19d985ed3": "Behåll den här", "6ef05430a4278089": "Öppna på {machine}", "af227160f4ea1d2a": "Det gick inte att flytta tråden.", diff --git a/apps/mobile/src/i18n/translations/zh.json b/apps/mobile/src/i18n/translations/zh.json index 0903a6985c68a..4e9fe7ba1ce8d 100644 --- a/apps/mobile/src/i18n/translations/zh.json +++ b/apps/mobile/src/i18n/translations/zh.json @@ -4755,6 +4755,9 @@ "7417d72c5c18c78f": "无法移至 {machine}", "b3da0064b6c4d977": "发送消息会让它留在这里。", "6de54bd779ddbea2": "此副本为只读。", + "f5845b85e968be0a": "正在连接 {machine}…", + "5cb99caa0ee7d72d": "已从 {machine} 移至此处", + "65285be62f1e3db4": "已从另一台机器移至此处", "00de64d19d985ed3": "留在这里", "6ef05430a4278089": "在 {machine} 上打开", "af227160f4ea1d2a": "无法移动会话。", diff --git a/apps/server/src/orchestration-v2/ThreadImportService.ts b/apps/server/src/orchestration-v2/ThreadImportService.ts index e2164d8ec745b..285d71e5e5e01 100644 --- a/apps/server/src/orchestration-v2/ThreadImportService.ts +++ b/apps/server/src/orchestration-v2/ThreadImportService.ts @@ -1,7 +1,7 @@ import { CommandId, EventId, - MessageId, + threadMoveMessageId, type OrchestrationV2AppThread, type OrchestrationV2DomainEvent, type OrchestrationV2LinkOrigin, @@ -240,7 +240,13 @@ const make = Effect.gen(function* () { type: "message.dispatch", commandId: CommandId.make(`command:thread-import:${threadId}:continue`), threadId, - messageId: MessageId.make(`${threadId}:continue`), + messageId: threadMoveMessageId(threadId), + // Names where the thread came from; clients draw this message as the move's divider. + linkedSender: { + environmentId: input.source.environmentId, + threadId: input.source.threadId, + title: input.title, + }, text: input.continuationPrompt, attachments: [], modelSelection: input.modelSelection, diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index a519aa3c4161f..8bad370df1600 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -217,6 +217,7 @@ import { threadPullRequestPanelTarget } from "./pullRequest/pullRequestDetail.lo import { LinkPullRequestDialogHost } from "./pullRequest/LinkPullRequestDialog"; import { GuestPendingMessages } from "./chat/GuestShareControls"; import { + ThreadHandoffFollower, threadHandoffSendBlockReason, useThreadHandoffBannerItem, } from "./chat/ThreadHandoffBanner"; @@ -4356,6 +4357,7 @@ export default function ChatView(props: ChatViewProps) { onConfirm={onConfirmRevertStable} /> {embedded ? null : } + {embedded ? null : } diff --git a/apps/web/src/components/Sidebar.logic.ts b/apps/web/src/components/Sidebar.logic.ts index b8ef1505d567d..18eda6bf23fe1 100644 --- a/apps/web/src/components/Sidebar.logic.ts +++ b/apps/web/src/components/Sidebar.logic.ts @@ -4,7 +4,7 @@ import { resolveThreadConnectionStatus, resolveThreadWorkingStartedAt, } from "@t3tools/client-runtime/state/models"; -import { isShownUnderParent } from "@t3tools/client-runtime/state/threads"; +import { isShownUnderParent, movedThreadCopyKeys } from "@t3tools/client-runtime/state/threads"; import { backgroundWorkHoldsCompletion } from "@t3tools/shared/orchestrationV2PendingBackgroundWork"; import { threadPullRequestSearchTerms } from "@t3tools/shared/threadPullRequests"; import * as React from "react"; @@ -600,15 +600,18 @@ export async function deleteSelectedThreadEntries< export function filterSidebarV2VisibleThreads< T extends Pick & { projectId: string; + handoff?: SidebarThreadSummary["handoff"]; }, >( threads: readonly T[], scopedProjectKeys: ReadonlySet | null, delegatedUnderParent: ReadonlySet, ): T[] { + const movedCopies = movedThreadCopyKeys(threads); return threads.filter( (thread) => thread.archivedAt === null && + !movedCopies.has(scopedThreadKey(scopeThreadRef(thread.environmentId, thread.id))) && !isShownUnderParent( { environmentId: thread.environmentId, threadId: thread.id }, thread.lineage, diff --git a/apps/web/src/components/chat/LinkedThreadPage.tsx b/apps/web/src/components/chat/LinkedThreadPage.tsx index 0749f199083ee..e47b97b667d8e 100644 --- a/apps/web/src/components/chat/LinkedThreadPage.tsx +++ b/apps/web/src/components/chat/LinkedThreadPage.tsx @@ -21,6 +21,8 @@ export function LinkedThreadPage(props: { readonly viaEnvironmentId: EnvironmentId; readonly environmentId: EnvironmentId; readonly threadId: ThreadId; + /** Pair with the thread's environment at once instead of waiting for "Connect to interact". */ + readonly autoConnect?: boolean; }) { const { viaEnvironmentId, environmentId, threadId } = props; const gt = useGT(); @@ -52,6 +54,7 @@ export function LinkedThreadPage(props: { panelRef={null} surface={surface} visible + autoConnect={props.autoConnect === true} renderHeader={(title) => ( diff --git a/apps/web/src/components/chat/LinkedThreadPane.tsx b/apps/web/src/components/chat/LinkedThreadPane.tsx index 798ef2c80e405..1347d239907bf 100644 --- a/apps/web/src/components/chat/LinkedThreadPane.tsx +++ b/apps/web/src/components/chat/LinkedThreadPane.tsx @@ -2,7 +2,7 @@ import { isLinkedThreadWorking, linkedThreadFailure } from "@t3tools/client-runt import type { ScopedThreadRef } from "@t3tools/contracts"; import { T, useGT, useMessages, Var } from "gt-react"; import { EyeIcon, PlugIcon } from "lucide-react"; -import { useState, type ReactNode } from "react"; +import { useEffect, useEffectEvent, useState, type ReactNode } from "react"; import { useStableCallback } from "../../hooks/useStableCallback"; import { type LinkedThreadSurface, linkedThreadTitle } from "../../linkedThreadSurface"; @@ -67,6 +67,9 @@ function LinkedThreadComposer(props: { ); } +/** Environments an unasked connect was tried for; a failed one waits for the button after that. */ +const autoConnectTried = new Set(); + const NO_ATTACHMENT_URLS: ReadonlyMap = new Map(); const noAttachmentUrls = () => NO_ATTACHMENT_URLS; const ignore = () => {}; @@ -84,6 +87,8 @@ export function LinkedThread(props: { readonly visible: boolean; /** What sits above the timeline on the main screen; a tab already names the thread. */ readonly renderHeader?: (title: string) => ReactNode; + /** Connect once without being asked; what it cannot do alone is left to the button. */ + readonly autoConnect?: boolean; }) { const { surface, panelRef } = props; const gt = useGT(); @@ -96,6 +101,13 @@ export function LinkedThread(props: { const connection = useConnectLinkedEnvironment(panelRef, surface); const connectState = connection.state; const connecting = connectState.phase === "connecting"; + const autoConnect = useEffectEvent(() => { + if (props.autoConnect !== true || autoConnectTried.has(surface.environmentId)) return; + autoConnectTried.add(surface.environmentId); + void connection.connect({ unasked: true }); + }); + // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- pairing starts a network exchange with another machine, once when a moved thread opens + useEffect(() => autoConnect(), []); const connect = async () => { const outcome = await connection.connect(); if (outcome.type === "connected") { diff --git a/apps/web/src/components/chat/ThreadHandoffBanner.tsx b/apps/web/src/components/chat/ThreadHandoffBanner.tsx index 13dc312691678..8e832a854908f 100644 --- a/apps/web/src/components/chat/ThreadHandoffBanner.tsx +++ b/apps/web/src/components/chat/ThreadHandoffBanner.tsx @@ -6,7 +6,7 @@ import { squashAtomCommandFailure, } from "@t3tools/client-runtime/state/runtime"; import type { EnvironmentThreadShell } from "@t3tools/client-runtime/state/shell"; -import { useNavigate } from "@tanstack/react-router"; +import { Navigate, useNavigate } from "@tanstack/react-router"; import { msg, useGT } from "gt-react"; import { ArrowUpRightIcon, MonitorUpIcon, TriangleAlertIcon } from "lucide-react"; import { useState } from "react"; @@ -41,6 +41,32 @@ export function threadHandoffSendBlockReason( : resolve(msg("Continues on {machine}", { machine: handoff.label })); } +/** + * Takes the client to where a moved thread continues, so the conversation reads as one thread: + * its own connection to that machine when it has one, else a view over the link that pairs + * with the machine by itself. + */ +export function ThreadHandoffFollower({ + shell, +}: { + readonly shell: HandoffShell | null | undefined; +}) { + const connected = useConnectedEnvironmentIds(); + const handoff = shell?.handoff; + if (shell == null || handoff?.state !== "departed") return null; + const there = scopeThreadRef(handoff.environmentId, handoff.threadId); + return connected.includes(handoff.environmentId) ? ( + + ) : ( + + ); +} + /** * The notice for a thread's move to a linked machine: waiting (with a way to keep it here), * under way, moved (with a way to open it there), or failed (with a way to try again). diff --git a/apps/web/src/components/chat/TimelineUserMessageRow.tsx b/apps/web/src/components/chat/TimelineUserMessageRow.tsx index 4ec0b9e898237..b592a80fb51dd 100644 --- a/apps/web/src/components/chat/TimelineUserMessageRow.tsx +++ b/apps/web/src/components/chat/TimelineUserMessageRow.tsx @@ -6,6 +6,7 @@ import { T, useGT, useMessages, Var } from "gt-react"; import { findRevealRef } from "./markdownFindContext"; import { type EnvironmentId, + isThreadMoveMessage, type MessageId, type ScheduledTaskId, type ServerProviderSkill, @@ -38,11 +39,13 @@ import { EyeIcon, type LucideIcon, MessagesSquareIcon, + MonitorUpIcon, Redo2Icon, PencilIcon, LinkIcon, } from "lucide-react"; import { Button, InlineButton } from "../ui/button"; +import { TimelineSystemDivider } from "./TimelineSystemDivider"; import { FreshSessionRow, ModelSwitchRow } from "./V2LifecycleRow"; import { useAssetUrlRefresh, useAssetUrls, useAssetUrlState } from "../../assets/assetUrls"; import { AttachmentImage } from "../media/AttachmentImage"; @@ -289,6 +292,8 @@ function UserMessageContent({ row }: { row: Extract + ) : isThreadMoveMessage(row.message) ? ( + ) : resolveUserMessagePresentation(row.message).attribution === "automation" ? ( ) : ( @@ -296,6 +301,22 @@ function UserMessageContent({ row }: { row: Extract + ); +} + /** Automation prompts are long, repeated runbooks; a folded bubble keeps them out of the way. */ function AutomationMessageRow({ row }: { row: Extract }) { const ctx = use(TimelineRowCtx); diff --git a/apps/web/src/i18n/translations/de.json b/apps/web/src/i18n/translations/de.json index 9293b6013cd3e..052b25f6b7e8e 100644 --- a/apps/web/src/i18n/translations/de.json +++ b/apps/web/src/i18n/translations/de.json @@ -4356,6 +4356,8 @@ "e7ba3939542e8ee1": "Wird nach {machine} verschoben…", "c3f86e567586e075": "Dieser Thread wird auf {machine} fortgesetzt", "6de54bd779ddbea2": "Diese Kopie ist schreibgeschützt.", + "5cb99caa0ee7d72d": "Von {machine} hierher verschoben", + "65285be62f1e3db4": "Von einem anderen Rechner hierher verschoben", "6ef05430a4278089": "Auf {machine} öffnen", "7417d72c5c18c78f": "Verschieben nach {machine} fehlgeschlagen", "ac6f0547a17af482": "läuft", diff --git a/apps/web/src/i18n/translations/en.json b/apps/web/src/i18n/translations/en.json index 89c26e5b7be0f..39496aaf66a97 100644 --- a/apps/web/src/i18n/translations/en.json +++ b/apps/web/src/i18n/translations/en.json @@ -4355,6 +4355,8 @@ "e7ba3939542e8ee1": "Moving to {machine}…", "c3f86e567586e075": "This thread continues on {machine}", "6de54bd779ddbea2": "This copy is read-only.", + "5cb99caa0ee7d72d": "Moved here from {machine}", + "65285be62f1e3db4": "Moved here from another machine", "6ef05430a4278089": "Open on {machine}", "7417d72c5c18c78f": "Could not move to {machine}", "ac6f0547a17af482": "running", diff --git a/apps/web/src/i18n/translations/es.json b/apps/web/src/i18n/translations/es.json index 3c20895e88fa2..4b05832fc2c3b 100644 --- a/apps/web/src/i18n/translations/es.json +++ b/apps/web/src/i18n/translations/es.json @@ -4353,6 +4353,8 @@ "e7ba3939542e8ee1": "Moviendo a {machine}…", "c3f86e567586e075": "Este hilo continúa en {machine}", "6de54bd779ddbea2": "Esta copia es de solo lectura.", + "5cb99caa0ee7d72d": "Movido aquí desde {machine}", + "65285be62f1e3db4": "Movido aquí desde otra máquina", "6ef05430a4278089": "Abrir en {machine}", "7417d72c5c18c78f": "No se pudo mover a {machine}", "ac6f0547a17af482": "en curso", diff --git a/apps/web/src/i18n/translations/fr.json b/apps/web/src/i18n/translations/fr.json index b67b1f16753e4..83d8882c99c70 100644 --- a/apps/web/src/i18n/translations/fr.json +++ b/apps/web/src/i18n/translations/fr.json @@ -4354,6 +4354,8 @@ "e7ba3939542e8ee1": "Déplacement vers {machine}…", "c3f86e567586e075": "Ce fil se poursuit sur {machine}", "6de54bd779ddbea2": "Cette copie est en lecture seule.", + "5cb99caa0ee7d72d": "Déplacé ici depuis {machine}", + "65285be62f1e3db4": "Déplacé ici depuis une autre machine", "6ef05430a4278089": "Ouvrir sur {machine}", "7417d72c5c18c78f": "Impossible de déplacer vers {machine}", "ac6f0547a17af482": "en cours", diff --git a/apps/web/src/i18n/translations/ja.json b/apps/web/src/i18n/translations/ja.json index 8a44abd531a18..f9f8ba26f9abd 100644 --- a/apps/web/src/i18n/translations/ja.json +++ b/apps/web/src/i18n/translations/ja.json @@ -4343,6 +4343,8 @@ "e7ba3939542e8ee1": "{machine} に移動中…", "c3f86e567586e075": "このスレッドは {machine} で続いています", "6de54bd779ddbea2": "このコピーは読み取り専用です。", + "5cb99caa0ee7d72d": "{machine} からここに移動しました", + "65285be62f1e3db4": "別のマシンからここに移動しました", "6ef05430a4278089": "{machine} で開く", "7417d72c5c18c78f": "{machine} に移動できませんでした", "ac6f0547a17af482": "実行中", diff --git a/apps/web/src/i18n/translations/ko.json b/apps/web/src/i18n/translations/ko.json index eb25e226e8815..61be5c4237526 100644 --- a/apps/web/src/i18n/translations/ko.json +++ b/apps/web/src/i18n/translations/ko.json @@ -4340,6 +4340,8 @@ "e7ba3939542e8ee1": "{machine}(으)로 이동 중…", "c3f86e567586e075": "이 스레드는 {machine}에서 계속됩니다", "6de54bd779ddbea2": "이 사본은 읽기 전용입니다.", + "5cb99caa0ee7d72d": "{machine}에서 여기로 이동됨", + "65285be62f1e3db4": "다른 머신에서 여기로 이동됨", "6ef05430a4278089": "{machine}에서 열기", "7417d72c5c18c78f": "{machine}(으)로 이동할 수 없습니다", "ac6f0547a17af482": "실행 중", diff --git a/apps/web/src/i18n/translations/pt-BR.json b/apps/web/src/i18n/translations/pt-BR.json index fd33bda9377df..40e5bbcda2ec5 100644 --- a/apps/web/src/i18n/translations/pt-BR.json +++ b/apps/web/src/i18n/translations/pt-BR.json @@ -4353,6 +4353,8 @@ "e7ba3939542e8ee1": "Movendo para {machine}…", "c3f86e567586e075": "Esta thread continua em {machine}", "6de54bd779ddbea2": "Esta cópia é somente leitura.", + "5cb99caa0ee7d72d": "Movida para cá de {machine}", + "65285be62f1e3db4": "Movida para cá de outra máquina", "6ef05430a4278089": "Abrir em {machine}", "7417d72c5c18c78f": "Não foi possível mover para {machine}", "ac6f0547a17af482": "em execução", diff --git a/apps/web/src/i18n/translations/ru.json b/apps/web/src/i18n/translations/ru.json index f50e4c9e1456f..0deb8c76949b4 100644 --- a/apps/web/src/i18n/translations/ru.json +++ b/apps/web/src/i18n/translations/ru.json @@ -4353,6 +4353,8 @@ "e7ba3939542e8ee1": "Переносится на {machine}…", "c3f86e567586e075": "Этот тред продолжается на {machine}", "6de54bd779ddbea2": "Эта копия доступна только для чтения.", + "5cb99caa0ee7d72d": "Перенесён сюда с {machine}", + "65285be62f1e3db4": "Перенесён сюда с другой машины", "6ef05430a4278089": "Открыть на {machine}", "7417d72c5c18c78f": "Не удалось перенести на {machine}", "ac6f0547a17af482": "выполняется", diff --git a/apps/web/src/i18n/translations/sv.json b/apps/web/src/i18n/translations/sv.json index d5e30c91560dd..2776bb30bda84 100644 --- a/apps/web/src/i18n/translations/sv.json +++ b/apps/web/src/i18n/translations/sv.json @@ -4354,6 +4354,8 @@ "e7ba3939542e8ee1": "Flyttas till {machine}…", "c3f86e567586e075": "Den här tråden fortsätter på {machine}", "6de54bd779ddbea2": "Den här kopian är skrivskyddad.", + "5cb99caa0ee7d72d": "Flyttad hit från {machine}", + "65285be62f1e3db4": "Flyttad hit från en annan dator", "6ef05430a4278089": "Öppna på {machine}", "7417d72c5c18c78f": "Det gick inte att flytta till {machine}", "ac6f0547a17af482": "körs", diff --git a/apps/web/src/i18n/translations/zh.json b/apps/web/src/i18n/translations/zh.json index 712b5cb67e749..7ad14f41efe44 100644 --- a/apps/web/src/i18n/translations/zh.json +++ b/apps/web/src/i18n/translations/zh.json @@ -4359,6 +4359,8 @@ "e7ba3939542e8ee1": "正在移至 {machine}…", "c3f86e567586e075": "此会话已在 {machine} 上继续", "6de54bd779ddbea2": "此副本为只读。", + "5cb99caa0ee7d72d": "已从 {machine} 移至此处", + "65285be62f1e3db4": "已从另一台机器移至此处", "6ef05430a4278089": "在 {machine} 上打开", "7417d72c5c18c78f": "无法移至 {machine}", "ac6f0547a17af482": "运行中", diff --git a/apps/web/src/routes/_chat.linked.$viaEnvironmentId.$linkedEnvironmentId.$linkedThreadId.tsx b/apps/web/src/routes/_chat.linked.$viaEnvironmentId.$linkedEnvironmentId.$linkedThreadId.tsx index 85926925cd3d4..de9cc9cf414b4 100644 --- a/apps/web/src/routes/_chat.linked.$viaEnvironmentId.$linkedEnvironmentId.$linkedThreadId.tsx +++ b/apps/web/src/routes/_chat.linked.$viaEnvironmentId.$linkedEnvironmentId.$linkedThreadId.tsx @@ -8,13 +8,19 @@ import { LinkedThreadPage } from "../components/chat/LinkedThreadPage"; export const Route = createFileRoute( "/_chat/linked/$viaEnvironmentId/$linkedEnvironmentId/$linkedThreadId", )({ + // `connect` pairs this client with the thread's environment without being asked: a moved thread + // is the user's own, so it should take messages as soon as it can. + validateSearch: (search: Record): { readonly connect?: true } => + search.connect === true ? { connect: true } : {}, component: function LinkedThreadRoute() { const params = Route.useParams(); + const { connect } = Route.useSearch(); return ( ); }, diff --git a/apps/web/src/state/linkedThreadView.ts b/apps/web/src/state/linkedThreadView.ts index ee8e03493b6fd..fa0c6df2d67dd 100644 --- a/apps/web/src/state/linkedThreadView.ts +++ b/apps/web/src/state/linkedThreadView.ts @@ -206,7 +206,8 @@ export function useConnectLinkedEnvironment( setPrefill(prefill); void navigate({ to: "/settings/connections" }); }; - const connect = async () => { + /** `unasked` leaves a pairing code to the notice's button instead of opening Settings. */ + const connect = async (options?: { readonly unasked?: boolean }) => { setState({ phase: "connecting" }); const startedOn = router.state.location.href; let tabClosed = false; @@ -268,7 +269,7 @@ export function useConnectLinkedEnvironment( host: outcome.host, }; setState({ phase: "manual", prefill }); - if (stayed()) addWithCode(prefill); + if (stayed() && options?.unasked !== true) addWithCode(prefill); return outcome; }; return { state, connect, addWithCode }; diff --git a/packages/client-runtime/src/state/threadShell.test.ts b/packages/client-runtime/src/state/threadShell.test.ts index 9b91d9509831b..8549603e1d86f 100644 --- a/packages/client-runtime/src/state/threadShell.test.ts +++ b/packages/client-runtime/src/state/threadShell.test.ts @@ -15,11 +15,13 @@ import { describe, expect, it } from "vite-plus/test"; import { PrimaryConnectionTarget } from "../connection/model.ts"; import type { EnvironmentConnectionPhase } from "../connection/presentation.ts"; import { v2Now, v2ShellSnapshot, v2ThreadShell } from "./orchestrationV2TestFixtures.ts"; +import { threadKey } from "./entities.ts"; import { applyShellStreamEvent } from "./shellReducer.ts"; import { isThreadWorking } from "./threadInbox.ts"; import { childThreadInputsTitle, createEnvironmentThreadShellAtoms, + movedThreadCopyKeys, resolveListedAncestorThreadRef, } from "./threadShell.ts"; @@ -771,6 +773,32 @@ describe("v2 thread shell lists", () => { }); }); +describe("movedThreadCopyKeys", () => { + it("hides a moved thread's copy only where its continuation is listed too", () => { + const box = EnvironmentId.make("environment-box"); + const elsewhere = EnvironmentId.make("environment-elsewhere"); + const departed = (id: string, to: EnvironmentId, threadId: string) => ({ + environmentId, + id: ThreadId.make(id), + handoff: { + state: "departed" as const, + handoffId: id, + environmentId: to, + label: "Box", + threadId: ThreadId.make(threadId), + }, + }); + const keys = movedThreadCopyKeys([ + departed("thread-followed", box, "thread-there"), + departed("thread-out-of-reach", elsewhere, "thread-unlisted"), + { environmentId: box, id: ThreadId.make("thread-there"), handoff: null }, + ]); + expect([...keys]).toEqual([ + threadKey({ environmentId, threadId: ThreadId.make("thread-followed") }), + ]); + }); +}); + describe("resolveListedAncestorThreadRef", () => { type Thread = Parameters[1][number]; const otherEnvironmentId = EnvironmentId.make("environment-other"); diff --git a/packages/client-runtime/src/state/threadShell.ts b/packages/client-runtime/src/state/threadShell.ts index 62ec6ef90f103..7ebe555c69e6d 100644 --- a/packages/client-runtime/src/state/threadShell.ts +++ b/packages/client-runtime/src/state/threadShell.ts @@ -70,6 +70,36 @@ export function isShownUnderParent( return !isListedThreadLineage(lineage) || delegatedUnderParent.has(threadKey(ref)); } +/** + * Keys of the copies that moved threads left behind, where this client also lists the thread + * they continue as. The two are one conversation, so lists show only where it continues. A copy + * whose continuation the client cannot list stays, and opening it follows the move. + */ +export function movedThreadCopyKeys( + threads: Iterable< + Pick & { + readonly handoff?: EnvironmentThreadShell["handoff"]; + } + >, +): ReadonlySet { + const departed: Array<{ readonly key: string; readonly continuesAs: string }> = []; + const listed = new Set(); + for (const thread of threads) { + const key = threadKey({ environmentId: thread.environmentId, threadId: thread.id }); + listed.add(key); + if (thread.handoff?.state === "departed") { + departed.push({ + key, + continuesAs: threadKey({ + environmentId: thread.handoff.environmentId, + threadId: thread.handoff.threadId, + }), + }); + } + } + return new Set(departed.flatMap((copy) => (listed.has(copy.continuesAs) ? [copy.key] : []))); +} + // Subagents, side chats and tasks delegated from a listed parent have no list row, // so an open one is represented by its nearest listed ancestor. A broken chain // (missing or archived parent, cycle) resolves to the thread itself, which then matches no row. @@ -806,6 +836,15 @@ export function createEnvironmentThreadShellAtoms(input: { next.push(scopedThread(environmentId, thread, subagentRequests, connectionPhase)); } } + const movedCopies = movedThreadCopyKeys(next); + if (movedCopies.size > 0) { + const listed = next.filter( + (thread) => + !movedCopies.has(threadKey({ environmentId: thread.environmentId, threadId: thread.id })), + ); + next.length = 0; + next.push(...listed); + } if (arrayElementsEqual(previousNavigationShells, next)) return previousNavigationShells; previousNavigationShells = next; return next; diff --git a/packages/contracts/src/orchestratorMcp.ts b/packages/contracts/src/orchestratorMcp.ts index a73043e6dafec..06eefff9f0ae2 100644 --- a/packages/contracts/src/orchestratorMcp.ts +++ b/packages/contracts/src/orchestratorMcp.ts @@ -724,6 +724,19 @@ export const OrchestratorMcpThreadImportInput = Schema.Struct({ }); export type OrchestratorMcpThreadImportInput = typeof OrchestratorMcpThreadImportInput.Type; +/** The message that starts a moved thread's first turn where it landed. */ +export const threadMoveMessageId = (threadId: ThreadId) => MessageId.make(`${threadId}:continue`); + +/** + * Whether a user message is the one a move started the thread with. It names the thread it + * came from as its sender, and clients draw it as a divider instead of a message. + */ +export const isThreadMoveMessage = (message: { + readonly id: string; + readonly linkedSender?: unknown; +}): boolean => + message.linkedSender !== undefined && /^thread:import:[0-9a-f]+:continue$/.test(message.id); + export const OrchestratorMcpThreadImportResult = Schema.Struct({ threadId: ThreadId, projectId: ProjectId, From b119458f7cdbe0c7556fc01cd65e14045b90b223 Mon Sep 17 00:00:00 2001 From: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Date: Sat, 28 Nov 2026 01:27:20 -0800 Subject: [PATCH 03/14] feat(web,mobile): the moved-thread divider names both machines The divider reads like a context handoff: "Thread moved", then the machine the thread left and the one it arrived on, each with its machine icon. A read-only view, which has no environment of its own, names only where the thread came from. On mobile the divider brings its own space above, since imported messages have no footer row. Co-Authored-By: Claude Fable 5.2 --- .../src/features/threads/ThreadFeed.tsx | 3 +- .../features/threads/thread-handoff-row.tsx | 64 +++++++++++++++---- apps/mobile/src/i18n/translations/de.json | 5 +- apps/mobile/src/i18n/translations/en.json | 5 +- apps/mobile/src/i18n/translations/es.json | 5 +- apps/mobile/src/i18n/translations/fr.json | 5 +- apps/mobile/src/i18n/translations/ja.json | 5 +- apps/mobile/src/i18n/translations/ko.json | 5 +- apps/mobile/src/i18n/translations/pt-BR.json | 5 +- apps/mobile/src/i18n/translations/ru.json | 5 +- apps/mobile/src/i18n/translations/sv.json | 5 +- apps/mobile/src/i18n/translations/zh.json | 5 +- .../chat/TimelineUserMessageRow.tsx | 50 ++++++++++++--- 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 +- 23 files changed, 153 insertions(+), 64 deletions(-) diff --git a/apps/mobile/src/features/threads/ThreadFeed.tsx b/apps/mobile/src/features/threads/ThreadFeed.tsx index 199a07ba75634..a387f9c8b01db 100644 --- a/apps/mobile/src/features/threads/ThreadFeed.tsx +++ b/apps/mobile/src/features/threads/ThreadFeed.tsx @@ -2341,7 +2341,8 @@ function renderFeedEntry( if (isUser && isThreadMoveMessage(message)) { return ( ); diff --git a/apps/mobile/src/features/threads/thread-handoff-row.tsx b/apps/mobile/src/features/threads/thread-handoff-row.tsx index b9a3196e937b9..1b86071428718 100644 --- a/apps/mobile/src/features/threads/thread-handoff-row.tsx +++ b/apps/mobile/src/features/threads/thread-handoff-row.tsx @@ -12,6 +12,7 @@ import { resolveProviderInstanceDisplayName, shouldShowInstanceBadge, } from "@t3tools/client-runtime/state/provider-instance-display"; +import { resolveEnvironmentMachineKind } from "@t3tools/contracts"; import type { EnvironmentId, ModelSelection, @@ -28,6 +29,7 @@ import { AppText as Text } from "../../components/ui/AppText"; import { SymbolView } from "../../components/ui/AppSymbol"; import { ProviderIcon, ProviderInstanceIcon } from "../../components/ProviderIcon"; import { environmentThreadDetails } from "../../state/threads"; +import { EnvironmentMachineSymbol } from "../../components/EnvironmentMachineSymbol"; import { useEnvironments } from "../../state/environments"; import { serverEnvironment } from "../../state/server"; import { ThreadContextDivider } from "./thread-context-divider"; @@ -53,25 +55,59 @@ function handoffEndpointsAtom( }); } -/** Where a thread that moved from another machine picks up; what is above it happened there. */ +/** + * Where a thread that moved from another machine picks up; what is above it happened there. + * Drawn as a context handoff is, with the two machines in place of the two models. + */ export function ThreadMovedDivider(props: { - environmentId: EnvironmentId | undefined; + fromEnvironmentId: EnvironmentId | undefined; + toEnvironmentId: EnvironmentId; iconColor: ColorValue; }) { const gt = useGT(); - const machine = useEnvironments().environments.find( - (environment) => environment.environmentId === props.environmentId, - )?.label; + const { environments } = useEnvironments(); + const find = (id: EnvironmentId | undefined) => + environments.find((environment) => environment.environmentId === id); + const from = find(props.fromEnvironmentId); + const to = find(props.toEnvironmentId); + const endpoint = (environment: NonNullable) => ( + + + + {environment.label} + + + ); + const arrives = to !== undefined && to.environmentId !== from?.environmentId ? to : null; return ( - + // Imported messages above have no footer row, so the divider brings its own space. + + + + {from === undefined ? ( + {gt("from another machine")} + ) : ( + endpoint(from) + )} + {arrives !== null ? ( + <> + + {endpoint(arrives)} + + ) : null} + + + ); } diff --git a/apps/mobile/src/i18n/translations/de.json b/apps/mobile/src/i18n/translations/de.json index 9b37b89fbd8e4..a468255f2633b 100644 --- a/apps/mobile/src/i18n/translations/de.json +++ b/apps/mobile/src/i18n/translations/de.json @@ -4774,8 +4774,9 @@ "b3da0064b6c4d977": "Wenn du eine Nachricht sendest, bleibt er stattdessen hier.", "6de54bd779ddbea2": "Diese Kopie ist schreibgeschützt.", "f5845b85e968be0a": "Verbindung zu {machine} wird hergestellt…", - "5cb99caa0ee7d72d": "Von {machine} hierher verschoben", - "65285be62f1e3db4": "Von einem anderen Rechner hierher verschoben", + "b5ff56c423bb517c": "Thread verschoben", + "df81ee52b275f2cb": "Thread verschoben von", + "fa7716793d9cd5e6": "von einem anderen Rechner", "00de64d19d985ed3": "Hier behalten", "6ef05430a4278089": "Auf {machine} öffnen", "af227160f4ea1d2a": "Der Thread konnte nicht verschoben werden.", diff --git a/apps/mobile/src/i18n/translations/en.json b/apps/mobile/src/i18n/translations/en.json index 6551127d9a502..4ecee6c9bc99d 100644 --- a/apps/mobile/src/i18n/translations/en.json +++ b/apps/mobile/src/i18n/translations/en.json @@ -4776,8 +4776,9 @@ "b3da0064b6c4d977": "Sending a message keeps it here instead.", "6de54bd779ddbea2": "This copy is read-only.", "f5845b85e968be0a": "Connecting to {machine}…", - "5cb99caa0ee7d72d": "Moved here from {machine}", - "65285be62f1e3db4": "Moved here from another machine", + "b5ff56c423bb517c": "Thread moved", + "df81ee52b275f2cb": "Thread moved from", + "fa7716793d9cd5e6": "from another machine", "00de64d19d985ed3": "Keep it here", "6ef05430a4278089": "Open on {machine}", "af227160f4ea1d2a": "Could not move the thread.", diff --git a/apps/mobile/src/i18n/translations/es.json b/apps/mobile/src/i18n/translations/es.json index 40217de9d0059..8f301672e76a7 100644 --- a/apps/mobile/src/i18n/translations/es.json +++ b/apps/mobile/src/i18n/translations/es.json @@ -4767,8 +4767,9 @@ "b3da0064b6c4d977": "Si envías un mensaje, se queda aquí.", "6de54bd779ddbea2": "Esta copia es de solo lectura.", "f5845b85e968be0a": "Conectando con {machine}…", - "5cb99caa0ee7d72d": "Movido aquí desde {machine}", - "65285be62f1e3db4": "Movido aquí desde otra máquina", + "b5ff56c423bb517c": "Hilo movido", + "df81ee52b275f2cb": "Hilo movido desde", + "fa7716793d9cd5e6": "desde otra máquina", "00de64d19d985ed3": "Dejarlo aquí", "6ef05430a4278089": "Abrir en {machine}", "af227160f4ea1d2a": "No se pudo mover el hilo.", diff --git a/apps/mobile/src/i18n/translations/fr.json b/apps/mobile/src/i18n/translations/fr.json index ff134d55348cb..8a8056f7e9e58 100644 --- a/apps/mobile/src/i18n/translations/fr.json +++ b/apps/mobile/src/i18n/translations/fr.json @@ -4768,8 +4768,9 @@ "b3da0064b6c4d977": "Envoyer un message le garde ici.", "6de54bd779ddbea2": "Cette copie est en lecture seule.", "f5845b85e968be0a": "Connexion à {machine}…", - "5cb99caa0ee7d72d": "Déplacé ici depuis {machine}", - "65285be62f1e3db4": "Déplacé ici depuis une autre machine", + "b5ff56c423bb517c": "Fil déplacé", + "df81ee52b275f2cb": "Fil déplacé depuis", + "fa7716793d9cd5e6": "depuis une autre machine", "00de64d19d985ed3": "Le garder ici", "6ef05430a4278089": "Ouvrir sur {machine}", "af227160f4ea1d2a": "Impossible de déplacer le fil.", diff --git a/apps/mobile/src/i18n/translations/ja.json b/apps/mobile/src/i18n/translations/ja.json index c94a06975def0..4ac6089485d44 100644 --- a/apps/mobile/src/i18n/translations/ja.json +++ b/apps/mobile/src/i18n/translations/ja.json @@ -4747,8 +4747,9 @@ "b3da0064b6c4d977": "メッセージを送信すると、ここに残ります。", "6de54bd779ddbea2": "このコピーは読み取り専用です。", "f5845b85e968be0a": "{machine} に接続中…", - "5cb99caa0ee7d72d": "{machine} からここに移動しました", - "65285be62f1e3db4": "別のマシンからここに移動しました", + "b5ff56c423bb517c": "スレッドを移動", + "df81ee52b275f2cb": "スレッドの移動元:", + "fa7716793d9cd5e6": "別のマシンから", "00de64d19d985ed3": "ここに残す", "6ef05430a4278089": "{machine} で開く", "af227160f4ea1d2a": "スレッドを移動できませんでした。", diff --git a/apps/mobile/src/i18n/translations/ko.json b/apps/mobile/src/i18n/translations/ko.json index 53abbaae78cf0..a2b7b3ccc920c 100644 --- a/apps/mobile/src/i18n/translations/ko.json +++ b/apps/mobile/src/i18n/translations/ko.json @@ -4752,8 +4752,9 @@ "b3da0064b6c4d977": "메시지를 보내면 여기에 그대로 남습니다.", "6de54bd779ddbea2": "이 사본은 읽기 전용입니다.", "f5845b85e968be0a": "{machine}에 연결 중…", - "5cb99caa0ee7d72d": "{machine}에서 여기로 이동됨", - "65285be62f1e3db4": "다른 머신에서 여기로 이동됨", + "b5ff56c423bb517c": "스레드 이동됨", + "df81ee52b275f2cb": "스레드 이동 출처:", + "fa7716793d9cd5e6": "다른 머신에서", "00de64d19d985ed3": "여기에 유지", "6ef05430a4278089": "{machine}에서 열기", "af227160f4ea1d2a": "스레드를 이동할 수 없습니다.", diff --git a/apps/mobile/src/i18n/translations/pt-BR.json b/apps/mobile/src/i18n/translations/pt-BR.json index 30ad964afdd48..e2a0d32e52dfd 100644 --- a/apps/mobile/src/i18n/translations/pt-BR.json +++ b/apps/mobile/src/i18n/translations/pt-BR.json @@ -4768,8 +4768,9 @@ "b3da0064b6c4d977": "Enviar uma mensagem a mantém aqui.", "6de54bd779ddbea2": "Esta cópia é somente leitura.", "f5845b85e968be0a": "Conectando a {machine}…", - "5cb99caa0ee7d72d": "Movida para cá de {machine}", - "65285be62f1e3db4": "Movida para cá de outra máquina", + "b5ff56c423bb517c": "Thread movida", + "df81ee52b275f2cb": "Thread movida de", + "fa7716793d9cd5e6": "de outra máquina", "00de64d19d985ed3": "Manter aqui", "6ef05430a4278089": "Abrir em {machine}", "af227160f4ea1d2a": "Não foi possível mover a thread.", diff --git a/apps/mobile/src/i18n/translations/ru.json b/apps/mobile/src/i18n/translations/ru.json index 166113f0568e2..69db772201238 100644 --- a/apps/mobile/src/i18n/translations/ru.json +++ b/apps/mobile/src/i18n/translations/ru.json @@ -4846,8 +4846,9 @@ "b3da0064b6c4d977": "Если отправить сообщение, он останется здесь.", "6de54bd779ddbea2": "Эта копия доступна только для чтения.", "f5845b85e968be0a": "Подключение к {machine}…", - "5cb99caa0ee7d72d": "Перенесён сюда с {machine}", - "65285be62f1e3db4": "Перенесён сюда с другой машины", + "b5ff56c423bb517c": "Тред перенесён", + "df81ee52b275f2cb": "Тред перенесён с", + "fa7716793d9cd5e6": "с другой машины", "00de64d19d985ed3": "Оставить здесь", "6ef05430a4278089": "Открыть на {machine}", "af227160f4ea1d2a": "Не удалось перенести тред.", diff --git a/apps/mobile/src/i18n/translations/sv.json b/apps/mobile/src/i18n/translations/sv.json index 7a78fc1455d0f..0771fe1d1ded4 100644 --- a/apps/mobile/src/i18n/translations/sv.json +++ b/apps/mobile/src/i18n/translations/sv.json @@ -4774,8 +4774,9 @@ "b3da0064b6c4d977": "Om du skickar ett meddelande stannar den här i stället.", "6de54bd779ddbea2": "Den här kopian är skrivskyddad.", "f5845b85e968be0a": "Ansluter till {machine}…", - "5cb99caa0ee7d72d": "Flyttad hit från {machine}", - "65285be62f1e3db4": "Flyttad hit från en annan dator", + "b5ff56c423bb517c": "Tråd flyttad", + "df81ee52b275f2cb": "Tråd flyttad från", + "fa7716793d9cd5e6": "från en annan dator", "00de64d19d985ed3": "Behåll den här", "6ef05430a4278089": "Öppna på {machine}", "af227160f4ea1d2a": "Det gick inte att flytta tråden.", diff --git a/apps/mobile/src/i18n/translations/zh.json b/apps/mobile/src/i18n/translations/zh.json index 4e9fe7ba1ce8d..dd3309b8acaa8 100644 --- a/apps/mobile/src/i18n/translations/zh.json +++ b/apps/mobile/src/i18n/translations/zh.json @@ -4756,8 +4756,9 @@ "b3da0064b6c4d977": "发送消息会让它留在这里。", "6de54bd779ddbea2": "此副本为只读。", "f5845b85e968be0a": "正在连接 {machine}…", - "5cb99caa0ee7d72d": "已从 {machine} 移至此处", - "65285be62f1e3db4": "已从另一台机器移至此处", + "b5ff56c423bb517c": "会话已移动", + "df81ee52b275f2cb": "会话移自", + "fa7716793d9cd5e6": "来自另一台机器", "00de64d19d985ed3": "留在这里", "6ef05430a4278089": "在 {machine} 上打开", "af227160f4ea1d2a": "无法移动会话。", diff --git a/apps/web/src/components/chat/TimelineUserMessageRow.tsx b/apps/web/src/components/chat/TimelineUserMessageRow.tsx index b592a80fb51dd..5285870e294ba 100644 --- a/apps/web/src/components/chat/TimelineUserMessageRow.tsx +++ b/apps/web/src/components/chat/TimelineUserMessageRow.tsx @@ -16,7 +16,8 @@ import { scopeThreadRef } from "@t3tools/client-runtime/environment"; import { resolveUserMessagePresentation } from "@t3tools/client-runtime/user-message"; import { Link } from "@tanstack/react-router"; import { useQuietThreadShell } from "../../state/entities"; -import { useEnvironment } from "../../state/environments"; +import { useEnvironment, useEnvironmentMachines } from "../../state/environments"; +import { EnvironmentMachineIcon } from "../EnvironmentMachineIcon"; import { useEnvironmentQuery } from "../../state/query"; import { serverEnvironment } from "../../state/server"; import { replaceComposerContextReferences } from "@t3tools/shared/composerContextReferences"; @@ -33,6 +34,7 @@ import { } from "../../types"; import ChatMarkdown from "../ChatMarkdown"; import { + ArrowRightIcon, CalendarClockIcon, ChevronDownIcon, DownloadIcon, @@ -293,7 +295,10 @@ function UserMessageContent({ row }: { row: Extract ) : isThreadMoveMessage(row.message) ? ( - + ) : resolveUserMessagePresentation(row.message).attribution === "automation" ? ( ) : ( @@ -301,17 +306,44 @@ function UserMessageContent({ row }: { row: Extract) => ( + + + {environment.label} + + ); + const arrives = to !== null && to.environmentId !== from?.environmentId ? to : null; return ( + {from === null ? gt("from another machine") : endpoint(from)} + {arrives !== null ? ( + <> +