[lexical-playground] Chore: Add (disabled) E2E tests for nested table drag-selection#8107
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| if (mouseDown) { | ||
| await page.mouse.down(); | ||
| } | ||
| await page.mouse.move(toX, toY, slow ? 10 : 1); |
There was a problem hiding this comment.
I think this argument was wrong? The dragging behaviour was only testable once I used the steps parameter instead of passing the number in. https://playwright.dev/docs/api/class-mouse#mouse-move
I changed the function to take the number of steps rather than a boolean, and reduced the "slow" value from 10 to 5 to speed up some tests (at 10 steps, the test takes an additional 200ms)
etrepum
left a comment
There was a problem hiding this comment.
I agree that the table handling code should be monolithic, and I'm sure that it could be made more efficient with some API changes. The last refactor of that code was focused on fixing bugs without the sort of structural changes it really needs.
I think these are legit e2e test failures, but github has been having issues today so I restarted them. Some of these changes might break existing tests?
assertion is incorrect, will adjust after implementation is fixed
e3f286f to
5ed20bd
Compare
|
Test still appear to be failing here |
Description
I was working on a fix for #7154, that is, improving the selection behaviour for nested cells.
I gave up on the fix because the current selection handler in
LexicalTableSelectionHelpers.tsis registered for each table. As it stands, a selection in a nested cell is also considered a selection inside the parent cell. Both tables end up firing $setSelection and triggering each othersSELECTION_CHANGED_COMMAND, and they end up fighting for control. This leads to flickering and the wrong element being selected, see:Screen.Recording.2026-02-02.at.2.23.41.pm.mov
I would like to refactor table selection to use a monolithic handler which is only registered and fired once.
I propose merging these test to demonstrate the bug and then refactoring (with a fix for these tests) in another PR.
Test plan
Before
Visual demonstration of the E2E tests (if the
.fixmeis removed). Apologies for the poor quality, had to downscale to fit Github limits.Screen.Recording.2026-02-02.at.2.14.40.pm.mov
After
No changes to logic.