feat(html): a host states how far an edit may reach - #890
Merged
Merged
Conversation
`HtmlConfig::editing_scope` narrows the document view's editor to one run of text (`run`) or keeps the whole editor (`document`, the default). The body states it as `data-odr-editing-scope`, and the editor refuses an edit past it with the new `ErrorCode::edit_out_of_scope` (1010, `outOfScope`). The core has no edition, so `Document::is_editable` stays an engine fact and the scope is the one seam a host states its policy in. `Document::edit` is unchanged, so the gate refuses the edit and never the save. Bound in jni, apple, wasm and python. Decision 14 in `editing.md`. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QNQ2GtyAXXWGvnKBtwTEhQ
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QNQ2GtyAXXWGvnKBtwTEhQ
A run is a split the reader cannot see: Word splits runs by revision session, so a wall at a run stands in the middle of uniform text. A paragraph is a unit the reader sees, so a refusal there has a visible reason. Scope `paragraph` takes any edit inside one paragraph and refuses Enter, a merge, a multi-line paste and a selection over two paragraphs. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QNQ2GtyAXXWGvnKBtwTEhQ
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.
🤖 Generated with Claude Code
Why
The next core release makes
is_editabletrue for.ods,.xlsxand.pptx, and puts the full text editor into the page. The apps offer the pencil on that answer, so the next bump un-gates every new feature in the free editions by itself. The gate has to exist in the release the apps bump to.The core has no edition.
Document::is_editablestays an engine fact, because the capability table asserts it and because wasm, python and the CLI must not be gated. The core gives the host one seam and one signal back.What
HtmlConfig::editing_scope, an enum withparagraphanddocument. The default,document, keeps every existing consumer unchanged.data-odr-editing-scope, only when the render is editable.ErrorCode::edit_out_of_scope = 1010, namedoutOfScope, reported throughodr.onEditRefused.paragraph,document.jsrefuses Enter, Backspace at a paragraph start, a paste that holds a line break, and a selection over two paragraphs. A paragraph is a unit the reader sees; a run is not.odr.editing.scope()reads the attribute per edit, so a host can widen the scope without a second render..pptxor a.txtwitheditable = false.Document::editstays unchanged, so the gate refuses the edit and never the save.docs/design/editing.md, and a changelog entry.Checks
odr_test:ErrorCode.*and thehtmlediting tests pass.test/browser/text/tests.htmlhas a scope-paragraphgroup; it and the sheet and plaintext pages pass headless.