Skip to content

Prevent context menus from selecting on right-button release - #4440

Merged
SawyerHood merged 2 commits into
get-bb:mainfrom
ariofrio:ariofrio/fix-context-menu-release
Sep 29, 2026
Merged

SawyerHood merged 2 commits into
get-bb:mainfrom
ariofrio:ariofrio/fix-context-menu-release

Conversation

@ariofrio

@ariofrio ariofrio commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Human comments

What was wrong

When a context menu opens near a viewport edge, its final position can place an item at the right-button release target. Radix synthesizes a click on pointer-up for an item that did not receive pointer-down, so the opening gesture can select that item. This reproduces in the built-in thread-list (issue #4439) and was independently observed in Ribbon PR #122. The sidebar footer already had a local guard for the same behavior.

What changed

ContextMenuContent now prevents non-primary pointer-up defaults during capture while preserving a caller's capture handler. The footer's duplicate guard is removed. A thread-list regression test verifies that a right-button release over Pin selects nothing and leaves the menu open, while a later click still selects Pin.

Regenerated the release-pinned r/context-menu.json registry entry so plugin consumers receive the same fix. This is in follow-up commit c75b3d931; GitHub still shows the original PR head because the contributor gate closed the PR before that commit was pushed.

How you verified

  • Before the fix, the new test failed: the right-button release called setPinned and closed the menu (1 failed, 454 passed).
  • After the fix, pnpm exec turbo run test --filter=bb-plugin-thread-list passed (455 passed).
  • pnpm exec turbo run test --filter=@bb/app -- src/components/plugin/PluginSidebarFooterItems.test.tsx passed (12 passed).
  • pnpm exec turbo run typecheck --filter=@bb/shared-ui --filter=bb-plugin-thread-list --filter=@bb/app passed (7 tasks).
  • pnpm exec turbo run typecheck test --filter=@bb/plugin-registry passed (6 tasks, including the registry vendor test).
  • node scripts/check-plugin-forks.mjs plugins/thread-list passed: the forked plugin installed, typechecked, passed its tests, and built. The local nested checkout needed its CLI to resolve this checkout's SDK rather than the older SDK in the parent Ribbon repo.

Fixes #4439

Written by Codex

AGENT GENERATED

@github-actions

Copy link
Copy Markdown
Contributor

Thanks @ariofrio for the PR. This repo needs approval before a PR. Join the #contributors channel in Discord (https://discord.gg/kvBU6tJhcJ) and explain what you want to open a PR for and why. A maintainer then adds you to the allow list. This PR now closes on its own. Reopen it or open a new one after approval.

SawyerHood added a commit that referenced this pull request Sep 29, 2026
## Human comments

## What was wrong

`ariofrio` was absent from the contributor allowlist, so the PR gate
closed their PRs (#4440, #4444). Their earlier PR #2784 was merged.

## What changed

Added `ariofrio` to `.github/APPROVED_CONTRIBUTORS`, allowing the PR
gate to accept their PRs after merge.

## How you verified

Verified the canonical GitHub login, confirmed the diff adds only that
login exactly once case-insensitively, and ran `git diff --check`. CI
and SlopCop review are skipped for this data-only change.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

> AGENT GENERATED

Co-authored-by: Claude Opus 5.5 <[email protected]>
@SawyerHood SawyerHood reopened this Sep 29, 2026
@SawyerHood
SawyerHood merged commit 811d58d into get-bb:main Sep 29, 2026
18 checks passed
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.

Context menu selects an item on the opening right-button release

2 participants