Skip to content

macOS engine: perform_secondary_action Show Menu answers ok without confirming a menu appeared #374

Closed

Description

@SSFSKIM

Problem

When asked for "Show Menu" (AXShowMenu), the macOS engine's perform_secondary_action answers ok as soon as the Accessibility call returns success. It never checks that a menu appeared (native/engine/Sources/Engine/SecondaryAction.swift, performSecondaryAction: guard performed == .success). An app can accept the AX action and still show no menu, for example while a menu it timed out on is still running. The agent is then told the menu is open when it is not: ok with no effect, cua's hard-failure class. The owner's rule is that cua refuses input an app ignores.

Where it came from

cua #171 M4's Linux release gate, 2026-11-14 (rulings 684 and 685). The Linux engine had the same shape. Its right-button fallback in click_element and its perform_secondary_action showContextMenu both answered ok on the request. Under load, Chrome got into a state where it ignored showMenu, and both would have reported a false success. The Linux candidate 3 now makes every context-menu caller confirm, with the same detection copy uses, that a menu appeared within the menu wait, or refuse. That changes the earlier vendor-matching behavior (§7.2) and is recorded in the Linux spec's Decision Log. The macOS engine still has the vendor-style behavior.

What to build

  • After AXShowMenu succeeds, confirm that a menu appeared for the element's app: an AXMenu under the element or the app, or the app's AXFocusedUIElement inside a new AXMenu, within a short bounded wait. If none appears, refuse with a plain reason ("the menu could not be confirmed"). Answer ok only on a confirmed menu.
  • Check whether a click_element right-button route that answers ok on posting, without a menu read-back, exists on macOS. Treat it the same way.
  • Prove it per app family the macOS gate drives (AppKit, Chrome, Electron, Firefox, Safari/WebKit, Office or LibreOffice where available). A family whose menus never appear in its tree gets the plain refusal and a stated limit, not a false ok.
  • Units on the fake AX (no menu → refuse; menu → ok), and one live check per family.
  • Compare: this deliberately diverges from the vendor's answer. Record it in Independence 4: cua's own native accessibility engine (replace sky) measured against a native baseline #117's Decision Log, and make sure compare --engines on macOS treats it as intended, not as a parity break.

Not in scope

Other secondary actions (Increment, Raise, …) and whether each has an observable effect worth confirming. That is a separate question, to be ticketed if it turns up.

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P2
    on Nov 14, 2026
  2. SSFSKIM commented on Nov 14, 2026

    @SSFSKIM
    OwnerAuthor

    Design input from the Linux fix (cua #171, ruling 687, 2026-11-14). A web page or Electron app that handles contextmenu itself (preventDefault plus its own HTML menu, as in Docs-style apps) shows no native menu, so confirming a menu would refuse a request that actually worked. Linux answers with the existing 'sent, effect not seen' family, not a refusal: a named menuUnconfirmed (showContextMenu was sent, no menu was seen within 1 s, the app may have shown its own or ignored it; observe before any retry), next to clickUnconfirmed and scrollUnconfirmed. It also assesses accepting a newly showing ARIA role=menu node, found through events, as confirmation. macOS should do the same: menuUnconfirmed rather than a refusal, an AXMenu (including a web page's ARIA menu, which Chrome and Safari expose as AXMenu) counted as confirmation, and a preventDefault page as a negative control.

  3. added
    status:in-progress
    and removed
    status:ready-for-implementer
    on Nov 15, 2026
  4. SSFSKIM commented on Nov 15, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-progress: Taken by cursor235 per design 1ea561bc:733; build offline while Actions is locked

  5. added 12 commits that reference this issue on Nov 15, 2026
  6. added
    status:in-review
    and removed
    status:in-progress
    on Nov 17, 2026
  7. SSFSKIM commented on Nov 17, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-review: PR #391, gate green 44018067059

  8. removed
    status:in-review
    on Nov 17, 2026
  9. SSFSKIM commented on Nov 17, 2026

    @SSFSKIM
    OwnerAuthor

    [board] done: Landed via PR #391 (cua 0.28.3)

  10. added a commit that references this issue on Nov 17, 2026
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

    bugpriority:P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions