fix(pages): comment box polish — selection lock, plain Enter to send, hide resolved pins (SUPER-2252, SUPER-2272, SUPER-2201)

Merged
HA
2mo ago
+58-78

What

SUPER-2252 — while a pick's toolbar, composer, or an existing thread's popover is open, the page could show two highlighted select areas at once and a click on another part of the page would silently jump the selection instead of requiring the open one to be dismissed first.

SUPER-2272 — the comment composer required Cmd/Ctrl+Enter to submit, with a "⌘↵ to send" hint taking up footer space. Plain Enter now submits (Shift+Enter still inserts a newline), and the hint is removed.

SUPER-2201 — resolved comment pins stayed on the page indefinitely, cluttering content that's already been addressed. Resolved threads no longer render a pin at all (no filter toggle — they're just gone).

Why / Fix

2252: the injected page runtime (page-comments-runtime.ts) only gated hover/click reporting on enabled (comment mode on/off), not on whether a pick was already open.

  • set-mode now carries a locked flag (draft, selection, or an active thread popover open).
  • The runtime stops emitting hover/pick while locked — clicks are still swallowed (preventDefault/stopPropagation) so the underlying page doesn't react, but they no longer start a new pick.
  • Host-side (PageCommentsView.tsx) ignores hover updates and stray pick messages while locked as a second guard.
  • Ported the same locked computation to the mobile viewer (PageDetailScreen.tsx), which sends set-mode independently.

2272: CommentComposer.tsx — swapped the metaKey || ctrlKey check for a plain Enter && !shiftKey check, and dropped the now-unused hint text and its i18n entry (bun run check:i18n regenerated all locale catalogs clean, 0 missing).

2201: both viewers (PageCommentsView.tsx on web, PageDetailScreen.tsx on mobile) filter threads to unresolved ones before computing pin positions, tracking anchors, and rendering — a resolved thread simply stops getting a pin.

Testing

  • bun run --filter=@superset/shared --filter=@superset/ui --filter=@superset/web typecheck — pass
  • bun run --filter=@superset/mobile typecheck — same pre-existing failures as main (unrelated HostWorkspaceItem/ChangesetFile types), nothing new from this change
  • bun run --filter=@superset/shared test — pass
  • bun run check:i18n — clean, 0 missing across all locales
  • biome check on touched files — clean

Closes SUPER-2252, SUPER-2272, SUPER-2201.

https://claude.ai/code/session_01V89xJG2G36ArAT9XM9WygA

Summary by CodeRabbit

  • Bug Fixes

    • Prevented page selections while a comment popover is open, including hover highlights and cursor changes.
    • Resolved comment threads no longer appear as pins or bubbles or participate in page tracking.
    • Improved comment selection behavior when a popover is open.
    • Enter during IME composition no longer submits comments.
  • Improvements

    • Comments can now be submitted by pressing Enter without Shift.
    • Removed the “⌘↵ to send” keyboard shortcut hint from supported translations.