@devries-cameron20 / t3code-1 / commits / 2d689687f5
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(web): bare @ in the composer lists workspace files (#36435)

Julius Marminge committed Nov 13, 2026 at 15:44 UTC 2d689687f57acafe1b85cbc9d82583ea66d2d0fc
6 files changed +23 -6
apps/mobile/src/state/queries.filesystem.test.ts
+17 -1
@@ -7,6 +7,7 @@ const state = vi.hoisted(() => ({
7 phase: "connected" as "connected" | "offline",
8 sessionAtom: {},
9 searchAtom: {},
10 + searchRequests: vi.fn(),
11 }));
12
13 vi.mock("react", async (importOriginal) => ({
@@ -27,7 +28,12 @@ vi.mock("./presentation", () => ({
28 }));
29 vi.mock("./pull-requests", () => ({ composerPullRequests: {} }));
30 vi.mock("./projects", () => ({
30 - projectEnvironment: { searchEntries: () => state.searchAtom },
31 + projectEnvironment: {
32 + searchEntries: (target: unknown) => {
33 + state.searchRequests(target);
34 + return state.searchAtom;
35 + },
36 + },
37 }));
38 vi.mock("./atom-registry", () => ({ appAtomRegistry: {} }));
39 vi.mock("./orchestration", () => ({ orchestrationEnvironment: {} }));
@@ -59,6 +65,7 @@ beforeEach(() => {
65 state.session = null;
66 state.sessionError = null;
67 state.phase = "connected";
68 + state.searchRequests.mockClear();
69 });
70
71 it("keeps a file search pending until its grant loads, then shows matches", () => {
@@ -74,3 +81,12 @@ it("keeps a file search pending until its grant loads, then shows matches", () =
81 isPending: false,
82 });
83 });
84 +
85 +it("searches workspace entries for a bare @", () => {
86 + state.session = { authenticated: true, scopes: [AuthFilesystemReadScope] };
87 + useComposerPathSearch({ ...target, query: "" });
88 + expect(state.searchRequests).toHaveBeenCalledExactlyOnceWith({
89 + environmentId: target.environmentId,
90 + input: { cwd: target.cwd, query: "", limit: 20 },
91 + });
92 +});
apps/mobile/src/state/queries.ts
+1 -1
@@ -426,7 +426,7 @@ export function useComposerPathSearch(target: ComposerPathSearchTarget) {
426 const searchTarget =
427 debouncedTarget.environmentId !== null &&
428 debouncedTarget.cwd !== null &&
429 - debouncedTarget.query.length > 0
429 + debouncedTarget.query !== null
430 ? {
431 environmentId: debouncedTarget.environmentId,
432 input: {
apps/mobile/src/state/queryTargets.ts
+2 -2
@@ -8,8 +8,8 @@ export interface CheckpointDiffTarget {
8 readonly ignoreWhitespace: boolean;
9 }
10
11 -export function normalizeComposerPathSearchQuery(query: string | null): string {
12 - return query?.trim() ?? "";
11 +export function normalizeComposerPathSearchQuery(query: string | null): string | null {
12 + return query?.trim() ?? null;
13 }
14
15 export function buildCheckpointDiffTargets(target: CheckpointDiffTarget) {
apps/web/src/components/chat/useComposerMenuItems.ts
+1 -1
@@ -396,7 +396,7 @@ export function useComposerMenuItems({
396 return [];
397 })();
398 const isLoading =
399 - (composerTriggerKind === "path" && pathTriggerQuery.length > 0 && workspaceEntries.isPending) ||
399 + (composerTriggerKind === "path" && workspaceEntries.isPending) ||
400 ((composerTriggerKind === "skill" || composerTriggerKind === "slash-command") &&
401 workspaceSkillsScanning) ||
402 (composerTriggerKind === "pull-request" &&
apps/web/src/state/queries.filesystem.test.ts
+1
@@ -100,6 +100,7 @@ const contentTarget = {
100 };
101
102 it.each([
103 + { query: "", expected: "" },
104 { query: "src", expected: "src" },
105 { query: "a".repeat(256), expected: "a".repeat(256) },
106 {
apps/web/src/state/queries.ts
+1 -1
@@ -347,7 +347,7 @@ export function useProjectPathSearch(
347 }
348
349 export function useComposerPathSearch(target: ComposerPathSearchTarget) {
350 - return useProjectPathSearch(target, COMPOSER_PATH_SEARCH_LIMIT);
350 + return useProjectPathSearch(target, COMPOSER_PATH_SEARCH_LIMIT, { allowEmptyQuery: true });
351 }
352
353 interface ProjectContentSearchTarget {