Skip to content

Conversation

@palmer-cl
Copy link
Collaborator

In layout engine, fix the rendered styling for structured content:

  • when selected, select entire block of content without border breaks
  • when hover, all fragments display hover

Adds VRTs.

@linear
Copy link

linear bot commented Jan 26, 2026

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 58e6c67445

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +646 to +650
const resolved = this.#resolveStructuredContentBlockFromElement(doc, structuredContentLabel);
if (resolved) {
try {
const tr = editor.state.tr.setSelection(TextSelection.create(doc, resolved.start, resolved.end));
editor.view?.dispatch(tr);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Select structuredContentBlock with NodeSelection

Clicking a structured-content block label uses TextSelection.create(doc, resolved.start, resolved.end), but those positions are at the start/end of a structuredContentBlock (a block node with content: 'block*'), so ProseMirror throws “Not a text selection” and the try/catch silently drops the selection. In practice, clicking the block SDT label becomes a no-op; use NodeSelection.create(doc, resolved.pos) or select inside a textblock child to make label clicks work for block SDTs.

Useful? React with 👍 / 👎.

Comment on lines +5258 to +5261
const showLabel = isStart && !sdtLabelsRendered.has(currentKey);
if (showLabel) {
sdtLabelsRendered.add(currentKey);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reset SDT label tracking during virtual scroll

showLabel is suppressed once a key is in sdtLabelsRendered, but that set is only cleared in paint(). In virtualized mode, updateVirtualWindow mounts/unmounts pages without calling paint(), so after scrolling away and back, the start fragment’s label won’t render because the key is still in the set. This makes SDT labels disappear on virtual scroll; reset the set per virtual window rebuild or scope it to mounted pages.

Useful? React with 👍 / 👎.

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