Skip to content

Commit e1fb700

Browse files
authored
Restore RemoteSearchMenuUI for Electron overlay search menu (#2134)
## Summary Restore `RemoteSearchMenuUI` usage in Electron so the completion menu renders in a separate `WebContentsView` that can overlay beyond the chat view bounds. When PR #1933 added inline ghost text completions, it replaced the `RemoteSearchMenuUI`/`LocalSearchMenuUI` branching with `InlineSearchMenuUI`/`LocalSearchMenuUI`, leaving `RemoteSearchMenuUI` as dead code. The remote search menu infrastructure (IPC handlers, `electronSearchMenuUI.ts`, `searchMenuView.ts`, preload bindings) was never removed and remains fully intact. ## Changes - **`packages/shell/src/renderer/src/search.ts`**: When not in inline mode, use `RemoteSearchMenuUI` in Electron (via `isElectron()` check) and fall back to `LocalSearchMenuUI` in non-Electron environments. This matches the original behavior before #1933.
1 parent fcc1c4b commit e1fb700

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ts/packages/shell/src/renderer/src/search.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4+
import { isElectron } from "./main";
45
import { SearchMenuBase } from "./searchMenuBase";
56
import { InlineSearchMenuUI } from "./searchMenuUI/inlineSearchMenuUI";
67
import { LocalSearchMenuUI } from "./searchMenuUI/localSearchMenuUI";
8+
import { RemoteSearchMenuUI } from "./searchMenuUI/remoteSearchMenuUI";
79
import {
810
SearchMenuItem,
911
SearchMenuPosition,
@@ -29,7 +31,9 @@ export class SearchMenu extends SearchMenuBase {
2931
if (this.searchMenuUI === undefined) {
3032
this.searchMenuUI = this.inline
3133
? new InlineSearchMenuUI(this.onCompletion, this.textEntry!)
32-
: new LocalSearchMenuUI(this.onCompletion);
34+
: isElectron()
35+
? new RemoteSearchMenuUI(this.onCompletion)
36+
: new LocalSearchMenuUI(this.onCompletion);
3337
}
3438
this.searchMenuUI.update({ position, prefix, items });
3539
}

0 commit comments

Comments
 (0)