feat(web): expose native dialog kinds to handlers

Merged
RU
10d ago
+55-3
  • Expose Dialog.type as alert | confirm | prompt | beforeunload so a handler can route by dialog kind instead of guessing from message text.
  • Preserve existing accept/dismiss and failure classification. This implements the separate dialog-kind gap recorded in #487.

Verified

Ran it locally: yes.

Real cached Chromium opens alert, confirm and prompt dialogs with the same message. The registered handler uses the kind to choose dismissal or typed acceptance, and the page receives the expected false/prompt values. Native router controls exercise all four kinds, including beforeunload, with existing dialog failure/lifecycle tests and public typechecking.

mainthis branch
Regression failsRegression and adjacent tests pass
RUN  v5.0.1 packages/web


 Test Files  2 passed (2)
      Tests  48 passed (48)
   Start at  10:35:04
   Duration  2.52s (tests 81%, import 10%, transform 9%)

The full repository pnpm check, changed package build, typecheck, and changed TypeScript lint pass. Full pnpm check also passes on the unchanged pinned base with the complete frozen-lockfile install. No live model calls or hosted-service benchmarks were run.

Also rebuilt the exact frozen commit and passed a real runner/worker/browser product fixture with no model calls. The candidate capability executed through the built SDK and real worker.

CI follow-up at cc428337222b7697aa26ba34f6da870344522c71:

Fixed the shared failure-evidence assertion to compare elapsed waiting with the actual first locator-call budget. This preserves the upper bound and rejects early returns. The frozen old assertion rejects a valid299ms wait for a299ms budget; new evaluator controls accept it and reject298ms early/3000ms late. All9 failure-evidence integration tests pass on each branch.

This addresses a shared baseline test defect without changing production behavior or adding expected-failure exemptions. GitHub CI on the updated head remains the final platform check.