Skip to content

fix(lexical): collapse nested block paragraphs in single-line editors#4067

Merged
gbirman merged 2 commits into
mainfrom
gab/macro-1806-search-snippet-in-search-bar-creates-invalid-new-line
Jun 15, 2026
Merged

fix(lexical): collapse nested block paragraphs in single-line editors#4067
gbirman merged 2 commits into
mainfrom
gab/macro-1806-search-snippet-in-search-bar-creates-invalid-new-line

Conversation

@gbirman

@gbirman gbirman commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Two search-bar fixes: snippet insertion nested block paragraphs inside the single root paragraph (including a trailing-newline empty paragraph that rendered as an extra row), which the single-line plugin's root-child check missed — the plugin now unwraps nested block paragraphs onto the one line. Separately, a long pasted/inserted value grew the search field and pushed the title and nav controls off-screen; contain:inline-size keeps the field's width independent of its text so it truncates within the bar instead.

🤖 Generated with Claude Code

Snippet insertion replaces an inline await placeholder with block
paragraph nodes nested inside the single root paragraph, which the
single-line plugin's root-child check missed — so a snippet's trailing
newline rendered as an extra row in the search bar. Unwrap nested block
paragraphs onto the one line.
@macro-application

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bcccecbf-7081-485c-a88e-46185c927058

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The single-line Lexical plugin gains a ParagraphNode node transform to handle programmatic insertions (snippets, paste). The lexical import is extended to include $isRootNode. The new transform checks whether a ParagraphNode's parent is not the root; if so, it moves all of the paragraph's children to positions before the paragraph node and then removes the paragraph, preventing extra block rows from appearing in single-line mode.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows conventional commits format with 'fix:' prefix and is 69 characters, meeting the requirement of being under 72 characters. It clearly summarizes the main fix of collapsing nested block paragraphs in single-line editors.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description clearly relates to the changeset, explaining the two bugs being fixed and their solutions in the search bar component.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

contain:inline-size keeps the search field's width independent of its
text, so a long paste/snippet truncates within the bar instead of
growing the header and pushing the title and nav controls off-screen.
@gbirman gbirman merged commit fa490c8 into main Jun 15, 2026
19 checks passed
@gbirman gbirman deleted the gab/macro-1806-search-snippet-in-search-bar-creates-invalid-new-line branch June 15, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant