Skip to content

fix(statechart-dashboard): wait for the opened chart by its id in verify - #18

Merged
cwkang1998 merged 1 commit into
mainfrom
fix/statechart-dashboard-verify-wait-by-id
Nov 17, 2026
Merged

cwkang1998 merged 1 commit into
mainfrom
fix/statechart-dashboard-verify-wait-by-id

Conversation

@cwkang1998

Copy link
Copy Markdown
Owner

Why

chen builds one page of all 55 enhanced-server v2 statecharts with the statechart-dashboard skill. Its verify.mjs failed on that page in 4 of 10 runs, with "Node is detached from document" or "Node is either not clickable or not an Element". A check that fails at random cannot gate anything.

Two charts on that page share the title "RFQ expiry and settlement". After a click in the navigation, verify waited for the heading to show the chart's title. For the second of the two charts, the wait returned while the page still showed the first one. The page then drew the second chart and replaced the Fit button that verify was about to click.

What changed

  • verify now waits until the navigation marks the chart's id as the current page. It still checks the heading.

Scope

  • Covers the wait after a chart opens. The state, arrow, Fit, and tab clicks change the page synchronously, so their checks stay as they were.
  • Adds no browser test, because the skill's tests run without a browser.

Tradeoffs

  • A click on the navigation button by selector was the first suspect. Every failure stack ends at the Fit click, which already clicks by selector, so that change would not help.
  • A new chart id attribute in the template would also work. It would make verify time out on every page built before this change, so verify reads the navigation mark that pages already have.

Blast Radius

Only verify.mjs changes. A page whose navigation never marks the open chart would now time out, and the template always sets that mark.

Verification

  • 10 runs of verify on the 55-chart page, with puppeteer-core and the system Chrome. Before the fix, 6 passed and 4 failed, and all 4 failures stopped at the Fit click on line 33. After the fix, 10 passed.
  • A copy of verify that logs the chart the page shows after the wait printed "wait returned for cron-options-rfq-settlement-out-ChartVault while the page shows cron-options-rfq-settlement" in each of 3 failed runs. It printed nothing in the 2 runs that passed.
  • bun test in skills/statechart-dashboard/scripts passes 3 of 3, and node scripts/verify.mjs passes.

verify() opened a chart and then waited until the page heading showed the
chart's title. Two charts can share a title. For the second of them the wait
returned at once, while the page still showed the first chart. The page then
drew the second chart on its hashchange event, so the next click on Fit hit a
detached node.

The wait now also needs the navigation to mark this chart's id as the current
page. The page sets that mark in the same step that draws the chart.
@cwkang1998
cwkang1998 merged commit 9eaf9d7 into main Nov 17, 2026
1 check passed
@cwkang1998
cwkang1998 deleted the fix/statechart-dashboard-verify-wait-by-id branch November 17, 2026 05:55
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.

1 participant