Conversation
This update introduces a new mechanism for determining document placeholder eligibility by counting content blocks instead of root blocks. A block schema can now specify `authoring.contentRole: "chrome"` for elements like email signatures, which will not suppress the empty-document placeholder. The `getBlockContentRole` function has been added to handle this logic, defaulting to `"content"` for existing hosts. Additionally, the `getDocumentPlaceholderTargetBlockId` function identifies the appropriate block for the placeholder, ensuring that the hint is displayed correctly in documents that start with chrome elements. Changes include: - New `getBlockContentRole` function in `@input/pen-core`. - Updated placeholder visibility logic in React and Vue bindings. - Tests added to verify the new behavior regarding document placeholders. This change enhances the user experience by providing clearer visual cues in the editor.
Member
Author
|
bugbot run |
|
Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings. |
Member
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 4ea7542. Configure here.
krijnrijshouwer
approved these changes
Sep 16, 2026
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.
Pen decides whether to show the document placeholder based on whether the document is
empty, which previously worked by counting root blocks. That is too limiting: some blocks
(an email signature) are chrome the host puts in the document, and
should not count toward the document having content. With one present, the placeholder
never painted — and since the same boolean decides where a click below the blocks lands,
the caret went into the chrome too.e
Pen cannot infer this from what schemas already declare:
dividercarries the samefieldEditor: "none",selectionRole: "structural", andflowCapability: "flow-structural"as a signature block, and
[empty paragraph, divider]is a document with content in it.Fixed by introducing
authoring.contentRoleon the block schema, letting a host saywhether a block type counts toward a filled document. Defaults to
"content", so nothingchanges for a host that does not set it.
documentState.isEmptyanddata-emptyareuntouched. Specified as RI8 in
spec/rules/dom.md(document placeholder visibility had norule before), evidence in
ri8DocumentPlaceholder.test.ts,patchchangeset.Note
Medium Risk
Touches placeholder eligibility, pointer click-below caret placement, and a new public schema field across DOM and framework bindings; behavior change is opt-in via explicit
contentRole: "chrome".Overview
Adds
authoring.contentRole("content"|"chrome") so hosts can mark furniture (e.g. signatures) that should not count as user-facing document content.getBlockContentRolein@input/pen-corereads it and defaults to"content".Document empty-state handling shifts from counting root blocks to naming a target block:
getDocumentPlaceholderTargetBlockId(@input/pen-dom) replacescomputeDocumentPlaceholderVisible. Eligibility ignores chrome, requires exactly one empty inline editable content block, and returns that block’s id (ornull).resolveInlinePlaceholderVisibilitynow takesisDocumentPlaceholderTargetinstead ofisFirstBlock+isDocumentEmpty.React and Vue paint
emptyPlaceholderon the target block (notblockOrder[0]). Click-below-block gestures activate the target via the same helper.documentState.isEmpty/data-emptyare unchanged. RI8 is documented; patch changeset across pen-types, core, dom, react, and vue.Reviewed by Cursor Bugbot for commit 4ea7542. Bugbot is set up for automated code reviews on this repo. Configure here.