Skip to content

Commit 85d5940

Browse files
Merge pull request #653 from JPL-Devin/devin/update-skills-1787960210
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: jason.han <jason.han@jpl.nasa.gov>
2 parents e69ea48 + 681c77c commit 85d5940

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

  • .agents/skills/testing-vscode-extension

.agents/skills/testing-vscode-extension/SKILL.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,42 @@ degradation case.
422422
Close spare groups, and if the diagram and its editor end up in one group use Command Palette
423423
**"View: Move Editor into Previous/Next Group"** to get them side by side.
424424

425+
### The webview's `message` origin guard (`src/webview/diagram.ts`)
426+
427+
The handler drops events whose `event.origin !== window.origin`. Measured on VS Code desktop 1.134.0
428+
(Linux, `--no-sandbox --disable-gpu`), every extension message satisfies it: the inner frame's
429+
`window.origin` is `vscode-webview://<uuid>` (its `location.href` is
430+
`vscode-webview://<uuid>/index.html?id=…&parentOrigin=vscode-file%3A%2F%2Fvscode-app`) and `views`,
431+
`render` and `highlight` all arrive with exactly that origin — no `"null"`/srcdoc origin. If a future
432+
VS Code version changes the webview frame plumbing, the guard would silently swallow everything;
433+
the symptoms are an **empty View dropdown and an empty status line** in a panel that otherwise loads.
434+
Measure it, don't guess, in Command Palette → **Developer: Open Webview Developer Tools** with the
435+
console context set to `active-frame (index.html)`:
436+
437+
```js
438+
window.__seen=[];
439+
window.addEventListener('message',e=>window.__seen.push(
440+
{eventOrigin:e.origin,windowOrigin:window.origin,type:e.data&&e.data.type,
441+
passesGuard:e.origin===window.origin}));
442+
// then change the View picker in the panel, and:
443+
console.log(JSON.stringify(window.__seen,null,1))
444+
```
445+
446+
Pitfalls: the devtools window is a *separate* X window with an empty title — re-running
447+
"Open Webview Developer Tools" toggles/raises it unpredictably, so bring it back with
448+
`wmctrl -l` + `wmctrl -ia <id>` instead. The console context and any listener you installed survive
449+
raising the window, but not a `Developer: Reload Window`.
450+
451+
Cheap message-flow oracles that need no devtools (all three strings are produced only inside the
452+
guarded handler):
453+
- the picker filling with 13 entries for `examples/views-demo.sysml` (7 declared + 6 pseudo-views);
454+
- the status line `<path>: declares 7 views (…); name the one to render` — that text comes from
455+
`internal/core/model/render.go`, i.e. a server error relayed as a `{type:"error"}` message;
456+
- opened from a *scratch* folder that file has **0 Problems** (the ~13 problems in the skill above are
457+
the repo-root `package Views` shadowing), so use a deliberate error such as
458+
`port broken : NoSuchPort;` (expect `unresolved reference: NoSuchPort`) as the LSP smoke oracle
459+
rather than a non-zero problem count.
460+
425461
## Recording tips
426462

427463
Record the VS Code window maximized (wmctrl above). Verify visual claims by `zoom`ing the status bar

0 commit comments

Comments
 (0)