Skip to content

Commit d00e73b

Browse files
committed
fix(mobile): preserve draft actions and compaction notice updates
1 parent 1d0e44a commit d00e73b

5 files changed

Lines changed: 15 additions & 5 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,7 @@ export function NewTaskDraftScreen(props: NewTaskDraftScreenProps) {
999999
onPress={() => {
10001000
flow.armHeavyReady();
10011001
setDraftLive(true);
1002+
requestAnimationFrame(() => promptInputRef.current?.focus());
10021003
}}
10031004
className="min-h-16 justify-center rounded-2xl bg-grouped-card px-4 py-3"
10041005
>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ function NewTaskHeader(props: {
144144
value: props.searchText,
145145
onChangeText: props.onSearchTextChange,
146146
placeholder: "Search projects",
147-
mode: "inline",
147+
mode: Platform.OS === "android" ? "collapsible" : "inline",
148148
compactToolbar: true,
149149
}}
150150
/>

‎apps/mobile/src/features/threads/thread-detail-body-fingerprint.test.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ import { threadDetailBodyFingerprint } from "./thread-detail-body-fingerprint";
55

66
function fingerprintWithResume(
77
onResumeQueue: ThreadDetailScreenProps["onResumeQueue"],
8+
compactBeforeSend?: ThreadDetailScreenProps["compactBeforeSend"],
89
): readonly unknown[] {
9-
// Partial fixture: this case only asserts Resume nullness remounts the body.
10+
// Partial fixture: only conditional controls are exercised.
1011
return threadDetailBodyFingerprint({
1112
onResumeQueue,
13+
compactBeforeSend,
1214
canStopThread: true,
1315
selectedThread: {
1416
id: "thread",
@@ -32,11 +34,17 @@ function fingerprintWithResume(
3234
}
3335

3436
describe("threadDetailBodyFingerprint", () => {
35-
it("changes when Resume becomes available or disappears", () => {
37+
it("changes when Resume or the compaction notice changes", () => {
3638
const hidden = fingerprintWithResume(null);
3739
const visible = fingerprintWithResume(async () => undefined);
3840
expect(hidden).not.toEqual(visible);
3941
expect(fingerprintWithResume(null)).toEqual(hidden);
4042
expect(fingerprintWithResume(async () => undefined)).toEqual(visible);
43+
const notice = { tokens: 1000, keepFullHistory: () => undefined };
44+
expect(fingerprintWithResume(null, notice)).not.toEqual(hidden);
45+
expect(fingerprintWithResume(null, { ...notice, tokens: 2000 })).not.toEqual(
46+
fingerprintWithResume(null, notice),
47+
);
48+
expect(fingerprintWithResume(null, null)).toEqual(hidden);
4149
});
4250
});

‎apps/mobile/src/features/threads/thread-detail-body-fingerprint.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export function threadDetailBodyFingerprint(props: ThreadDetailScreenProps): rea
3131
props.providerSubagentStatus,
3232
props.extensionStatuses,
3333
props.isCompacting,
34+
props.compactBeforeSend?.tokens,
3435
props.creationState,
3536
props.activePendingApproval,
3637
props.activePendingApprovals,

‎apps/mobile/src/state/use-selected-thread-git-actions.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ export function useSelectedThreadGitActions(options?: { readonly enabled?: boole
8282
const cwd = enabled ? selectedThreadCwd : null;
8383
const runStackedAction = useAtomCommand(
8484
vcsActionManager.runStackedAction({
85-
environmentId: activeThread?.environmentId ?? null,
86-
cwd,
85+
environmentId: selectedThread?.environmentId ?? null,
86+
cwd: selectedThreadCwd,
8787
}),
8888
{ reportFailure: false },
8989
);

0 commit comments

Comments
 (0)