Visual debugging
A reference of the soundor-debug-plugin skill.
soundor-debug-plugin reads this reference when a task needs it. Source on GitHub
The engine lays out with Yoga and draws with Skia natively; the web runtime lays out with the same engine core compiled to WebAssembly and draws with the DOM. The simulated runtime used by UI tests has no layout at all. So visual bugs are found in screenshots of the real runtimes.
Capture
- VST3, live:
npx soundor driver screenshot before.png(with adevsession), or one node with--debug-id,--role/--nameor--text. - VST3, scripted:
plugin.screenshot({ path })andplugin.getByDebugId('graph').screenshot({ path })from@soundor/driver/vst3. - Web: Playwright's
page.screenshot()against the served build (?embedfor the plugin view alone).
Screenshots are drawn by the engine at the view's scale (the result reports
width, height and scale); they do not include the host's window.
Inspect
Open the image. Then confirm what you see with the tree:
npx soundor driver inspect --text "Gain: 0.50" # bounds, layout, styles
npx soundor driver tree --json > tree.json| Symptom | Look for |
|---|---|
| Text cut off | the node's bounds narrower than its text; a fixed width; overflow: 'hidden' on a parent |
| Overlap | position: 'absolute' siblings; negative margins; a parent smaller than its children |
| Control missing | not in the tree (not rendered: a condition, an error in the terminal), or in the tree with zero size or visible: false |
| Misaligned row | different heights or alignItems per row; mixed fixed and flex sizes |
| Wrong value shown | the parameter's get() (Driver parameter() or host) versus the text node: UI or source? |
| Graph off its axes | data in other units than the axes (Hz vs normalized, dB vs linear); a log axis drawn linear |
| Meter stuck or empty | no values on the stream (publish side) versus no redraw (UI side): see architecture debugging |
| Blurry or wrong size at a scale | bitmaps instead of vectors; sizes computed from device pixels |
| Breaks when resized | fixed sizes in a resize: 'layout' editor; content outside useViewSize().safeArea |
Typography, spacing and hierarchy problems need the image itself: compare sizes and gaps between similar elements, and check text contrast.
Fix and compare
Change one thing, capture again with the same size and state, and compare
the two images. Check the default size, the minimum and maximum of a
resizable editor (plugin.host.resizeEditor(w, h); fixed editors refuse
it), and both runtimes when the plugin ships both. Repeat until the
problem is gone, then add a test: a UI test for the logic (what is shown),
or toMatchScreenshot for the look.