Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions apps/mobile/src/features/threads/ThreadHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export function ThreadHeader(props: {
readonly hasThreadCwd: boolean;
readonly inspectorMode: ThreadInspectorMode | null;
readonly onOpenFilesInspector: () => void;
/** Present only on a delegated child the user may pop out. */
readonly onPopOut?: () => void;
}) {
const gt = useGT();
const m = useMessages();
Expand All @@ -44,6 +46,16 @@ export function ThreadHeader(props: {
},
]
: [];
if (props.onPopOut) {
actions.push({
accessibilityLabel: gt("Pop out to top level"),
icon: "arrow.up.right.circle",
subtitle: gt("Make it an ordinary thread"),
overflowOnly: true,
separateBackground: false,
onPress: props.onPopOut,
});
}
const menus = [gitMenu, terminalMenu].filter((menu): menu is AppBarMenu => menu !== null);

return (
Expand Down
45 changes: 44 additions & 1 deletion apps/mobile/src/features/threads/ThreadRouteScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ import { useSelectedThreadGitState } from "../../state/use-selected-thread-git-s
import { useSelectedThreadRequests } from "../../state/use-selected-thread-requests";
import { useSelectedThreadWorktree } from "../../state/use-selected-thread-worktree";
import { useThreadComposerState } from "../../state/use-thread-composer-state";
import { resolveMergeBackTargetThreadId } from "@t3tools/client-runtime/state/thread-relationships";
import {
resolveMergeBackTargetThreadId,
threadPopOutAvailability,
} from "@t3tools/client-runtime/state/thread-relationships";
import { resolveLatestMergeBackRun } from "@t3tools/client-runtime/state/thread-workflows";
import { threadEnvironment } from "../../state/threads";
import {
Expand Down Expand Up @@ -466,6 +469,45 @@ function ThreadRouteContent(
const navigation = useNavigation();
const selectDetail = useSelectWorkspaceDetail();
const openPullRequest = useOpenPullRequest();
const popOut = useAtomCommand(threadEnvironment.popOut, { reportFailure: false });
const popOutBusyRef = useRef(false);
const popOutAvailability =
selectedThread && canOperateThread
? threadPopOutAvailability(selectedThread.source)
: "unsupported";
const handlePopOut = () => {
if (!selectedThread || popOutBusyRef.current) return;
if (popOutAvailability === "blocked") {
Dialog.alert(gt("Can't pop out yet"), gt("Wait for it to finish or stop it first."));
return;
}
const environmentId = selectedThread.environmentId;
const threadId = selectedThread.id;
Dialog.confirm({
title: gt("Pop out to top level?"),
message: gt(
"It becomes an ordinary thread in your list and stops reporting to the thread that started it.",
),
confirmText: gt("Pop out"),
onConfirm: () => {
if (popOutBusyRef.current) return;
popOutBusyRef.current = true;
void popOut({ environmentId, input: { threadId } })
.then((result) => {
if (result._tag === "Failure" && !isAtomCommandInterrupted(result)) {
const error = squashAtomCommandFailure(result);
Dialog.alert(
gt("Could not pop out thread"),
error instanceof Error ? error.message : gt("Try again."),
);
}
})
.finally(() => {
popOutBusyRef.current = false;
});
},
});
};
const mergeBack = useAtomCommand(threadEnvironment.mergeBack, "merge thread back");
const mergeBackTargetThreadId = resolveMergeBackTargetThreadId(selectedThreadDetail);
const mergeBackRun =
Expand Down Expand Up @@ -1059,6 +1101,7 @@ function ThreadRouteContent(
inspectorMode={inspectorMode}
onOpenFilesInspector={handleOpenFilesInspector}
onReturnToThread={props.onReturnToThread}
onPopOut={popOutAvailability === "unsupported" ? undefined : handlePopOut}
/>
)
}
Expand Down
8 changes: 8 additions & 0 deletions apps/mobile/src/i18n/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -4800,6 +4800,8 @@
"7fa8a4d836b4d075": "Dieser Rechner hat keine verknüpften Rechner. Verknüpfe einen in den Einstellungen der Desktop- oder Web-App.",
"05ba3b5f06a7acfe": "Dateien schließen",
"c7e4f052c3d6c066": "Dateien öffnen",
"c440ceeaf0452d52": "Auf oberste Ebene verschieben",
"8dcc52104281c7d2": "In einen normalen Thread umwandeln",
"740ee1b96278f02f": "Audio · {size}",
"93ade1a4fd485bc3": "Audio",
"e8043d133bb85048": "Audio pausieren",
Expand Down Expand Up @@ -4835,6 +4837,12 @@
"d506b798402041ab": "Jetzt senden",
"9a62f694ba5c35c5": "Thread wird geöffnet…",
"bb24a2960c689a20": "Dieser Thread ist im aktuellen mobilen Snapshot nicht verfügbar.",
"172e0baea818e9aa": "Verschieben noch nicht möglich",
"dd4ea2dfb2476c35": "Warte, bis er fertig ist, oder stoppe ihn zuerst.",
"4249bde5600d6792": "Auf oberste Ebene verschieben?",
"b000660ae40f4586": "Er wird zu einem normalen Thread in deiner Liste und meldet keine Ergebnisse mehr an den Thread, der ihn gestartet hat.",
"8df226bf3314e35d": "Verschieben",
"84eccdaa4d8f3c01": "Thread konnte nicht verschoben werden",
"41ca8f475c481866": "Subagent von {title}",
"f3e00e6c416eab38": "Von {origin}",
"bdfb9e7660ab25d3": "Thread konnte nicht fortgesetzt werden",
Expand Down
8 changes: 8 additions & 0 deletions apps/mobile/src/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4802,6 +4802,8 @@
"7fa8a4d836b4d075": "This machine has no linked machines. Link one in Settings on desktop or web.",
"05ba3b5f06a7acfe": "Close files",
"c7e4f052c3d6c066": "Open files",
"c440ceeaf0452d52": "Pop out to top level",
"8dcc52104281c7d2": "Make it an ordinary thread",
"740ee1b96278f02f": "Audio · {size}",
"93ade1a4fd485bc3": "Audio",
"e8043d133bb85048": "Pause audio",
Expand Down Expand Up @@ -4837,6 +4839,12 @@
"d506b798402041ab": "Send now",
"9a62f694ba5c35c5": "Opening thread…",
"bb24a2960c689a20": "This thread is not available in the current mobile snapshot.",
"172e0baea818e9aa": "Can't pop out yet",
"dd4ea2dfb2476c35": "Wait for it to finish or stop it first.",
"4249bde5600d6792": "Pop out to top level?",
"b000660ae40f4586": "It becomes an ordinary thread in your list and stops reporting to the thread that started it.",
"8df226bf3314e35d": "Pop out",
"84eccdaa4d8f3c01": "Could not pop out thread",
"41ca8f475c481866": "Subagent of {title}",
"f3e00e6c416eab38": "From {origin}",
"bdfb9e7660ab25d3": "Could not resume thread",
Expand Down
8 changes: 8 additions & 0 deletions apps/mobile/src/i18n/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -4793,6 +4793,8 @@
"7fa8a4d836b4d075": "Esta máquina no tiene máquinas vinculadas. Vincula una en Ajustes desde la app de escritorio o la web.",
"05ba3b5f06a7acfe": "Cerrar archivos",
"c7e4f052c3d6c066": "Abrir archivos",
"c440ceeaf0452d52": "Mover al nivel superior",
"8dcc52104281c7d2": "Convertir en un hilo normal",
"740ee1b96278f02f": "Audio · {size}",
"93ade1a4fd485bc3": "Audio",
"e8043d133bb85048": "Pausar audio",
Expand Down Expand Up @@ -4828,6 +4830,12 @@
"d506b798402041ab": "Enviar ahora",
"9a62f694ba5c35c5": "Abriendo hilo…",
"bb24a2960c689a20": "Este hilo no está disponible en la instantánea móvil actual.",
"172e0baea818e9aa": "Aún no se puede mover",
"dd4ea2dfb2476c35": "Espera a que termine o detenlo primero.",
"4249bde5600d6792": "¿Mover al nivel superior?",
"b000660ae40f4586": "Se convierte en un hilo normal de tu lista y deja de enviar resultados al hilo que lo inició.",
"8df226bf3314e35d": "Mover",
"84eccdaa4d8f3c01": "No se pudo mover el hilo",
"41ca8f475c481866": "Subagente de {title}",
"f3e00e6c416eab38": "De {origin}",
"bdfb9e7660ab25d3": "No se pudo reanudar el hilo",
Expand Down
8 changes: 8 additions & 0 deletions apps/mobile/src/i18n/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -4794,6 +4794,8 @@
"7fa8a4d836b4d075": "Cette machine n’a aucune machine associée. Associez-en une dans les Paramètres de l’app de bureau ou du web.",
"05ba3b5f06a7acfe": "Fermer les fichiers",
"c7e4f052c3d6c066": "Ouvrir les fichiers",
"c440ceeaf0452d52": "Déplacer au premier niveau",
"8dcc52104281c7d2": "En faire un fil ordinaire",
"740ee1b96278f02f": "Audio · {size}",
"93ade1a4fd485bc3": "Audio",
"e8043d133bb85048": "Mettre l’audio en pause",
Expand Down Expand Up @@ -4829,6 +4831,12 @@
"d506b798402041ab": "Envoyer maintenant",
"9a62f694ba5c35c5": "Ouverture du fil…",
"bb24a2960c689a20": "Ce fil n’est pas disponible dans l’instantané mobile actuel.",
"172e0baea818e9aa": "Déplacement encore impossible",
"dd4ea2dfb2476c35": "Attendez la fin ou arrêtez-le d'abord.",
"4249bde5600d6792": "Déplacer au premier niveau ?",
"b000660ae40f4586": "Il devient un fil ordinaire dans votre liste et ne transmet plus ses résultats au fil qui l'a lancé.",
"8df226bf3314e35d": "Déplacer",
"84eccdaa4d8f3c01": "Impossible de déplacer le fil",
"41ca8f475c481866": "Sous-agent de {title}",
"f3e00e6c416eab38": "Depuis {origin}",
"bdfb9e7660ab25d3": "Impossible de reprendre le fil",
Expand Down
8 changes: 8 additions & 0 deletions apps/mobile/src/i18n/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -4773,6 +4773,8 @@
"7fa8a4d836b4d075": "このマシンにはリンクされたマシンがありません。デスクトップまたは Web の設定でリンクしてください。",
"05ba3b5f06a7acfe": "ファイルを閉じる",
"c7e4f052c3d6c066": "ファイルを開く",
"c440ceeaf0452d52": "最上位に移動",
"8dcc52104281c7d2": "通常のスレッドにする",
"740ee1b96278f02f": "音声 · {size}",
"93ade1a4fd485bc3": "音声",
"e8043d133bb85048": "音声を一時停止",
Expand Down Expand Up @@ -4808,6 +4810,12 @@
"d506b798402041ab": "今すぐ送信",
"9a62f694ba5c35c5": "スレッドを開いています…",
"bb24a2960c689a20": "このスレッドは現在のモバイルのスナップショットでは利用できません。",
"172e0baea818e9aa": "まだ移動できません",
"dd4ea2dfb2476c35": "完了するまで待つか、先に停止してください。",
"4249bde5600d6792": "最上位に移動しますか?",
"b000660ae40f4586": "一覧の通常のスレッドになり、開始元のスレッドへの結果報告を停止します。",
"8df226bf3314e35d": "移動",
"84eccdaa4d8f3c01": "スレッドを移動できませんでした",
"41ca8f475c481866": "{title} のサブエージェント",
"f3e00e6c416eab38": "{origin} から",
"bdfb9e7660ab25d3": "スレッドを再開できませんでした",
Expand Down
8 changes: 8 additions & 0 deletions apps/mobile/src/i18n/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -4778,6 +4778,8 @@
"7fa8a4d836b4d075": "이 머신에는 연결된 머신이 없습니다. 데스크톱 또는 웹의 설정에서 연결하세요.",
"05ba3b5f06a7acfe": "파일 닫기",
"c7e4f052c3d6c066": "파일 열기",
"c440ceeaf0452d52": "최상위로 이동",
"8dcc52104281c7d2": "일반 스레드로 전환",
"740ee1b96278f02f": "오디오 · {size}",
"93ade1a4fd485bc3": "오디오",
"e8043d133bb85048": "오디오 일시 중지",
Expand Down Expand Up @@ -4813,6 +4815,12 @@
"d506b798402041ab": "지금 보내기",
"9a62f694ba5c35c5": "스레드 여는 중…",
"bb24a2960c689a20": "이 스레드는 현재 모바일 스냅샷에서 사용할 수 없습니다.",
"172e0baea818e9aa": "아직 이동할 수 없음",
"dd4ea2dfb2476c35": "완료될 때까지 기다리거나 먼저 중지하세요.",
"4249bde5600d6792": "최상위로 이동할까요?",
"b000660ae40f4586": "목록의 일반 스레드가 되며, 이 스레드를 시작한 스레드에 결과를 보고하지 않습니다.",
"8df226bf3314e35d": "이동",
"84eccdaa4d8f3c01": "스레드를 이동하지 못했습니다",
"41ca8f475c481866": "{title}의 서브에이전트",
"f3e00e6c416eab38": "출처: {origin}",
"bdfb9e7660ab25d3": "스레드를 재개할 수 없습니다",
Expand Down
8 changes: 8 additions & 0 deletions apps/mobile/src/i18n/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -4769,6 +4769,8 @@
"11bb30071c8d00e4": "Link działa raz i wygasa po 24 godzinach.",
"05ba3b5f06a7acfe": "Zamknij pliki",
"c7e4f052c3d6c066": "Otwórz pliki",
"c440ceeaf0452d52": "Wydziel na najwyższy poziom",
"8dcc52104281c7d2": "Zmień go w zwykły wątek",
"740ee1b96278f02f": "Audio · {size}",
"93ade1a4fd485bc3": "Audio",
"e8043d133bb85048": "Wstrzymaj audio",
Expand Down Expand Up @@ -4804,6 +4806,12 @@
"d506b798402041ab": "Wyślij teraz",
"9a62f694ba5c35c5": "Otwieranie wątku…",
"bb24a2960c689a20": "Ten wątek nie jest dostępny w bieżącym snapshotcie mobilnym.",
"172e0baea818e9aa": "Nie można jeszcze wydzielić",
"dd4ea2dfb2476c35": "Poczekaj, aż się zakończy, lub najpierw go zatrzymaj.",
"4249bde5600d6792": "Wydzielić na najwyższy poziom?",
"b000660ae40f4586": "Stanie się zwykłym wątkiem na Twojej liście i przestanie raportować do wątku, który go uruchomił.",
"8df226bf3314e35d": "Wydziel",
"84eccdaa4d8f3c01": "Nie można wydzielić wątku",
"41ca8f475c481866": "Subagent wątku {title}",
"f3e00e6c416eab38": "Z {origin}",
"bdfb9e7660ab25d3": "Nie udało się wznowić wątku",
Expand Down
8 changes: 8 additions & 0 deletions apps/mobile/src/i18n/translations/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -4794,6 +4794,8 @@
"7fa8a4d836b4d075": "Esta máquina não tem máquinas vinculadas. Vincule uma em Configurações no desktop ou na web.",
"05ba3b5f06a7acfe": "Fechar arquivos",
"c7e4f052c3d6c066": "Abrir arquivos",
"c440ceeaf0452d52": "Mover para o nível superior",
"8dcc52104281c7d2": "Tornar uma conversa comum",
"740ee1b96278f02f": "Áudio · {size}",
"93ade1a4fd485bc3": "Áudio",
"e8043d133bb85048": "Pausar áudio",
Expand Down Expand Up @@ -4829,6 +4831,12 @@
"d506b798402041ab": "Enviar agora",
"9a62f694ba5c35c5": "Abrindo thread…",
"bb24a2960c689a20": "Esta thread não está disponível no snapshot móvel atual.",
"172e0baea818e9aa": "Ainda não é possível mover",
"dd4ea2dfb2476c35": "Espere terminar ou pare primeiro.",
"4249bde5600d6792": "Mover para o nível superior?",
"b000660ae40f4586": "Ela se torna uma conversa comum na sua lista e deixa de enviar resultados à conversa que a iniciou.",
"8df226bf3314e35d": "Mover",
"84eccdaa4d8f3c01": "Não foi possível mover a conversa",
"41ca8f475c481866": "Subagente de {title}",
"f3e00e6c416eab38": "De {origin}",
"bdfb9e7660ab25d3": "Não foi possível retomar a thread",
Expand Down
8 changes: 8 additions & 0 deletions apps/mobile/src/i18n/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -4872,6 +4872,8 @@
"7fa8a4d836b4d075": "У этой машины нет привязанных машин. Привяжите машину в Настройках на компьютере или в веб-версии.",
"05ba3b5f06a7acfe": "Закрыть файлы",
"c7e4f052c3d6c066": "Открыть файлы",
"c440ceeaf0452d52": "Переместить на верхний уровень",
"8dcc52104281c7d2": "Сделать обычной веткой",
"740ee1b96278f02f": "Аудио · {size}",
"93ade1a4fd485bc3": "Аудио",
"e8043d133bb85048": "Приостановить аудио",
Expand Down Expand Up @@ -4907,6 +4909,12 @@
"d506b798402041ab": "Отправить сейчас",
"9a62f694ba5c35c5": "Открытие треда…",
"bb24a2960c689a20": "Этот тред недоступен в текущем мобильном снимке.",
"172e0baea818e9aa": "Пока нельзя переместить",
"dd4ea2dfb2476c35": "Дождитесь завершения или сначала остановите.",
"4249bde5600d6792": "Переместить на верхний уровень?",
"b000660ae40f4586": "Она станет обычной веткой в списке и перестанет отправлять результаты в ветку, которая её запустила.",
"8df226bf3314e35d": "Переместить",
"84eccdaa4d8f3c01": "Не удалось переместить ветку",
"41ca8f475c481866": "Субагент {title}",
"f3e00e6c416eab38": "Из {origin}",
"bdfb9e7660ab25d3": "Не удалось возобновить тред",
Expand Down
8 changes: 8 additions & 0 deletions apps/mobile/src/i18n/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -4800,6 +4800,8 @@
"7fa8a4d836b4d075": "Den här datorn har inga länkade datorer. Länka en i Inställningar på datorn eller webben.",
"05ba3b5f06a7acfe": "Stäng filer",
"c7e4f052c3d6c066": "Öppna filer",
"c440ceeaf0452d52": "Flytta till översta nivån",
"8dcc52104281c7d2": "Gör den till en vanlig tråd",
"740ee1b96278f02f": "Ljud · {size}",
"93ade1a4fd485bc3": "Ljud",
"e8043d133bb85048": "Pausa ljudet",
Expand Down Expand Up @@ -4835,6 +4837,12 @@
"d506b798402041ab": "Skicka nu",
"9a62f694ba5c35c5": "Öppnar tråden…",
"bb24a2960c689a20": "Tråden är inte tillgänglig i den aktuella mobilögonblicksbilden.",
"172e0baea818e9aa": "Kan inte flytta ännu",
"dd4ea2dfb2476c35": "Vänta tills den är klar eller stoppa den först.",
"4249bde5600d6792": "Flytta till översta nivån?",
"b000660ae40f4586": "Den blir en vanlig tråd i listan och slutar rapportera till tråden som startade den.",
"8df226bf3314e35d": "Flytta",
"84eccdaa4d8f3c01": "Kunde inte flytta tråden",
"41ca8f475c481866": "Subagent till {title}",
"f3e00e6c416eab38": "Från {origin}",
"bdfb9e7660ab25d3": "Kunde inte återuppta tråden",
Expand Down
8 changes: 8 additions & 0 deletions apps/mobile/src/i18n/translations/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -4782,6 +4782,8 @@
"7fa8a4d836b4d075": "这台机器没有已关联的机器。请在桌面端或网页端的设置中关联一台。",
"05ba3b5f06a7acfe": "关闭文件",
"c7e4f052c3d6c066": "打开文件",
"c440ceeaf0452d52": "移至顶层",
"8dcc52104281c7d2": "设为普通会话",
"740ee1b96278f02f": "音频 · {size}",
"93ade1a4fd485bc3": "音频",
"e8043d133bb85048": "暂停音频",
Expand Down Expand Up @@ -4817,6 +4819,12 @@
"d506b798402041ab": "立即发送",
"9a62f694ba5c35c5": "正在打开会话…",
"bb24a2960c689a20": "当前移动端快照中没有此会话。",
"172e0baea818e9aa": "暂时无法移出",
"dd4ea2dfb2476c35": "请等待完成,或先停止。",
"4249bde5600d6792": "移至顶层?",
"b000660ae40f4586": "它将成为列表中的普通会话,并停止向启动它的会话报告结果。",
"8df226bf3314e35d": "移出",
"84eccdaa4d8f3c01": "无法移出会话",
"41ca8f475c481866": "{title} 的子智能体",
"f3e00e6c416eab38": "来自 {origin}",
"bdfb9e7660ab25d3": "无法继续会话",
Expand Down
16 changes: 16 additions & 0 deletions apps/server/src/mcp/OrchestratorMcpService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3180,6 +3180,22 @@ const make = Effect.gen(function* () {
}
return yield* remoteDelegation.cancel(scope, remoteTask, input);
}
// Pop-out needs every task in the child to have ended, and it leaves this thread's control.
const childShell = yield* threadManagement
.getThreadShell(childThreadId)
.pipe(Effect.mapError(threadManagementFailure));
if (childShell?.lineage.detachedFrom?.threadId === scope.thread.threadId) {
if (!isTerminalTaskStatus(current.status)) {
return yield* failure(
"invalid_request",
`Thread ${childThreadId} was popped out to top level and no longer belongs to this task.`,
);
}
return {
taskId: input.taskId,
status: current.status,
} satisfies OrchestratorMcpTaskCancelResult;
}
const key = yield* requestKey(input.clientRequestId);
const parentProjection = yield* loadThreadRecords(scope.thread.threadId, []);
// Cancelling stops the child and every task under it, each a write to a
Expand Down
Loading
Loading