#5127·plate

[Beta]: Comments composer hides the selected range while focus is in the popover

Author: felixfeng33Created Sep 14, 2026Updated Sep 14, 2026
Labelsbug

Bug type

Behavior bug (incorrect output/state without crash)

Browser surface

Yes

Summary

Opening a new comment from selected text moves focus into the comment composer, but the source selection is no longer visibly distinguishable; the AI Menu preserves the same editing context.

Public reproduction URL

NOT_ENOUGH_INFO

Steps to reproduce

  1. Check out Plate next at 5a899edcbea2c31f1bd34dc575c9dd3860c577d0.
  2. Run pnpm --filter www dev --port 3297.
  3. Open http://localhost:3297/blocks/discussion-proof.
  4. Select text in the primary editor.
  5. Press Command+Shift+M to open the new-comment composer.
  6. Observe the selected source range while focus is inside the composer.

Expected behavior

The selected source range remains clearly visible while focus is inside the comment composer, matching the inactive-selection behavior used by the AI Menu. Plite's Editable contract states that focus moving to an element under data-plite-keep-selection-visible paints the live canonical selection.

Actual behavior

The comment composer opens and receives focus, but the selected source range is covered or visually indistinguishable behind the popover. The attached screenshot captures the final state.

Acceptance criteria

  • The selected range remains clearly visible while the new-comment composer has focus.
  • The shortcut and toolbar entry paths produce the same result.
  • Existing comment highlights remain visually distinguishable from the inactive selection.
  • AI Menu and Comments use the same inactive-selection behavior.

Plate / Slate / React versions

yaml
plate: 54.0.0-beta.1
plite: 0.0.1
slate: NOT_ENOUGH_INFO
react: 19.2.8

Operating system

macOS 15.7.3, Chrome 152.0.7977.84

Install method

Plate repository checkout with pnpm dev

Framework / app setup

Next.js 16.3.2 development server

Affected packages or entry points

plitejs/react inactive selection, copied comment and discussion UI, and /blocks/discussion-proof

Minimal code or config excerpt

typescript
<FloatingPopoverContent data-plite-keep-selection-visible>
  <NewComment />
</FloatingPopoverContent>

Logs, screenshots, and evidence

bash
No runtime exception is required. Live inspection found focus inside the New comment editor, a marked keep-selection-visible ancestor, and two data-plite-inactive-selection spans with the expected brand/25 background.

Impact and severity

Affected: reviewers creating comments on selected text in the current Beta UI. Severity: annoying but the workflow remains usable. Frequency: observed in the supplied screenshot. Consequence: reviewers lose the visible source context while writing the comment.

Additional information

Testing lane: Plate next / Beta at 5a899edcbea2c31f1bd34dc575c9dd3860c577d0.

Source comparison: apps/www/src/registry/components/editor/ai-menu.tsx and apps/www/src/registry/components/editor/discussion.tsx. The inactive-selection nodes exist, so investigate popover placement, occlusion, and contrast before changing the selection lifecycle.

Screenshot:

Image