Skip to content

fix(cardinal): prevent stale selection from affecting context-menu targets#140

Merged
ldm0 merged 2 commits intomasterfrom
fix_right_click
Feb 16, 2026
Merged

fix(cardinal): prevent stale selection from affecting context-menu targets#140
ldm0 merged 2 commits intomasterfrom
fix_right_click

Conversation

@ldm0
Copy link
Collaborator

@ldm0 ldm0 commented Feb 16, 2026

  • require explicit target paths in showContextMenu
  • use clicked row path when right-clicking an unselected row
  • add App-level regression tests for file/event context-menu target resolution

…rgets

  - require explicit target paths in `showContextMenu`
  - use clicked row path when right-clicking an unselected row
  - add App-level regression tests for file/event context-menu target resolution
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates context-menu targeting so right-click actions always operate on the intended rows (clicked row vs current selection), eliminating stale selection from influencing menu actions.

Changes:

  • Changed useContextMenu.showContextMenu to require explicit targetPaths: string[] (no longer derives targets from selection).
  • Updated App row context-menu logic to use the clicked row path when right-clicking an unselected row, otherwise use the current selection snapshot.
  • Added/updated tests, including an App-level regression suite for context-menu target resolution.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cardinal/src/hooks/useContextMenu.ts Requires explicit context-menu target paths and builds menu items from provided targets.
cardinal/src/App.tsx Computes correct targetPaths for file rows and wraps events context menu to pass a single-item target list.
cardinal/src/hooks/tests/useContextMenu.test.tsx Updates hook tests to pass explicit targetPaths (and adds filtering coverage for empty entries).
cardinal/src/tests/App.contextMenu.test.tsx Adds regression tests ensuring clicked-row vs selection targeting behavior is correct at the App level.
cardinal/src/hooks/tests/useRemoteSort.test.ts Adds unit tests covering remote sort versioning, threshold behavior, and stale response handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ldm0 ldm0 merged commit d1a1728 into master Feb 16, 2026
9 checks passed
@ldm0 ldm0 deleted the fix_right_click branch February 16, 2026 08:46
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