fix(editor): add Tab/Shift+Tab list indentation (#202)#211
Merged
Conversation
Co-authored-by: Ona <no-reply@ona.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
|
✅ UI verification passed — design spec compliance confirmed. Static analysis: The new Visual verification: Playwright screenshots of the editor page (desktop dark + mobile) show no regressions. Layout, colors, typography, spacing, and responsive behavior all match |
Collaborator
Author
|
✅ Post-merge verification passed. E2E suite: 50/50 tests passed (including the 3 new Ad-hoc smoke tests:
Skipped:
|
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.
Closes #202
What
Pressing Tab inside a bullet or numbered list item did nothing — there was no way to create nested lists. Lexical's built-in
TabIndentationPlugindoesn't work for list items becauseListItemNode.canIndent()returnsfalse, causing Tab to insert a tab character instead of indenting.How
Added a custom
ListTabIndentationPluginthat interceptsKEY_TAB_COMMANDat high priority when the cursor is inside aListItemNode. It dispatchesINDENT_CONTENT_COMMAND(Tab) orOUTDENT_CONTENT_COMMAND(Shift+Tab) insideeditor.update(), which Lexical'sRichTextPluginhandler routes toListItemNode.setIndent()to create/remove nested list levels. Max indent depth is capped at 7.Testing
Added 3 Playwright E2E tests in
e2e/editor-list-indent.spec.ts:All tests verify the DOM structure (nested
<ul>/<ol>elements) after keyboard interaction.