Skip to content

fix(desktop): hide selection formatting tray on composer right-click - #6683

Merged
wesbillman merged 1 commit into
mainfrom
right-click-while-composing
Aug 24, 2026
Merged

fix(desktop): hide selection formatting tray on composer right-click#6683
wesbillman merged 1 commit into
mainfrom
right-click-while-composing

Conversation

@matt2e

@matt2e matt2e commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Right-clicking a text selection in the message composer left the selection formatting tray floating over the native context menu. This suppresses the tray for the duration of the right-click interaction.

Changes

  • SelectionFormattingTray.tsx: a contextmenu listener on the editor DOM sets a suppression ref, cancels any queued rAF reposition, and hides the tray. Suppression clears on the next left-click pointerdown or keydown in the editor, which reschedules a normal position update.
  • scheduleUpdate/updatePosition both honor the suppression ref, so editor selectionUpdate/transaction/focus events fired during the right-click can't bring the tray back.
  • Extracted cancelScheduledUpdate to replace the duplicated rAF-cancel logic, and reset suppression on editor change / cleanup.
  • E2E coverage in composer-selection-formatting.spec.ts: double-click to select, assert the tray shows, right-click and assert the tray hides and that contextmenu is not defaultPrevented (the native menu still opens), then re-select and assert the tray returns.

Testing

just pre-push gate ran green: desktop-check, desktop-typecheck, desktop-test (5397 passing), file-size-check.

Demo

video.mp4

Signed-off-by: Matt Toohey <contact@matttoohey.com>
@matt2e
matt2e requested a review from a team as a code owner August 24, 2026 11:27

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Carl, an automated reviewer, commenting via Wes’s GitHub account.

Reviewed exact head ab4cef455bd61d2a62505de1ac4c44faec0818c7 against base 0720f5380ce8a6c050afac159f8462c06cd51ab5. No actionable defects found.

I traced the full interaction lifecycle: native mouse right-click, queued editor selection/transaction/focus updates, primary-pointer and editor-key recovery, keyboard context-menu ordering, editor replacement/unmount, and listener/RAF cleanup. The synchronous suppression ref prevents queued updates from resurrecting the tray, and cleanup removes listeners from the captured editor DOM without changing focus, selection, or native context-menu default behavior.

Validation: the focused smoke E2E for this regression passed at the exact head and asserts tray hide, contextmenu.defaultPrevented === false, and primary-pointer recovery. git diff --check also passed. Desktop Core, smoke E2E shards, integration E2E, macOS build, aggregate Desktop, and DCO checks are green.

Residual risk: the new E2E directly covers mouse right-click and primary-pointer recovery; keyboard invocation and editor replacement are verified from event ordering and cleanup paths rather than dedicated runtime cases.

@wesbillman
wesbillman merged commit 2f13e30 into main Aug 24, 2026
24 checks passed
@wesbillman
wesbillman deleted the right-click-while-composing branch August 24, 2026 15:39
tellaho added a commit that referenced this pull request Aug 24, 2026
* origin/main:
  fix(desktop): emit singular `mention` feed category so alerts route correctly (#6665)
  fix(mobile): recover stale and shuffled messages (#6691)
  feat(mobile): browse and join open channels (#6243)
  show mention counts in channel notifications (#6696)
  fix(desktop): hide selection formatting tray on composer right-click (#6683)
  fix(desktop): stabilize members dialog scrolling (#6670)
  fix(desktop): keep member runtime status off the UI thread (#6445)
  perf(desktop): persist channel heads, collapse thread reads and reply sends (#6572)
  Downgrade desktop Huddles to audio protocol v2 (#6610)
  Polish Huddle participant interactions (#6312)

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
brow added a commit that referenced this pull request Aug 24, 2026
…ifications-pr

* origin/main:
  fix(desktop): emit singular `mention` feed category so alerts route correctly (#6665)
  fix(mobile): recover stale and shuffled messages (#6691)
  feat(mobile): browse and join open channels (#6243)
  show mention counts in channel notifications (#6696)
  fix(desktop): hide selection formatting tray on composer right-click (#6683)
  fix(desktop): stabilize members dialog scrolling (#6670)
  fix(desktop): keep member runtime status off the UI thread (#6445)
  perf(desktop): persist channel heads, collapse thread reads and reply sends (#6572)
  Downgrade desktop Huddles to audio protocol v2 (#6610)
  Polish Huddle participant interactions (#6312)
  Downgrade mobile Huddles to audio protocol v2 (#6558)
  perf(desktop): make the Projects surface render-cheap (#6460)
  refactor(acp): clarify agent prompt sections (#6501)
  Add mobile Huddles voice MVP (#6056)
  feat(desktop-messages): keep agents addressed across messages (#6315)
  fix(desktop): remove Buzz entity link previews (#6512)

Signed-off-by: Tom Brow <tomb@block.xyz>

# Conflicts:
#	mobile/lib/features/channels/channels_provider.dart
#	mobile/lib/shared/auth/auth_provider.dart
#	mobile/lib/shared/community/community_provider.dart
#	mobile/test/shared/auth/auth_provider_test.dart
#	mobile/test/shared/community/community_provider_test.dart
#	scripts/mobile-worktree-overrides.sh
kursmark-sq added a commit to kursmark-sq/buzz that referenced this pull request Aug 24, 2026
* origin/main: (90 commits)
  fix(desktop): bound thread /query and surface load errors, not false-empty (block#6447)
  fix(messages): route edits to the owning composer (block#6575)
  fix(mobile): join starter channels after accepting invite (block#5915)
  Add mobile profile editing (block#6583)
  fix(desktop): align jump-to-latest pill with composer height (block#6606)
  fix(desktop): emit singular `mention` feed category so alerts route correctly (block#6665)
  fix(mobile): recover stale and shuffled messages (block#6691)
  feat(mobile): browse and join open channels (block#6243)
  show mention counts in channel notifications (block#6696)
  fix(desktop): hide selection formatting tray on composer right-click (block#6683)
  fix(desktop): stabilize members dialog scrolling (block#6670)
  fix(desktop): keep member runtime status off the UI thread (block#6445)
  perf(desktop): persist channel heads, collapse thread reads and reply sends (block#6572)
  Downgrade desktop Huddles to audio protocol v2 (block#6610)
  Polish Huddle participant interactions (block#6312)
  Downgrade mobile Huddles to audio protocol v2 (block#6558)
  perf(desktop): make the Projects surface render-cheap (block#6460)
  refactor(acp): clarify agent prompt sections (block#6501)
  Add mobile Huddles voice MVP (block#6056)
  feat(desktop-messages): keep agents addressed across messages (block#6315)
  ...

Signed-off-by: Matt Kursmark <kursmark@squareup.com>

# Conflicts:
#	desktop/src/app/App.tsx
#	desktop/src/app/useCloseWindowShortcut.ts
michaelneale added a commit that referenced this pull request Aug 25, 2026
…-rc3

* origin/main: (86 commits)
  Centralize replaceable event persistence (#6660)
  feat(workflows): discover trigger filter values (#6712)
  feat(desktop): simplify the message action rail (#6529)
  fix(desktop): restore icon-only remote marker (#6491)
  fix(ci): prevent poisoned Rust caches (#6618)
  docs(security): route reports through private advisories (#6728)
  fix(composer): wrap Buzz chip labels without orphaning icons (#6581)
  fix(desktop): bound thread /query and surface load errors, not false-empty (#6447)
  fix(messages): route edits to the owning composer (#6575)
  fix(mobile): join starter channels after accepting invite (#5915)
  Add mobile profile editing (#6583)
  fix(desktop): align jump-to-latest pill with composer height (#6606)
  fix(desktop): emit singular `mention` feed category so alerts route correctly (#6665)
  fix(mobile): recover stale and shuffled messages (#6691)
  feat(mobile): browse and join open channels (#6243)
  show mention counts in channel notifications (#6696)
  fix(desktop): hide selection formatting tray on composer right-click (#6683)
  fix(desktop): stabilize members dialog scrolling (#6670)
  fix(desktop): keep member runtime status off the UI thread (#6445)
  perf(desktop): persist channel heads, collapse thread reads and reply sends (#6572)
  ...
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