-
Notifications
You must be signed in to change notification settings - Fork 726
Fix text editor wrapping and improve test reliability #11373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
8b5ae28 to
dd38d4a
Compare
dd38d4a to
19f21ab
Compare
19f21ab to
a35ec0c
Compare
a35ec0c to
30b3651
Compare
- Replace arbitrary timeouts with deterministic browser idle detection in Playwright tests - Fix line wrapping to use full available width (trim trailing spaces from length calculation) - Simplify rich text editor by removing plaintext mode and markdown transition plugin - Consolidate IndentPlugin to work with paragraph-based structure (remove PlainTextIndentPlugin) - Add comprehensive test utilities for browser idle detection with examples and documentation Fix linewrap tests to expect trimmed newLine values Tests for the rich text editor's linewrap behavior were failing because expectations assumed trailing spaces would be preserved. Update assertions to expect trimmed newLine values (and document that whitespace-only lines become empty) so the tests reflect the actual trimming behavior implemented in the linewrap logic. Preserve single newlines when extracting editor text Fix extra blank lines produced by getTextContent(): instead of using getRoot().getTextContent(), iterate over root children, extract each paragraph's text, and join with single '\n'. This prevents added empty lines between paragraphs and resolves the failing test that was seeing too many newlines.
30b3651 to
2ad8c3c
Compare
|
@PavelLaptev fyi - if you could keep your eyes out for any regression related to this pr. It's a pretty substantial simplification to the rich text editor in that it removes the |
| .editor-scroller { | ||
| display: flex; | ||
| z-index: 0; | ||
| position: relative; | ||
| flex-direction: column; | ||
| height: 100%; | ||
| overflow: auto; | ||
| border: 0; | ||
| outline: 0; | ||
| /* It's unclear why the resizer is on by default on this element. */ | ||
| resize: none; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PavelLaptev this looks a bit sus, but also it wasn't being used.
rewrap Replace setTimeout with deterministic waits in HardWrapPlugin
tests Remove legacy MarkdownTransitionPlugin and simplify initialization