Skip to content

[lexical-playground] Chore: Harden nested editor selection ownership test - #9243

Merged
etrepum merged 2 commits into
meta:mainfrom
etrepum:test/nested-selection-diagnostics
Sep 27, 2026
Merged

etrepum merged 2 commits into
meta:mainfrom
etrepum:test/nested-selection-diagnostics

Conversation

@etrepum

@etrepum etrepum commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

Description

The nested-editor selection test clicked the external logo link, mixed DOM focus with selection ownership, and polled the two editors with separate reads. This left avoidable ambiguity in the WebKit collaboration failures.

Use inert header clicks to leave the editors and actual clicks to enter them, with the root click positioned away from the image and caption. Disable the nested debug view through the existing playground setting because it clips the caption and prevents real clicks.

Read both Lexical selections in one frame-aware evaluate call. Keep polling observational and label all five ownership checkpoints. On failure, report the last sampled Lexical selections, active element, document focus, DOM selection endpoints and owning editors, frame URL, and open page URLs.

Preserve every ownership assertion, unsupported-mode skip, and timeout. This is test hardening; the cause of the original macOS WebKit flake remains unconfirmed. No production code changes.

Test plan

Before

The original macOS WebKit collaboration failure was not reproduced in this Linux environment. No macOS runner was available, so there is no new macOS before/after evidence.

After

Targeted test: keeps single active selection for nested editors in Selection.spec.mjs.

Ran the repository Playwright CLI with --grep 'keeps single active selection for nested editors', --repeat-each=10 for WebKit and --repeat-each=5 for Chromium and Firefox, in rich-text and rich-text-with-collab modes. A local configuration launched the dev and collaboration servers, selected available browser binaries, and used one worker with zero retries. Test and assertion timeouts were unchanged.

Ubuntu 24.04, Playwright 1.62.1, headless browsers. WebKit 26.5 WPE, Chromium 151.0.7922.34 headless shell, Firefox 153.0 with MOZ_DISABLE_CONTENT_SANDBOX=1 for the container.

Actual final runner output:

WebKit, collaboration:      10 passed (2.2m)
WebKit, non-collaboration:  10 passed (1.6m)
Chromium, collaboration:    5 passed (41.4s)
Chromium, non-collaboration: 5 passed (35.4s)
Firefox, collaboration:     5 passed (1.4m)
Firefox, non-collaboration:  5 passed (59.6s)

Initial parallel dev-server runs encountered navigation timeouts before the test checkpoints; the Chromium and Firefox results above are from sequential runs. Firefox logged ResizeObserver and Vite overlay errors during its passing runs.

A temporary deliberately wrong ownership expectation failed after the existing 5000ms polling timeout and printed every required diagnostic field. Removed that probe afterward.

ESLint with --max-warnings=0, Prettier, and git diff --check passed. macOS WebKit was unavailable; these results do not establish a fix for the original flake.

…test

## Description

The nested-editor selection test clicked the external logo link, mixed DOM focus with selection ownership, and polled the two editors with separate reads. This left avoidable ambiguity in the WebKit collaboration failures.

Use inert header clicks to leave the editors and actual clicks to enter them, with the root click positioned away from the image and caption. Disable the nested debug view through the existing playground setting because it clips the caption and prevents real clicks.

Read both Lexical selections in one frame-aware evaluate call. Keep polling observational and label all five ownership checkpoints. On failure, report the last sampled Lexical selections, active element, document focus, DOM selection endpoints and owning editors, frame URL, and open page URLs.

Preserve every ownership assertion, unsupported-mode skip, and timeout. This is test hardening; the cause of the original macOS WebKit flake remains unconfirmed. No production code changes.

## Test plan

### Before

The original macOS WebKit collaboration failure was not reproduced in this Linux environment. No macOS runner was available, so there is no new macOS before/after evidence.

### After

Targeted test: `keeps single active selection for nested editors` in `Selection.spec.mjs`.

Ran the repository Playwright CLI with `--grep 'keeps single active selection for nested editors'`, `--repeat-each=10` for WebKit and `--repeat-each=5` for Chromium and Firefox, in rich-text and rich-text-with-collab modes. A local configuration launched the dev and collaboration servers, selected available browser binaries, and used one worker with zero retries. Test and assertion timeouts were unchanged.

Ubuntu 24.04, Playwright 1.62.1, headless browsers. WebKit 26.5 WPE, Chromium 151.0.7922.34 headless shell, Firefox 153.0 with MOZ_DISABLE_CONTENT_SANDBOX=1 for the container.

Actual final runner output:

```text
WebKit, collaboration:      10 passed (2.2m)
WebKit, non-collaboration:  10 passed (1.6m)
Chromium, collaboration:    5 passed (41.4s)
Chromium, non-collaboration: 5 passed (35.4s)
Firefox, collaboration:     5 passed (1.4m)
Firefox, non-collaboration:  5 passed (59.6s)
```

Initial parallel dev-server runs encountered navigation timeouts before the test checkpoints; the Chromium and Firefox results above are from sequential runs. Firefox logged ResizeObserver and Vite overlay errors during its passing runs.

A temporary deliberately wrong ownership expectation failed after the existing 5000ms polling timeout and printed every required diagnostic field. Removed that probe afterward.

ESLint with --max-warnings=0, Prettier, and git diff --check passed. macOS WebKit was unavailable; these results do not establish a fix for the original flake.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 26, 2026
@vercel

vercel Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
lexical Ready Ready Preview Sep 26, 2026 7:42pm UTC
lexical-playground Ready Ready Preview Sep 26, 2026 7:42pm UTC

Request Review

@etrepum
etrepum added this pull request to the merge queue Sep 27, 2026
Merged via the queue into meta:main with commit d65e2ad Sep 27, 2026
54 checks passed
@etrepum etrepum mentioned this pull request Sep 28, 2026

This branch was successfully deployed

2 active deployments
Preview – lexical — 5cf181a6 Deployed Sep 26, 2026 by vercel[bot]
Preview – lexical-playground — 5cf181a6 Deployed Sep 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants