Skip to content

Add Cmd+Enter exit-break to escape nested content#305

Open
johannesmutter wants to merge 1 commit into
mainfrom
cmd-enter-exit-break
Open

Add Cmd+Enter exit-break to escape nested content#305
johannesmutter wants to merge 1 commit into
mainfrom
cmd-enter-exit-break

Conversation

@johannesmutter

@johannesmutter johannesmutter commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Closes #18.

Summary

  • Adds Cmd/Ctrl + Enter shortcut that exits the current node property or nested node_array and inserts a new default node after the outer block in the document's top-level node_array.
  • New transform exit_break and command ExitBreakCommand modeled after Plate's exit-break.

Behavior

The transform walks the selection path from the root, finds the outermost node_array, and inserts a new default node right after the ancestor that sits in that array.

  • Caret in a paragraph (text node in body) → new node after the paragraph
  • Caret in a hero / story title or description (annotated_text on a block) → new node after the hero / story
  • Caret in a list item → exits the list entirely; new node after the list

Test plan

  • Cmd+Enter in a paragraph: inserts a new empty text node after the paragraph; caret moves there.
  • Cmd+Enter inside the hero title or description: inserts a new text node after the hero in body.
  • Cmd+Enter inside a list item: inserts a new text node after the whole list (the list_items array is exited).
  • Cmd+Enter inside a story title / description / button content: inserts a new text node after the story.
  • Plain Enter, Shift+Enter, and the other shortcuts still behave as before.

🤖 Generated with Claude Code

Walks the selection path to the outermost node_array and inserts a new
default node after the outer block there. Lets the user escape nested
content like list items or block-level annotated_text properties (hero
title, story description, etc.) and continue at the document's top
level.

Closes #18

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel

vercel Bot commented May 29, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
svedit Ready Ready Preview, Comment May 29, 2026 11:33am

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.

Exit Break with ⌘⏎ / CTRL + ⏎

1 participant