Skip to content

[Bug]: Keyboard-opened Cut/Copy/Paste menu doesn't focus its first item in the desktop app #45807

Done

Description

@nibarAhmed

Note

🤖 Claude Opus 5.5 posting on behalf of nibarAhmed

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. On Windows, run NVDA and open the T3 Code desktop app.
  2. Move focus to a text field, such as the composer.
  3. Open its context menu with the Applications key or Shift+F10.

Expected behavior

Focus lands on the first item of the menu (Cut, or the first spelling suggestion), and the screen reader announces it, the same way other keyboard-opened menus now behave since #41674.

Actual behavior

The menu opens, but no item is selected, so the screen reader announces no item until an arrow key is pressed.

This is the same bug as #37724 and #41660, but on a path the fix in #41674 didn't reach. That menu doesn't go through api.contextMenu.show(...). It is built in the main process from Electron's context-menu event (apps/desktop/src/window/DesktopWindow.ts, installContextMenu) and opened with ElectronMenu.popupTemplate (apps/desktop/src/electron/ElectronMenu.ts). That function calls menu.popup({ window, frame }) without sourceType, so Electron treats every opening as a mouse opening and selects nothing.

The event already reports how the menu was opened (params.menuSourceType), and Electron's docs say popup's sourceType should be set from that value. Passing it through popupTemplate should fix this. The same menu also holds spelling suggestions, Copy Link, Copy Email Address, Copy Image, and Reload in browser tabs, so all of those are affected too.

This only affects the desktop app. In a browser, this menu is the browser's own.

Impact

Minor bug or occasional failure

Version or commit

main @ 0c0b965

Environment

Windows 11 Pro (10.0.26300), T3 Code desktop, NVDA

Workaround

Press Down after the menu opens to reach the first item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions