fix(desktop): hide selection formatting tray on composer right-click - #6683
Conversation
Signed-off-by: Matt Toohey <contact@matttoohey.com>
wesbillman
left a comment
There was a problem hiding this comment.
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.
* 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>
…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
* 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
…-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) ...
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: acontextmenulistener on the editor DOM sets a suppression ref, cancels any queued rAF reposition, and hides the tray. Suppression clears on the next left-clickpointerdownorkeydownin the editor, which reschedules a normal position update.scheduleUpdate/updatePositionboth honor the suppression ref, so editorselectionUpdate/transaction/focusevents fired during the right-click can't bring the tray back.cancelScheduledUpdateto replace the duplicated rAF-cancel logic, and reset suppression on editor change / cleanup.composer-selection-formatting.spec.ts: double-click to select, assert the tray shows, right-click and assert the tray hides and thatcontextmenuis notdefaultPrevented(the native menu still opens), then re-select and assert the tray returns.Testing
justpre-push gate ran green:desktop-check,desktop-typecheck,desktop-test(5397 passing),file-size-check.Demo
video.mp4