Skip to content

fix(editor): add Tab/Shift+Tab list indentation (#202)#211

Merged
zacharias-ona merged 1 commit into
mainfrom
fix/202-list-tab-indentation
Apr 17, 2026
Merged

fix(editor): add Tab/Shift+Tab list indentation (#202)#211
zacharias-ona merged 1 commit into
mainfrom
fix/202-list-tab-indentation

Conversation

@zacharias-ona
Copy link
Copy Markdown
Collaborator

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 TabIndentationPlugin doesn't work for list items because ListItemNode.canIndent() returns false, causing Tab to insert a tab character instead of indenting.

How

Added a custom ListTabIndentationPlugin that intercepts KEY_TAB_COMMAND at high priority when the cursor is inside a ListItemNode. It dispatches INDENT_CONTENT_COMMAND (Tab) or OUTDENT_CONTENT_COMMAND (Shift+Tab) inside editor.update(), which Lexical's RichTextPlugin handler routes to ListItemNode.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:

  • Tab indents a bullet list item into a nested list
  • Shift+Tab unindents a nested bullet list item back to flat
  • Tab indents a numbered list item into a nested list

All tests verify the DOM structure (nested <ul>/<ol> elements) after keyboard interaction.

Co-authored-by: Ona <no-reply@ona.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 17, 2026

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

Project Deployment Actions Updated (UTC)
memo Ready Ready Preview, Comment Apr 17, 2026 10:26pm

Request Review

@zacharias-ona zacharias-ona merged commit 2efe153 into main Apr 17, 2026
6 checks passed
@zacharias-ona zacharias-ona deleted the fix/202-list-tab-indentation branch April 17, 2026 22:32
@zacharias-ona
Copy link
Copy Markdown
Collaborator Author

✅ UI verification passed — design spec compliance confirmed.

Static analysis: The new ListTabIndentationPlugin is purely behavioral (intercepts KEY_TAB_COMMAND, dispatches INDENT/OUTDENT). It renders null — no DOM output, no styling, no color/typography/spacing changes. No design spec violations.

Visual verification: Playwright screenshots of the editor page (desktop dark + mobile) show no regressions. Layout, colors, typography, spacing, and responsive behavior all match .agents/design.md.

@zacharias-ona
Copy link
Copy Markdown
Collaborator Author

✅ Post-merge verification passed.

E2E suite: 50/50 tests passed (including the 3 new editor-list-indent tests from this PR).

Ad-hoc smoke tests:

  • ✅ Landing page — loaded, has title
  • /sign-in — rendered with email input
  • /api/health — returned OK
  • ✅ Authenticated login flow — redirected to workspace
  • ✅ Workspace page — fully loaded
  • ✅ No console errors (unauthenticated or authenticated)

Skipped:

  • /dashboard (route does not exist)
  • Editor navigation via sidebar (no page buttons with timestamps found in test workspace)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: cannot indent bullets or numbered list items

1 participant