Skip to content

Test: reproduce inconsistent raw text slot diagnostics - #211

Closed
nguyenyou wants to merge 1 commit into
raquo:masterfrom
nguyenyou:claude/text-inserter-slot-move
Closed

nguyenyou wants to merge 1 commit into
raquo:masterfrom
nguyenyou:claude/text-inserter-slot-move

Conversation

@nguyenyou

@nguyenyou nguyenyou commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Adds a reproducer for inconsistent diagnostics when a text <-- inserter is used inside a named Slot.

Observed behavior:

  • Initial placement renders the text in the default slot without reporting an error.
  • Moving the same inserter into another named slot reports a raw-text-in-named-slot error.
  • The text remains in the default slot and stays reactive in both cases.

This test documents the inconsistency without prescribing whether the initial placement or the move should change.

Run:

sbt 'testOnly *TextInserterSlotMoveSpec'

@nguyenyou
nguyenyou requested a review from raquo as a code owner September 22, 2026 10:30
@nguyenyou
nguyenyou force-pushed the claude/text-inserter-slot-move branch from 20e83b8 to e373a85 Compare September 22, 2026 10:33
@raquo

raquo commented Sep 22, 2026

Copy link
Copy Markdown
Owner

A text node can't belong to a slot, since we can only set a slot attribute on elements.

So we render the text node in the default slot regardless of where it's slotted and regardless of the errors we report.

But, reporting the error does seem desirable in this case – the user needs to know that they're trying to incorrectly put text into a slot that can't accept it.

Adds a reproducer for inconsistent diagnostics when a text inserter is used inside a named slot.

Co-Authored-By: Codex GPT-6 Astra <codex@openai.com>
@nguyenyou
nguyenyou force-pushed the claude/text-inserter-slot-move branch from e373a85 to d936da0 Compare September 22, 2026 10:57
@nguyenyou nguyenyou changed the title Test: reproduce spurious slot error when moving a text inserter Test: reproduce inconsistent raw text slot diagnostics Sep 22, 2026
@nguyenyou

Copy link
Copy Markdown
Contributor Author

Thanks for clarifying; I updated the PR to document the inconsistency.

@raquo

raquo commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Ah, I see. I'll need to look into it later but OTOH putting text <-- inside slotted children <-- should warn the first time too. Not sure why it doesn't.

@nguyenyou

Copy link
Copy Markdown
Contributor Author

The inconsistency seems to come from ChildTextInserter passing slotName = () initially, while moves use NestedGroup.moveToParent and eventually call TextNode.applySlot.

@nguyenyou nguyenyou closed this by deleting the head repository Oct 6, 2026
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