Skip to content

fix: preserve native chat context-menu targets on reopening - #33725

Merged
nwparker merged 1 commit into
mainfrom
nwparker/fix-native-chat-context-menu-reopen
Oct 26, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/fix-native-chat-context-menu-reopen

Conversation

@nwparker

@nwparker nwparker commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

A delayed close callback from an earlier native-chat context menu could clear the target of a menu opened immediately afterward, leaving link and file actions missing. Preserve the captured target while the current menu is open; release it normally once closed.

Adds two deterministic regressions using the real Radix menu for web-to-file and file-to-web reopening. All eight existing target cases and assertions are preserved. This behavior fix is separate from the module-organization refactor in #33665.

Validation so far:

  • On unchanged main, all eight existing cases pass and both new cases reproduce the target-loss failure; with the fix, all ten pass.
  • Hidden Electron rendered checks pass real-pointer web/file/web copy flows and empty-area cleanup; external integrations are isolated in that fixture.
  • Precommit lint, AST, React Doctor and formatting pass.
  • Two independent reviews approve the exact committed source.
  • All 22 checks in the normal local changed-file gate pass, including related tests, typechecks and quality checks.
  • Full PR CI and its aggregate gate pass, including Linux and Windows packaging.
  • Current-main integration preserves every upstream entry outside the two changed files.

@nwparker
nwparker marked this pull request as ready for review October 26, 2026 01:48
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fbd4abac-8596-42e8-ad84-b1960a70c767
Commits

Reviewing files that changed from the base of the PR and between 5de74e6 and 0c26212.

Files selected for processing: 2
  • src/renderer/src/components/native-chat/use-native-chat-context-menu.targets.test.tsx
  • src/renderer/src/components/native-chat/use-native-chat-context-menu.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

The close handler now clears the captured image, target, and focus-return element only when the menu remains closed. Regression tests cover reopening the menu on a different web-link or file target after selecting a copy action, and verify the next menu row and copied destination.

Priority: Normal

Merge Risk: Minimal · up to 0c262

The reopened menu retains its target in the inspected event sequence. The change is mergeable after normal checks.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description explains the bug, the fix, regression coverage, and validation results. However, it does not follow the required template. It omits the required ELI5, What Changed, Why, Linked Issue, … Rewrite the description using all required template headings. Add an actual issue link after "Fixes #"; provide visual proof or write "N/A" with a reason; document testing platforms and mark the relevant testing checkboxes; complete the AI …
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preserving native chat context-menu targets when reopening the menu.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the bug, the fix, regression coverage, and validation results. However, it does not follow the required template. It omits the required ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections. It also does not provide an actual linked issue.

Resolution

Rewrite the description using all required template headings. Add an actual issue link after "Fixes #"; provide visual proof or write "N/A" with a reason; document testing platforms and mark the relevant testing checkboxes; complete the AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections. Preserve the existing technical summary and validation details in the appropriate sections.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit ca064cc into main Oct 26, 2026
58 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.

1 participant