Skip to content

Feat/inline text editing - #899

Open
saif-ellafi wants to merge 9 commits into
hm21:stablefrom
saif-ellafi:feat/inline-text-editing
Open

saif-ellafi wants to merge 9 commits into
hm21:stablefrom
saif-ellafi:feat/inline-text-editing

Conversation

@saif-ellafi

Copy link
Copy Markdown
Contributor

Hello, this is a follow up feature proposition to allow in-line TextLayer editing.
This PR has been AI-Assisted and is rebased from the Stable containing boxed TextLayers.

These two would improve significantly the capabilities across platforms for editing text conveniently.

Description

Adds an opt-in way to type into a text layer on the canvas.

TextEditorConfigs.enableInlineEditing defaults to false. Until a host sets it to true, editTextLayer and openTextEditor still open the full-screen TextEditor, and editor keyboard shortcuts are unchanged.

When a host turns it on, the layer becomes a text field at its current size, scale, and optional text box. The edit is written once, on done, Ctrl/Cmd+Enter, or a click outside the layer. Escape cancels it and leaves the layer as it was. Empty text removes the layer. Done, image capture, layer capture, and history export commit an open edit before they read the layer, and they wait until the field has left the tree. While a session is open, editor shortcuts do not rotate, scale, or undo the layer, and Escape cancels the session instead of closing the editor.

Related Issue: Closes #

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

saif-ellafi and others added 9 commits October 20, 2026 18:53
Co-authored-by: Cursor <cursoragent@cursor.com>
- A new inline text is one undo step; Escape or empty text drops it without leaving a placeholder layer or a redo step.
- An edit that changes nothing records no history step.
- A tap outside that saves no longer swallows the next drag, and a drag that starts on the text keeps selecting text.
- Undo, redo and every sub-editor save an open edit first; removing the edited layer ends the edit.
- Editing the layer being typed into keeps the session; its context menu is left to the field.
- Clicks on the layer padding, its handles or a format bar keep the focus in the text on desktop.
- A format bar outside the editor no longer keeps blocking the next tap outside.
- New inline texts wrap like texts from the text editor; a boxed field ignores the platform text scale like the painted layer.
- Add an inline text editing example, the CHANGELOG entry and version 14.16.0.
@hm21

hm21 commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Thanks a lot for the PR, @saif-ellafi! 🙌 I tested it in the example and in the editor, and everything worked flawlessly.

I added a small follow-up commit on top:

  • A new inline text is a single undo step, and Escape or empty text removes it again without leaving the placeholder behind.
  • Saving an edit that changed nothing no longer adds a history step.
  • A click outside that saves no longer swallows the next drag.
  • Undo, redo and opening a sub-editor save an open edit first; removing the edited layer ends the edit.
  • Clicks on the layer padding, its handles or a format bar keep the focus in the text on desktop.
  • New inline texts wrap like texts from the text editor.
  • An "Inline Text Editing" example with a small format bar, the CHANGELOG entry and the version bump to 14.16.0.

It will be released in 14.16.0.

@saif-ellafi

Copy link
Copy Markdown
Contributor Author

That's a milestone! The library is getting so much more convenient for desktop use now! I even made a PDF Form Fillables -> PIE : leveraging sized text boxes and in-line editing becomes very useful for tabletop gaming use ^^

This branch has not been deployed

No deployments
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.

2 participants