Skip to content

Commit daaba32

Browse files
fix(web,mobile): review fixes for following and listing a moved thread
- A parked thread no longer redirects the route in view when it departs. - The sidebar hides a departed copy only when it lists the continuation. - The move card shows why linked machines could not be asked. - Mobile neither pops nor replaces a screen the user opened meanwhile. - Japanese and Chinese wording for the move divider and the pairing code. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
1 parent 7e8635d commit daaba32

10 files changed

Lines changed: 36 additions & 14 deletions

File tree

‎apps/mobile/src/features/threads/ThreadHandoffCard.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ export function ThreadHandoffCard({ thread }: { readonly thread: EnvironmentThre
104104
title: thread.title,
105105
});
106106
const follow = useEffectEvent((reachable: boolean) => {
107-
if (moved === null) return;
107+
// Another screen the user opened on top is theirs to keep.
108+
if (moved === null || !navigation.isFocused()) return;
108109
if (reachable) {
109110
navigation.dispatch(
110111
StackActions.replace("Thread", {

‎apps/mobile/src/features/threads/ThreadHandoffSheet.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ export function ThreadHandoffSheet({ route }: StaticScreenProps<HandoffTarget>)
5252
const result = await start({ environmentId, input: { threadId, environmentId: target } });
5353
setStarting(null);
5454
if (result._tag === "Success") {
55-
close();
55+
// Dismissed meanwhile, a plain goBack would pop the screen underneath instead.
56+
if (navigation.isFocused()) close();
5657
return;
5758
}
5859
if (isAtomCommandInterrupted(result)) return;

‎apps/mobile/src/i18n/translations/ja.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4761,7 +4761,7 @@
47614761
"16f8dc3158c3bb13": "このマシンにはリンク済みのマシンがありません。",
47624762
"fcfb0114ed50457b": "会話とコードが、未コミットの変更も含めて移動します。このコピーは読み取り専用になります。",
47634763
"f5845b85e968be0a": "{machine} に接続中…",
4764-
"b5ff56c423bb517c": "スレッドを移動",
4764+
"b5ff56c423bb517c": "スレッドを移動しました",
47654765
"df81ee52b275f2cb": "スレッドの移動元:",
47664766
"fa7716793d9cd5e6": "別のマシンから",
47674767
"00de64d19d985ed3": "ここに残す",

‎apps/mobile/src/i18n/translations/zh.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4757,7 +4757,7 @@
47574757
"6de54bd779ddbea2": "此副本为只读。",
47584758
"44c60318d5f90913": "尚未关联",
47594759
"63b5ce60561d68ac": "本设备无法在 {machine} 上创建关联。请在有权限的设备上通过设置进行关联。",
4760-
"8a86ede7e9633733": "这台机器尚未与 {machine} 关联。移动会话时会先用本设备在那边创建的代码关联两者。请选择这里的智能体在那边可以做什么。",
4760+
"8a86ede7e9633733": "这台机器尚未与 {machine} 关联。移动会话时会先用本设备在那边创建的配对码关联两者。请选择这里的智能体在那边可以做什么。",
47614761
"e4e02a383f25eee8": "关联并移动",
47624762
"9f122f4c410241c0": "移动",
47634763
"26aeccb614ec69f1": "已接受",

‎apps/web/src/components/ChatView.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4357,7 +4357,7 @@ export default function ChatView(props: ChatViewProps) {
43574357
onConfirm={onConfirmRevertStable}
43584358
/>
43594359
{embedded ? null : <LinkPullRequestDialogHost />}
4360-
{embedded ? null : <ThreadHandoffFollower shell={activeThreadShell} />}
4360+
{embedded || backgroundThread ? null : <ThreadHandoffFollower shell={activeThreadShell} />}
43614361
<ThreadVisitWatermark threadRef={routeThreadRef} />
43624362
<ExpandedImageDialogHost threadKey={routeThreadKey} />
43634363
</div>

‎apps/web/src/components/Sidebar.logic.test.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,5 +1934,21 @@ describe("filterSidebarV2VisibleThreads", () => {
19341934
new Set(),
19351935
);
19361936
expect(visible.map((entry) => entry.id)).toEqual(["thread-continues"]);
1937+
1938+
// An archived continuation is not listed, so the copy left behind still is.
1939+
const left = {
1940+
...thread(here, "thread-left"),
1941+
handoff: {
1942+
state: "departed" as const,
1943+
environmentId: there,
1944+
handoffId: "handoff-2",
1945+
label: "There",
1946+
threadId: ThreadId.make("thread-archived-there"),
1947+
},
1948+
};
1949+
const archived = { ...thread(there, "thread-archived-there"), archivedAt: "2026-01-01" };
1950+
expect(
1951+
filterSidebarV2VisibleThreads([left, archived], null, new Set()).map((entry) => entry.id),
1952+
).toEqual(["thread-left"]);
19371953
});
19381954
});

‎apps/web/src/components/Sidebar.logic.ts‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -608,13 +608,9 @@ export function filterSidebarV2VisibleThreads<
608608
scopedProjectKeys: ReadonlySet<string> | null,
609609
delegatedUnderParent: ReadonlySet<string>,
610610
): T[] {
611-
const movedCopies = movedThreadCopyKeys(threads);
612-
return threads.filter(
611+
const listed = threads.filter(
613612
(thread) =>
614613
thread.archivedAt === null &&
615-
!movedCopies.has(
616-
threadEntityKey({ environmentId: thread.environmentId, threadId: thread.id }),
617-
) &&
618614
!isShownUnderParent(
619615
{ environmentId: thread.environmentId, threadId: thread.id },
620616
thread.lineage,
@@ -623,6 +619,14 @@ export function filterSidebarV2VisibleThreads<
623619
(scopedProjectKeys === null ||
624620
scopedProjectKeys.has(`${thread.environmentId}:${thread.projectId}`)),
625621
);
622+
// Only a continuation the sidebar lists hides its source; otherwise both would vanish.
623+
const movedCopies = movedThreadCopyKeys(listed);
624+
return listed.filter(
625+
(thread) =>
626+
!movedCopies.has(
627+
threadEntityKey({ environmentId: thread.environmentId, threadId: thread.id }),
628+
),
629+
);
626630
}
627631

628632
export function buildBulkTitleRegenerationContextMenuItem(input: {

‎apps/web/src/components/chat/HandoffRequestCard.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ function PendingHandoffRequest(props: {
222222
<LinkAccessPicker value={access} onChange={setAccess} disabled={disabled} />
223223
</div>
224224
) : null}
225-
{error !== null ? (
225+
{(error ?? targets.error) !== null ? (
226226
<p role="alert" className="text-xs text-destructive">
227-
{error}
227+
{error ?? targets.error}
228228
</p>
229229
) : !canMove ? (
230230
<p className="text-xs text-muted-foreground">

‎apps/web/src/i18n/translations/ja.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4356,7 +4356,7 @@
43564356
"3f20afb36f9e7ad5": "リンク済みのマシンに問い合わせ中…",
43574357
"599ad83173ef7607": "移動",
43584358
"1ad453f8658db1fe": "会話とコードが、未コミットの変更も含めて移動します。このコピーは読み取り専用になります。",
4359-
"b5ff56c423bb517c": "スレッドを移動",
4359+
"b5ff56c423bb517c": "スレッドを移動しました",
43604360
"df81ee52b275f2cb": "スレッドの移動元:",
43614361
"fa7716793d9cd5e6": "別のマシンから",
43624362
"6ef05430a4278089": "{machine} で開く",

‎apps/web/src/i18n/translations/zh.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4360,7 +4360,7 @@
43604360
"c3f86e567586e075": "此会话已在 {machine} 上继续",
43614361
"6de54bd779ddbea2": "此副本为只读。",
43624362
"0cb6363ad389e8e3": "{machine}(尚未关联)",
4363-
"8a86ede7e9633733": "这台机器尚未与 {machine} 关联。移动会话时会先用本设备在那边创建的代码关联两者。请选择这里的智能体在那边可以做什么。",
4363+
"8a86ede7e9633733": "这台机器尚未与 {machine} 关联。移动会话时会先用本设备在那边创建的配对码关联两者。请选择这里的智能体在那边可以做什么。",
43644364
"8d565e4ae2a09706": "关联并移动",
43654365
"26aeccb614ec69f1": "已接受",
43664366
"71b73be0c5a65a98": "已接受,移至 {machine}",

0 commit comments

Comments
 (0)