User-clarified rule for the right drawer: when the current block is
empty, the drawer shows ONLY the constructors (Insert panel) — no
point in showing format/block-scope options on a blank line. When
the block has any content, the inspector for that content type
appears (paragraph + text-align, heading, image, code, etc.).
Implementation:
- New helper `isEmptyEditableTextBlock(block)` next to the slash
command catalog. It returns true for paragraph / heading / quote /
code-without-language whose single text child is the empty string.
Atomic blocks (image / table / list) never qualify — they always
carry structure.
- `WordsDrawerProvider.modes` derivation gates the scope-stack
computation behind `!isEmptyTextBlock(currentNode)`. Empty text
blocks fall through directly to `['default']` (just Insert);
blocks with content build the scope stack as before (format /
block / cell / row / table / list-item / list) and Insert
collapses at the bottom of the stack.
- Atomic blocks (image / code with language) still push their
scope unconditionally because their "content" lives in
attributes, not children.
Before: clicking "+" → empty paragraph inserted → caret on it →
drawer showed `['block', 'default']` with Block expanded
(text-align controls for an empty line — useless), Insert
collapsed below.
After: clicking "+" → empty paragraph inserted → caret on it →
drawer shows `['default']` only (Insert expanded). As soon as the
user types a character, Block panel appears above with Insert
collapsed underneath.
152/152 soma words tests still pass; `npm run check` clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>