Remove IndentPlugin from the rich text editor#13233
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
Pull request overview
This PR removes the custom IndentPlugin Enter-key handler from the UI rich text editor, relying on Lexical’s default paragraph insertion behavior to avoid prior indentation/bullet continuation bugs.
Changes:
- Removed
IndentPluginfromRichTextEditorplugin composition. - Deleted
IndentPluginimplementation and its unit test suite. - Updated a
HardWrapPlugintest to simulate Enter viaselection.insertParagraph()instead of the removed command handler.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/ui/src/lib/richText/RichTextEditor.svelte | Stops importing/rendering IndentPlugin in the editor. |
| packages/ui/src/lib/richText/plugins/IndentPlugin.svelte | Deletes the custom Enter handler plugin implementation. |
| packages/ui/src/lib/richText/plugins/IndentPlugin.test.ts | Deletes unit tests that validated the removed custom behavior. |
| packages/ui/src/lib/richText/plugins/HardWrapPlugin.test.ts | Adjusts Enter simulation in tests to no longer depend on IndentPlugin. |
| import { standardTheme } from "$lib/richText/config/theme"; | ||
| // import CodeBlockTypeAhead from '$lib/richText/plugins/CodeBlockTypeAhead.svelte'; | ||
| import EmojiPlugin from "$lib/richText/plugins/Emoji.svelte"; | ||
| import IndentPlugin from "$lib/richText/plugins/IndentPlugin.svelte"; | ||
| import InlineCodePlugin from "$lib/richText/plugins/InlineCode.svelte"; | ||
| import PlainTextPastePlugin from "$lib/richText/plugins/PlainTextPastePlugin.svelte"; | ||
| import OnChangePlugin, { type OnChangeCallback } from "$lib/richText/plugins/onChange.svelte"; |
There was a problem hiding this comment.
IndentPlugin is removed from the editor and the plugin file is deleted, but there are still repo references to $lib/richText/plugins/IndentPlugin.svelte (e.g. packages/ui/tests/IndentPluginTestWrapper.svelte and packages/ui/tests/IndentPlugin.spec.ts). This will break TypeScript/build and likely CI. Please remove or update those tests/wrappers to reflect the new default Enter behavior (or replace them with new assertions for the built-in Lexical behavior).
The custom Enter key handling for bullet continuation and indentation was a source of bugs. Lexical's built-in paragraph insertion handles the basic Enter behavior, which is sufficient for our needs.
The custom Enter key handling for bullet continuation and indentation
was a source of bugs. Lexical's built-in paragraph insertion handles
the basic Enter behavior, which is sufficient for our needs.