Skip to content

Remove IndentPlugin from the rich text editor#13233

Draft
mtsgrd wants to merge 1 commit intomasterfrom
mg-branch-20
Draft

Remove IndentPlugin from the rich text editor#13233
mtsgrd wants to merge 1 commit intomasterfrom
mg-branch-20

Conversation

@mtsgrd
Copy link
Copy Markdown
Contributor

@mtsgrd mtsgrd commented Apr 8, 2026

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.

Copilot AI review requested due to automatic review settings April 8, 2026 20:56
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 8, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
gitbutler-web Ignored Ignored Preview Apr 8, 2026 9:05pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 IndentPlugin from RichTextEditor plugin composition.
  • Deleted IndentPlugin implementation and its unit test suite.
  • Updated a HardWrapPlugin test to simulate Enter via selection.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.

Comment on lines 5 to 10
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";
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
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.
@mtsgrd mtsgrd marked this pull request as draft April 8, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants