Skip to content

Fix run-demo-interaction-bench: replace broken DOM selectors with correct UI interactions#3

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/update-demo-scripts
Draft

Fix run-demo-interaction-bench: replace broken DOM selectors with correct UI interactions#3
Copilot wants to merge 2 commits intomainfrom
copilot/update-demo-scripts

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 26, 2026

setDemoControls was written against a UI that doesn't exist — it called page.select() on radio buttons/range-slider and clicked a #generateBtn that was never in index.html, so the demo bench script was entirely non-functional.

Changes

  • setDemoControls rewritten to match the actual index.html / app.ts UI:
    • Geometry & renderer set via input[name="…"] radio buttons (checked = true + change event)
    • Point count set by snapping to nearest POINT_PRESETS entry, writing to the #numPoints range slider, and firing input + change to trigger the app's debounced generateAndLoad()
    • #generateBtn click removed — auto-generation is driven by the control events
    • waitForFunction now compares against actualPoints (the snapped preset) so it correctly matches what #statPoints will display
// Before — broken: no <select> or #generateBtn exists in the demo page
await page.select('#geometry', cfg.geometry);
await page.select('#numPoints', String(cfg.points));
await page.click('#generateBtn');

// After — correct: interact with radio buttons + range slider
await page.evaluate((geometry) => {
  const el = document.querySelector<HTMLInputElement>(`input[name="geometry"][value="${geometry}"]`);
  if (el) { el.checked = true; el.dispatchEvent(new Event('change', { bubbles: true })); }
}, cfg.geometry);
// … similarly for renderer + numPoints slider
Original prompt

make sure the full example including the agent runs. see the new demo scripts in the main branch and use the same dataset...

and make sure the example works well

The user has attached the following file paths as relevant context:

  • AGENTS.md

Created from VS Code.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…range slider)

Co-authored-by: mnm-matin <45293386+mnm-matin@users.noreply.github.com>
Copilot AI changed the title [WIP] Update demo scripts to ensure full example works Fix run-demo-interaction-bench: replace broken DOM selectors with correct UI interactions Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants