Repository navigation
Conversation
…eletion ## Description Deleting to a visual line boundary also removes adjacent inline decorators from the neighbouring wrapped line. After measuring the boundary with a collapsed native caret, Lexical extends the model selection over every adjacent inline decorator without consulting layout. Remove that post-measurement traversal from the deletion path. Keep the decorator pre-pass and the normalization of native endpoints inside a decorator's private text. Forward and backward line deletion now preserve the decorator across the reported soft wrap, while the same-line and hard-break cases continue to pass. Add browser regressions for rich/plain text, forward/backward deletion, spacing variants, empty/text/button decorators, and text-bearing decorators straddling a wrap. Expand the same-line controls to include consecutive decorators and raised alignment. Closes meta#9234 ## Test plan Local browser runs used an uncommitted `vitest.9234.config.mts` that imports the normal Vitest configuration and overrides only Chromium's executable path. Chromium 153.0.8010.12 was downloaded directly from Google after Playwright's CDN archive failed; Firefox and WebKit use the pinned Playwright 1.63.0 builds. All three engines ran on Linux. ### Before New tests against unchanged main (`1e803309`): ```sh VITEST_BROWSER=chromium,firefox,webkit pnpm test-browser --config vitest.9234.config.mts InlineDecoratorLineDeletion.test.ts ``` ```text Test Files 3 failed (3) Tests 120 failed | 144 passed (264) ``` ### After ```sh VITEST_BROWSER=chromium,firefox,webkit pnpm test-browser --config vitest.9234.config.mts --no-file-parallelism ``` ```text Test Files 113 passed | 1 skipped (114) Tests 1115 passed | 7 skipped (1122) ``` `pnpm run tsc-test`, ESLint and Prettier for the changed files, and `git diff --check` also passed. Further exploration found a separate native-measurement limitation with consecutive empty decorators straddling a wrap: Firefox/WebKit can stop short of the visual boundary. Those cases also fail on unchanged main and remain unresolved here. Same-line consecutive empty decorators are covered and pass.
## Description The canary E2E job is skipped in this fork because it only allows the facebook owner. Also allow etrepum/lexical so the existing Ubuntu/Node 24/Chromium/rich-text canary runs on this PR and on future fork PRs after the change reaches main. ## Test plan ### Before GitHub Actions run 37142184364: ```text e2e-tests: completed / skipped ``` ### After ```text Checking formatting... All matched files use Prettier code style! ``` `git diff --check` passed. The canary run will be verified after publishing this commit.
## Description Remove the repository condition from the canary E2E job. Run it alongside core tests for every repository using this workflow, including forks. ## Test plan ### Before ```text if: github.repository_owner == 'facebook' || github.repository == 'etrepum/lexical' ``` ### After The job has no repository condition. Prettier validation passed: ```text Checking formatting... All matched files use Prettier code style! ``` GitHub Actions will validate the canary run after publishing.
## Description The decorator traversal removed for meta#9234 originated in meta#7270, which also fixed repeated forward deletion and deletion at image boundaries. Cover those cases directly with browser tests to guard against restoring the original regression. Exercise inline and inline-block image wrappers, private text, consecutive decorators, raised alignment, and repeated deletion across paragraph boundaries in rich and plain text. ## Test plan ### Before The existing full browser suite passed: 113 passed and 1 skipped files; 1115 passed and 7 skipped tests. The image and repeated-deletion cases added here were not covered by that focused browser fixture. ### After VITEST_BROWSER=chromium,firefox,webkit pnpm test-browser --config vitest.9234.config.mts InlineDecoratorLineDeletion.test.ts --no-file-parallelism 3 test files passed; 420 tests passed across Chromium, Firefox, and WebKit on Linux. The local config only overrides Chromium's executable path. pnpm run tsc-test, ESLint and Prettier for the changed test, and git diff --check passed.
## Description Remove the comment left in place of the deleted decorator traversal. The rationale for the change is documented in the PR. ## Test plan ### After Comment-only change. ```text $ pnpm exec prettier --check packages/lexical/src/LexicalSelection.ts Checking formatting... All matched files use Prettier code style! ``` `git diff --check` passed with no output.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Deleting to a visual line boundary also removes adjacent inline decorators from the neighbouring wrapped line. After measuring the boundary with a collapsed native caret, Lexical extends the model selection over every adjacent inline decorator without consulting layout.
Remove that post-measurement traversal from the deletion path. Keep the decorator pre-pass and the normalization of native endpoints inside a decorator's private text. Forward and backward line deletion now preserve the decorator across the reported soft wrap, while the same-line and hard-break cases continue to pass.
Add browser regressions for rich/plain text, forward/backward deletion, spacing variants, empty/text/button decorators, and text-bearing decorators straddling a wrap. Expand the same-line controls to include consecutive decorators and raised alignment.
The removed correction was introduced for
Selection.modify('extend')in meta#7270. The deletion path later switched to a collapsed nativemodify('move')in meta#8774, and meta#9247 normalized move endpoints inside decorator text. A Chromium probe confirms the relevant distinction:extendstops before a trailing image whilemovelands after it. The generalRangeSelection.modifypath retains its decorator correction.Extend the browser coverage to include inline and inline-block image wrappers and repeated deletion across image/paragraph boundaries from meta#7270. These command-based tests run on Linux as well as other platforms; the original keyboard E2E cases are macOS-only.
Run canary E2E alongside the core tests without a repository-owner condition. This enables the existing Ubuntu/Node 24/Chromium/rich-text canary workflow in forks too.
Closes meta#9234
Test plan
Local browser runs used an uncommitted
vitest.9234.config.mtsthat imports the normal Vitest configuration and overrides only Chromium's executable path. Chromium 153.0.8010.12 was downloaded directly from Google after Playwright's CDN archive failed; Firefox and WebKit use the pinned Playwright 1.63.0 builds. All three engines ran on Linux.Before
New tests against unchanged main (
1e803309):After
Full browser suite after the fix, before adding the historical image/repeated-deletion coverage:
The expanded focused suite, including the historical image/repeated-deletion coverage:
pnpm run tsc-test, ESLint and Prettier for the changed files, andgit diff --checkalso passed.Further exploration found a separate native-measurement limitation with consecutive empty decorators straddling a wrap: Firefox/WebKit can stop short of the visual boundary. Those cases also fail on unchanged main and remain unresolved here. Same-line consecutive empty decorators are covered and pass.