Skip to content

Commit f217759

Browse files
Merge remote-tracking branch 'origin/main' into takeover/20236-compact-instructions-r2
2 parents c218a80 + 4812dca commit f217759

80 files changed

Lines changed: 1724 additions & 2697 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/desktop/src/updates/updateMachine.test.ts‎

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
reduceDesktopUpdateStateOnDownloadFailure,
99
reduceDesktopUpdateStateOnInstallFailure,
1010
reduceDesktopUpdateStateOnNoUpdate,
11-
reduceDesktopUpdateStateOnUpdateAvailable,
1211
} from "./updateMachine.ts";
1312

1413
const runtimeInfo = {
@@ -50,30 +49,6 @@ describe("updateMachine", () => {
5049
expect(failed.message).toBeNull();
5150
});
5251

53-
it("keeps the installer when the feed still offers its version", () => {
54-
const releaseNotes = [{ version: "1.1.0", items: ["fix: queued update"], totalItems: 1 }];
55-
const state = reduceDesktopUpdateStateOnUpdateAvailable(
56-
{
57-
...createInitialDesktopUpdateState("1.0.0", runtimeInfo, "latest"),
58-
enabled: true,
59-
status: "downloaded",
60-
availableVersion: "1.1.0",
61-
downloadedVersion: "1.1.0",
62-
releaseNotes,
63-
omittedReleaseCount: 2,
64-
downloadPercent: 100,
65-
},
66-
"1.1.0",
67-
"2026-03-04T00:00:00.000Z",
68-
);
69-
70-
expect(state.status).toBe("downloaded");
71-
expect(state.downloadedVersion).toBe("1.1.0");
72-
expect(state.releaseNotes).toEqual(releaseNotes);
73-
expect(state.omittedReleaseCount).toBe(2);
74-
expect(state.downloadPercent).toBe(100);
75-
});
76-
7752
it("preserves available version on download failure for retry", () => {
7853
const state = reduceDesktopUpdateStateOnDownloadFailure(
7954
{
@@ -114,35 +89,6 @@ describe("updateMachine", () => {
11489
expect(failedInstall.canRetry).toBe(true);
11590
});
11691

117-
it("preserves a downloaded update when no update is available", () => {
118-
const releaseNotes = [{ version: "1.1.0", items: ["fix: queued update"], totalItems: 1 }];
119-
const state = reduceDesktopUpdateStateOnNoUpdate(
120-
{
121-
...createInitialDesktopUpdateState("1.0.0", runtimeInfo, "latest"),
122-
enabled: true,
123-
status: "error",
124-
availableVersion: "1.1.0",
125-
downloadedVersion: "1.1.0",
126-
releaseNotes,
127-
omittedReleaseCount: 2,
128-
message: "old failure",
129-
errorContext: "download",
130-
canRetry: true,
131-
},
132-
"2026-03-04T00:00:00.000Z",
133-
);
134-
135-
expect(state.status).toBe("downloaded");
136-
expect(state.availableVersion).toBe("1.1.0");
137-
expect(state.downloadedVersion).toBe("1.1.0");
138-
expect(state.releaseNotes).toBe(releaseNotes);
139-
expect(state.omittedReleaseCount).toBe(2);
140-
expect(state.downloadPercent).toBe(100);
141-
expect(state.message).toBeNull();
142-
expect(state.errorContext).toBeNull();
143-
expect(state.canRetry).toBe(true);
144-
});
145-
14692
it("clears stale available state when no update is available", () => {
14793
const state = reduceDesktopUpdateStateOnNoUpdate(
14894
{

‎apps/mobile/src/features/keyboard/CommandPalette.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,10 @@ export function CommandPalette(props: {
324324
}),
325325
}));
326326
const threadItems: CommandPaletteItem[] = threads
327-
.filter((thread) => thread.archivedAt === null)
327+
.filter(
328+
(thread) =>
329+
thread.archivedAt === null && thread.lineage.relationshipToParent !== "subagent",
330+
)
328331
.sort((left, right) =>
329332
(right.latestUserMessageAt ?? right.updatedAt).localeCompare(
330333
left.latestUserMessageAt ?? left.updatedAt,

‎apps/mobile/src/features/threads/threadActivityFileNavigation.test.ts‎

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎apps/mobile/src/features/threads/threadActivityFileNavigation.ts‎

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import { afterEach, beforeEach, describe, expect, it, vi } from "vite-plus/test";
2+
3+
const mocks = vi.hoisted(() => ({
4+
impactAsync: vi.fn(),
5+
selectionAsync: vi.fn(),
6+
setStringAsync: vi.fn(),
7+
}));
8+
9+
vi.mock("expo-clipboard", () => ({
10+
setStringAsync: mocks.setStringAsync,
11+
}));
12+
13+
vi.mock("expo-haptics", () => ({
14+
ImpactFeedbackStyle: {
15+
Light: "light",
16+
},
17+
impactAsync: mocks.impactAsync,
18+
selectionAsync: mocks.selectionAsync,
19+
}));
20+
21+
import { copyTextWithHaptic, tryCopyTextWithHaptic } from "./copyTextWithHaptic";
22+
23+
describe("copyTextWithHaptic", () => {
24+
beforeEach(() => {
25+
vi.clearAllMocks();
26+
mocks.setStringAsync.mockReturnValue(new Promise<void>(() => undefined));
27+
mocks.impactAsync.mockResolvedValue(undefined);
28+
mocks.selectionAsync.mockResolvedValue(undefined);
29+
});
30+
31+
afterEach(() => {
32+
vi.restoreAllMocks();
33+
});
34+
35+
it("triggers haptic feedback without waiting for the clipboard promise", () => {
36+
copyTextWithHaptic("trace-123");
37+
38+
expect(mocks.setStringAsync).toHaveBeenCalledWith("trace-123");
39+
expect(mocks.impactAsync).toHaveBeenCalledWith("light");
40+
});
41+
42+
it("preserves selection feedback for thread work rows", () => {
43+
copyTextWithHaptic("work output", {
44+
target: "thread-work-row",
45+
feedback: "selection",
46+
});
47+
48+
expect(mocks.setStringAsync).toHaveBeenCalledWith("work output");
49+
expect(mocks.selectionAsync).toHaveBeenCalledOnce();
50+
expect(mocks.impactAsync).not.toHaveBeenCalled();
51+
});
52+
53+
it("reports whether the clipboard write succeeded", async () => {
54+
mocks.setStringAsync.mockResolvedValueOnce(undefined);
55+
56+
await expect(tryCopyTextWithHaptic("thread-123")).resolves.toBe(true);
57+
});
58+
59+
it("returns false when the clipboard write fails", async () => {
60+
vi.spyOn(console, "error").mockImplementation(() => undefined);
61+
mocks.setStringAsync.mockRejectedValueOnce(new Error("native clipboard failure"));
62+
63+
await expect(tryCopyTextWithHaptic("thread-123")).resolves.toBe(false);
64+
});
65+
66+
it("reports structured failures without including clipboard contents", async () => {
67+
const content = "https://accounts.google.com/auth?state=private-state&code=private-code";
68+
const clipboardCause = new Error(`Cannot copy ${content}`);
69+
const hapticCause = new Error(`Native failure for ${content}`);
70+
const consoleError = vi.spyOn(console, "error").mockImplementation(() => undefined);
71+
mocks.setStringAsync.mockRejectedValueOnce(clipboardCause);
72+
mocks.impactAsync.mockRejectedValueOnce(hapticCause);
73+
74+
await tryCopyTextWithHaptic(content, { target: "provider-sign-in-link" });
75+
76+
expect(consoleError).toHaveBeenCalledWith(
77+
"Failed to copy provider-sign-in-link to the clipboard.",
78+
expect.objectContaining({
79+
_tag: "CopyTextClipboardWriteError",
80+
target: "provider-sign-in-link",
81+
}),
82+
);
83+
expect(consoleError).toHaveBeenCalledWith(
84+
"Failed to trigger light-impact haptic feedback after copying provider-sign-in-link.",
85+
expect.objectContaining({ _tag: "CopyTextHapticFeedbackError", feedback: "light-impact" }),
86+
);
87+
const diagnostics = JSON.stringify(consoleError.mock.calls);
88+
expect(diagnostics).not.toContain("private-state");
89+
expect(diagnostics).not.toContain("private-code");
90+
expect(diagnostics).not.toContain("cause");
91+
});
92+
});

‎apps/mobile/src/lib/threadActivityInspector.test.ts‎

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)