Skip to content

🐛 Preserve app document context and editable text - #905

Merged
wwilsman merged 3 commits into
mainfrom
rd/cross-document-events
Nov 11, 2026
Merged

wwilsman merged 3 commits into
mainfrom
rd/cross-document-events

Conversation

@Robdel12

@Robdel12 Robdel12 commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Why

An Interactor rooted in another same-origin document still creates events in the test window and checks focus against the test document. Click handlers receive the wrong view, event type checks use the wrong window, and focused() fails on a focused iframe input.

Typing also replaces an editable element's entire textContent, flattening browser-created paragraphs and inline formatting. BackChannel exposed this when local typing followed the browser's Return behavior. Fixing it here lets Dyno keep typing in Interactor.

Approach

Use the target element's ownerDocument for events and focus. Edit contenteditable text with DOM ranges, preserving surrounding markup and placing the caret after inserted text. Whole-editor replacement clears the full content; explicit text ranges remain partial edits. Use the standard prepare lifecycle so Git installs build the bundle and declarations too.

Evidence

The iframe, paragraph, and caret regressions fail before their fixes and pass afterward. The complete Chrome suite has 136 passing tests; package and type builds pass too. Tests cover empty editors, inline deletion, insertion at offset zero, whole-editor replacement across paragraphs, and typing into a browser-created empty paragraph.

Keep synthetic events and focus assertions in the element’s own window when tests interact with an iframe or another same-origin document.
@Robdel12
Robdel12 requested a review from wwilsman November 11, 2026 06:25
@Robdel12
Robdel12 force-pushed the rd/cross-document-events branch from f1db891 to eadda98 Compare November 11, 2026 06:57
@Robdel12 Robdel12 changed the title 🐛 Use the target document for events and focus 🐛 Preserve app document context and editable text Nov 11, 2026
@Robdel12
Robdel12 force-pushed the rd/cross-document-events branch from eadda98 to 510959b Compare November 11, 2026 07:00
Use DOM ranges to insert and remove text without flattening native paragraphs or inline elements. Keep the caret after inserted text so browser-local typing composes with real editing defaults.
@Robdel12
Robdel12 force-pushed the rd/cross-document-events branch from 510959b to d22e523 Compare November 11, 2026 07:14
Robdel12 added a commit to Robdel12/dyno that referenced this pull request Nov 11, 2026
## Why

Keep app interaction in the browser through Interactor. The product
ports had picked up driver-backed typing, clicks, taps and scrolling
that duplicated local actions. This keeps the managed input surface
limited to real keys for browser defaults and pointer movement for CSS
hover.

## Approach

Remove the overlapping actions from Interactor, `app.native`, the wire
protocol, provider, types and capability flags. Scrolling composes
through custom Interactor actions and real DOM scrolling. URL-only tests
exercise those actions with native capabilities unavailable.

The ports exposed cross-document events/focus and contenteditable typing
bugs in Interactor. Fix those upstream in [Interactor
#905](wwilsman/interactor.js#905), including
paragraphs, caret placement and empty-line placeholders. Dyno pins the
tested upstream commit; land and release that fix before moving back to
a registry version. Git consumers need its standard prepare build
enabled.

Managed contexts retain fractional pixel ratios, touch/viewport settings
and user agents. Color scheme and external request blocking reset
between tests. App requests preserve browser credentials, fill survives
replaced controls, and startup cancellation preserves the run deadline.

Chromium keeps Playwright's default headless shell. Full Chromium on
this Mac repeats content after 16,384 physical rows; affected macOS
headed/branded/custom builds fail clearly above that limit. Real pixel
checks cover long pages and fractional dimensions.

Project setup, fixtures and preparation now have a separate CI suite
after the macOS Firefox execution job exhausted its five-minute budget.
All 46 test files and every engine/OS combination remain covered; each
job retains the same hard cap.

## Evidence

The framework has 239 passing checks and two existing browser-specific
skips, including installed-consumer types and URL-only interaction. All
17 WebKit capture checks and 20 supported native checks pass on Linux
and macOS. Fractional bounds retain raw renderer pixels, including
Linux's transparent partial row and anti-aliased corner. All seven
documentation checks pass. The real Vizzly integration passes both
workflows. Interactor has 136 passing browser tests and passing
package/type builds.

Cyclonic retains 97 passing cases, three existing layout skips and 116
captures. BackChannel retains 31 workflows and 49 captures after
replacing the overlapping actions. Visual baseline review remains open;
no baselines were approved or replaced.

@wwilsman wwilsman left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All nitpicks adding empty lines. Hopefully I made it easy to just apply suggestions

Comment thread lib/actions/click.js Resolved
Comment thread lib/actions/press.js Resolved
Comment thread lib/actions/press.js Resolved
Comment thread lib/actions/trigger.js Resolved
Comment thread tests/actions/press.test.js Resolved
Comment thread tests/actions/press.test.js Resolved
Comment thread tests/actions/press.test.js Resolved
Comment thread tests/actions/press.test.js Resolved
Comment thread tests/actions/press.test.js Resolved
Comment thread tests/actions/press.test.js Resolved
@Robdel12
Robdel12 requested a review from wwilsman November 11, 2026 18:51
@wwilsman
wwilsman merged commit 807385e into main Nov 11, 2026
8 checks passed
@wwilsman
wwilsman deleted the rd/cross-document-events branch November 11, 2026 20:06
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