Repository navigation
Commit b576dcd
authored
revert: revert broken chrome-devtools-mcp + browser panel PRs, will re-implement
* Revert "feat(desktop): add embedded browser panel with WebContentsView (anomalyco#1671)"
This reverts commit 610ae1c.
* Revert "feat(desktop): bundle chrome-devtools-mcp as dependency, eliminate npx requirement (anomalyco#1670)"
This reverts commit fe9881b.
* feat(desktop): bundle chrome-devtools-mcp + embedded browser panel (fixed)
Re-implements both features with fixes for the issues found in anomalyco#1670/anomalyco#1671:
Fixes from PR1 (chrome-devtools-mcp bundling):
- Use 'node' string literal instead of process.execPath in the IPC
handler — process.execPath in Electron is the Electron binary, not
node, so OpenCode couldn't spawn the command
- Fix args filter to only carry --prefixed flags (not -y from npx)
- Fix mcp.add fallback path to use resolved command from mcpEntryConfig
instead of the original entry.command
Fixes from PR2 (embedded browser panel):
- Guard against zero-dimension bounds on first render — skip
browser.show() until the panel has non-zero dimensions, let
ResizeObserver trigger the actual show
- Defensive try/catch in destroyBrowserView for already-destroyed
webContents
Verified:
- resolveChromeDevtoolsMcpBin returns ['node', '<abs-path>'] (not
['Electron', '<path>'])
- All 17 existing tests pass
- Electron app starts and loads successfully
- CDP targets visible at the remote debugging port
* feat(desktop): auto-inject chrome-devtools MCP into opencode.json on engine start
When the OpenCode engine starts in the Electron desktop app,
ensureOpencodeConfig now automatically adds a chrome-devtools MCP entry
to opencode.json if one doesn't already exist. The command uses the
bundled chrome-devtools-mcp package (['node', '<abs-path>']) so no
npm/npx is needed at runtime.
This mirrors what Tauri's ensure_workspace_files() does in files.rs for
the starter preset, making Control Chrome a zero-setup default for all
Electron workspaces.
* fix(desktop): seed chrome-devtools MCP at workspace creation time
ensureOpencodeConfig in runtime.mjs only runs when the OpenCode engine
starts, which happens asynchronously after the workspace is selected.
New workspaces were left without a chrome-devtools entry because the
engine hadn't started yet.
Fix: call seedChromeDevtoolsMcp(folderPath) directly inside the
workspaceCreate IPC handler so the config is written synchronously
during workspace creation. The runtime.mjs ensureOpencodeConfig
remains as a backup for workspaces created before this change.
Verified: created a workspace via IPC, confirmed opencode.jsonc
contains chrome-devtools with ['node', '<bundled-bin-path>'].
* fix(desktop): migrate legacy npx/bare chrome-devtools commands to bundled node path
Existing workspaces created by Tauri or older Electron versions have
chrome-devtools MCP entries with npx-based or bare-binary commands
like ['npx','-y','chrome-devtools-mcp@latest'] or ['chrome-devtools-mcp'].
Both seedChromeDevtoolsMcp (main.mjs, runs at workspace creation) and
ensureOpencodeConfig (runtime.mjs, runs at engine start) now detect
these legacy commands and migrate them to the bundled ['node', path]
command. User-customised commands (absolute paths, etc.) are preserved.1 parent 610ae1c commit b576dcd
11 files changed
Lines changed: 229 additions & 442 deletions
File tree
- apps
- app
- src
- app/lib
- react-app/domains
- connections
- session
- browser
- chat
- tests
- desktop
- electron
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 53 | + | |
60 | 54 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 55 | + | |
68 | 56 | | |
69 | 57 | | |
70 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
499 | 499 | | |
500 | 500 | | |
501 | 501 | | |
502 | | - | |
| 502 | + | |
| 503 | + | |
503 | 504 | | |
504 | 505 | | |
505 | 506 | | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
| 507 | + | |
510 | 508 | | |
511 | 509 | | |
512 | 510 | | |
| |||
589 | 587 | | |
590 | 588 | | |
591 | 589 | | |
592 | | - | |
| 590 | + | |
593 | 591 | | |
594 | 592 | | |
595 | 593 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 3 | + | |
11 | 4 | | |
12 | 5 | | |
13 | 6 | | |
| |||
18 | 11 | | |
19 | 12 | | |
20 | 13 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 14 | + | |
24 | 15 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 16 | + | |
| 17 | + | |
32 | 18 | | |
33 | 19 | | |
34 | 20 | | |
35 | 21 | | |
36 | 22 | | |
37 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
38 | 34 | | |
39 | 35 | | |
40 | 36 | | |
41 | 37 | | |
42 | 38 | | |
43 | 39 | | |
| 40 | + | |
44 | 41 | | |
45 | 42 | | |
46 | 43 | | |
47 | 44 | | |
48 | 45 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
55 | 49 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 50 | + | |
| 51 | + | |
63 | 52 | | |
64 | | - | |
65 | 53 | | |
66 | 54 | | |
67 | 55 | | |
68 | | - | |
69 | | - | |
| 56 | + | |
70 | 57 | | |
71 | 58 | | |
72 | 59 | | |
73 | 60 | | |
74 | | - | |
| 61 | + | |
75 | 62 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
86 | 71 | | |
87 | 72 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 73 | + | |
| 74 | + | |
97 | 75 | | |
98 | | - | |
99 | | - | |
| 76 | + | |
100 | 77 | | |
101 | | - | |
102 | | - | |
103 | | - | |
| 78 | + | |
104 | 79 | | |
105 | 80 | | |
106 | 81 | | |
107 | | - | |
108 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
109 | 85 | | |
110 | 86 | | |
111 | 87 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
120 | 91 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
131 | 99 | | |
132 | 100 | | |
133 | | - | |
134 | 101 | | |
135 | 102 | | |
136 | 103 | | |
| |||
141 | 108 | | |
142 | 109 | | |
143 | 110 | | |
144 | | - | |
145 | 111 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 112 | + | |
155 | 113 | | |
156 | 114 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
| 115 | + | |
165 | 116 | | |
166 | 117 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
| 118 | + | |
| 119 | + | |
179 | 120 | | |
180 | | - | |
181 | | - | |
182 | 121 | | |
183 | 122 | | |
184 | 123 | | |
| |||
188 | 127 | | |
189 | 128 | | |
190 | 129 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
| 130 | + | |
195 | 131 | | |
196 | 132 | | |
197 | 133 | | |
198 | 134 | | |
199 | 135 | | |
200 | 136 | | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 137 | + | |
210 | 138 | | |
211 | 139 | | |
212 | 140 | | |
213 | | - | |
214 | 141 | | |
215 | 142 | | |
216 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | 182 | | |
186 | 183 | | |
187 | 184 | | |
| |||
350 | 347 | | |
351 | 348 | | |
352 | 349 | | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
| 350 | + | |
358 | 351 | | |
359 | 352 | | |
360 | 353 | | |
| |||
560 | 553 | | |
561 | 554 | | |
562 | 555 | | |
563 | | - | |
564 | 556 | | |
565 | 557 | | |
566 | 558 | | |
| |||
0 commit comments