@devries-cameron20 / t3code Mirror · read-only / commits / 83c520c21f
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 09:45 UTC

fix(web): clicks beside an open file's find bar reach the code again (#37676)

Julius Marminge committed Nov 16, 2026 at 09:01 UTC 83c520c21f8f5c90bb0944345a763ed2c7c9d63f
3 files changed +66 -5
apps/web/src/components/files/fileEditorDismissal.browser.test.tsx
+52
@@ -63,4 +63,56 @@ describe("installFileEditorDismissal", () => {
63
64 expect(window.getSelection()?.toString()).toBe("Assistant reply");
65 });
66 +
67 + it("lets clicks beside the open search panel reach the file's code", async () => {
68 + let editor: Editor<"file" | "file-diff", undefined, undefined> | undefined;
69 + const createEditor: EditorFactory<undefined, undefined> = (...args) =>
70 + (editor = new Editor(...args));
71 + await preloadHighlighter({ themes: Object.values(DEFAULT_THEMES), langs: ["typescript"] });
72 + const contents = Array.from(
73 + { length: 12 },
74 + (_, index) => `const server${index} = "a line long enough to run under the find bar";\n`,
75 + ).join("");
76 + await using screen = await render(
77 + <div style={{ width: 600 }}>
78 + <EditProvider createEditor={createEditor}>
79 + <File file={{ name: "server.ts", contents }} edit />
80 + </EditProvider>
81 + </div>,
82 + );
83 + const shadowRoot = screen.container.querySelector("diffs-container")?.shadowRoot;
84 + const content = shadowRoot?.querySelector<HTMLElement>("[data-content]");
85 + expect(content).toBeTruthy();
86 +
87 + editor!.setSelections([
88 + { start: { line: 0, character: 8 }, end: { line: 0, character: 8 }, direction: "none" },
89 + ]);
90 + const isMac = isMacPlatform(navigator.platform);
91 + content!.dispatchEvent(
92 + new KeyboardEvent("keydown", {
93 + key: "f",
94 + code: "KeyF",
95 + metaKey: isMac,
96 + ctrlKey: !isMac,
97 + bubbles: true,
98 + composed: true,
99 + cancelable: true,
100 + }),
101 + );
102 + const widget = await vi.waitFor(() => {
103 + const panelHost = [...shadowRoot!.querySelectorAll("*")].find((element) =>
104 + element.shadowRoot?.querySelector("[data-search-panel]"),
105 + );
106 + const found = panelHost?.shadowRoot?.querySelector("[data-editor-widget]");
107 + expect(found).toBeTruthy();
108 + return found!;
109 + });
110 + const widgetBox = widget.getBoundingClientRect();
111 + const beside = shadowRoot!.elementFromPoint(
112 + widgetBox.left - 100,
113 + widgetBox.top + widgetBox.height / 2,
114 + );
115 +
116 + expect(content!.contains(beside)).toBe(true);
117 + });
118 });
patches/@pierre__diffs@1.7.0-beta.4.patch
+9
@@ -81,6 +81,15 @@ index b4c280390b52434f63fbe7916d81b150d9006fb4..cb7fb89a22c8adac9ea951b8767b5fd4
81 }
82 if (this.#selections !== void 0 || this.#matches !== void 0 || this.#markerRenderer !== void 0) {
83 this.#updateSelections(this.#selections ?? []);
84 +@@ -3369,7 +3388,8 @@ var Editor = class {
85 + });
86 + this.#searchPanel = searchPanel;
87 + this.#retainSearchPanelFocus = false;
88 + searchPanel.mount();
89 ++ searchPanel.getHostElement().dataset.searchPanelOverlay = "";
90 + }
91 + #searchWithNavigationTarget(textDocument, searchParams) {
92 + const viewport = this.#getSearchViewportBounds();
93 diff --git a/dist/editor/textMeasure.d.ts b/dist/editor/textMeasure.d.ts
94 index 89e938d89eca77d351aeed65f3c5495383effd97..cde1d6ba89a97bbb1614754a48f8994388c186bd 100644
95 --- a/dist/editor/textMeasure.d.ts
pnpm-lock.yaml
+5 -5
@@ -372,7 +372,7 @@ patchedDependencies:
372 '@ff-labs/fff-node@0.11.0': 93f62a76399b435a76588b2bef237db0a1e85880c1ac0d0759c416e9cc579252
373 '@legendapp/list@3.7.2': 3c68607b8bb7a531873bcbe0b197d163ef1fdb4d4cf52a4ddf9d2b3804671658
374 '@muse-code/sdk@1.4.6': 7b495b607fc5d76b444c7c4d58821e839726a30e6f3c53564f0d59f2d5b42101
375 - '@pierre/diffs@1.7.0-beta.4': 756e7b154f48b9084ea6630520736cf446b69e6000777f3717363836694dd00c
375 + '@pierre/diffs@1.7.0-beta.4': 241563d810c29250e0e92f3eda74214393726d46667fedbf1f91a5f5bea07d1e
376 '@react-native-ai/apple@0.12.0': 2d09870c2848d185cb05b53ed823a46e12dba519324d8dd8e584e28731990f9d
377 '@react-native-menu/menu@2.0.0': 6872ba71b9847c5a0210b1b896923dadc3860faedfe28d9f062bcedfe786ef1d
378 '@react-navigation/native-stack@7.21.0': 990d575444c4af2ce8218b3b7a8280fe244c03abbdb32b822a2e862f791dbf42
@@ -573,7 +573,7 @@ importers:
573 version: 0.3.0
574 '@pierre/diffs':
575 specifier: 1.7.0-beta.4
576 - version: 1.7.0-beta.4(patch_hash=756e7b154f48b9084ea6630520736cf446b69e6000777f3717363836694dd00c)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)
576 + version: 1.7.0-beta.4(patch_hash=241563d810c29250e0e92f3eda74214393726d46667fedbf1f91a5f5bea07d1e)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)
577 '@pierre/highlights':
578 specifier: 'catalog:'
579 version: 0.5.0
@@ -1094,7 +1094,7 @@ importers:
1094 version: 1.8.0
1095 '@pierre/diffs':
1096 specifier: 1.7.0-beta.4
1097 - version: 1.7.0-beta.4(patch_hash=756e7b154f48b9084ea6630520736cf446b69e6000777f3717363836694dd00c)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)
1097 + version: 1.7.0-beta.4(patch_hash=241563d810c29250e0e92f3eda74214393726d46667fedbf1f91a5f5bea07d1e)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)
1098 '@pierre/trees':
1099 specifier: 1.0.0-beta.6
1100 version: 1.0.0-beta.6(@pierre/theme@2.0.0)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(shiki@4.2.0)
@@ -1510,7 +1510,7 @@ importers:
1510 dependencies:
1511 '@pierre/diffs':
1512 specifier: 1.7.0-beta.4
1513 - version: 1.7.0-beta.4(patch_hash=756e7b154f48b9084ea6630520736cf446b69e6000777f3717363836694dd00c)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)
1513 + version: 1.7.0-beta.4(patch_hash=241563d810c29250e0e92f3eda74214393726d46667fedbf1f91a5f5bea07d1e)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)
1514 '@t3tools/contracts':
1515 specifier: workspace:*
1516 version: link:../contracts
@@ -16440,7 +16440,7 @@ snapshots:
16440 tslib: 2.8.1
16441 webcrypto-core: 1.9.2
16442
16443 - '@pierre/diffs@1.7.0-beta.4(patch_hash=756e7b154f48b9084ea6630520736cf446b69e6000777f3717363836694dd00c)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)':
16443 + '@pierre/diffs@1.7.0-beta.4(patch_hash=241563d810c29250e0e92f3eda74214393726d46667fedbf1f91a5f5bea07d1e)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)':
16444 dependencies:
16445 '@pierre/highlights': 0.5.1
16446 '@pierre/patches': 0.0.1