tests: paint-gate re-showable menus + drain synth plays (sync audit)#31
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR ports the dasImgui “sync-audit” hardening patterns into this repo’s node-editor integration tests, strengthening the async live-API test gating so context-menu/popup assertions wait on actual paint and synthetic input timelines are fully drained before polling for effects.
Changes:
- Added
ne_wait_visiblehelper to wait for{canvas}/{subpath}to be present and painted this frame (intended for re-showable popups / menu items). - Hardened shader-graph context-menu flows by draining the synthetic right-click timeline before waiting, and switching
BG_CTX/*menu waits to paint-gated waits. - Hardened delete/select tutorial regression by draining synthetic mouse and key timelines before polling for selection and deletion effects.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
daslib/imgui_editor_playwright.das |
Adds ne_wait_visible helper (paint-gated wait) for popup/menu items. |
tests/integration/test_shader_graph.das |
Drains synthetic right-click before menu waits; switches BG context-menu waits to ne_wait_visible. |
tests/integration/test_context_menus.das |
Switches node/background menu waits to ne_wait_visible for re-showable popups. |
tests/integration/test_delete_and_select.das |
Drains synthetic click and Delete key timelines before effect polling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Ports the dasImgui sync-audit (PR #181) to the node-editor integration suite. These tests drive the async live API; the gaps were leaning on a poll window to absorb an in-flight synth gesture, and gating re-showable popups on registry existence rather than actual paint. - imgui_editor_playwright: add ne_wait_visible — the paint-gated peer of ne_wait_widget (present AND rendered-this-frame). Existence-only can stale-pass on a cached menu entry before the popup repaints (the documented popup re-open race; wait_for_visible closes it). - test_shader_graph (context_menu / new_node_drag): drain the synth right-click with wait_for_mouse_idle before the menu wait, and switch the two re-showable BG_CTX context-menu waits to ne_wait_visible. - test_context_menus: switch the NODE_MENU / BG_MENU item waits to ne_wait_visible (the local right_click wrapper already drains the mouse timeline). - test_delete_and_select: drain the synth click (wait_for_mouse_idle) and the Delete key (wait_for_key_idle) before their effect polls, instead of relying on the 6s poll window to absorb the in-flight gesture. Pure hardening — every change adds a wait or strengthens existence->paint, never removes one. Full suite green 3x headless (23/23, 4 workers); lint + format clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
8cab9d6 to
bf5e368
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the dasImgui sync-audit (dasImgui#181) to the node-editor integration suite. These tests drive the async live API (daslang-live over HTTP), so the test must explicitly wait for each effect — never lean on a poll window to absorb an in-flight synth gesture, and never gate a re-showable popup on registry existence when it should gate on actual paint.
A fleet of audit agents swept all 12 integration tests against the seven sync patterns from the dasImgui audit. The suite was already in good shape —
imgui_editor_playwright'sne_*helpers gate chords on real effects, and the clipboard / groups / styling / navigation / call-forms tests are clean. The genuine gaps were concentrated in the synth-mouse and context-menu paths:Changes
imgui_editor_playwright: addne_wait_visible— the paint-gated peer ofne_wait_widget(present and rendered-this-frame). Existence-only can stale-pass on a cached menu entry before the popup repaints (the documented popup re-open race;wait_for_visiblecloses it). Registered inutils/node_editor2rst.das's "Polling / await" group so the docs Uncategorized-gate stays clean.test_shader_graph(context_menu/new_node_drag): drain the synth right-click withwait_for_mouse_idlebefore the menu wait, and switch the two re-showableBG_CTXcontext-menu waits tone_wait_visible.test_context_menus: switch theNODE_MENU/BG_MENUitem waits tone_wait_visible(the localright_clickwrapper already drains the mouse timeline).test_delete_and_select: drain the synth click (wait_for_mouse_idle) and the Delete key (wait_for_key_idle) before their effect polls, instead of relying on the 6 s poll window to absorb the in-flight gesture.Why it's safe
Pure hardening — every change adds a wait or strengthens existence→paint, never removes one. A paint-gate can only fail where the old existence-gate would also eventually fail. Confirmed
widget_renderedis set for the suspended-popup menu items (thewith_suspendedscreen-space path), sone_wait_visibleresolves for them.Validation (local, mirrors CI)
23/23, 4 isolated workers) — baseline before changes, twice after.context_menusubtest 0.56 s → 0.85 s (the added idle+paint gates doing real work), well within budget.utils/lintLINT0xx clean on all 5 changed files; formatter reports already-formatted.node_editor2rstregenerated → no Uncategorized;ne_wait_visiblelands in "Polling / await".Deferred (surfaced for discussion, not in this PR)
The
connect_by_drag/create_by_dragtests perform real multi-frame pin-drags via wall-clockimgui_mouse_playtimelines. Unlike dasImgui's olddrag()(≈1 ms press→move gap, which dt-collapsed on slow runners — fixed by frame-pacing in dasImgui#184), these use a deliberately wide ~1000 ms press→move gap (t_ms400→1400) and have been green on all CI OSes. Frame-pacing them would be strictly more deterministic but needs dasImgui #184'sframe_pacedflag plus a timeline rewrite (a cross-repo dependency). Left as a follow-up.🤖 Generated with Claude Code