[GH-ISSUE #529] [Bug]: How to add a custom ContextMenuItem? #252

Closed
opened 2026-03-03 18:56:10 +03:00 by kerem · 1 comment
Owner

Originally created by @lstarboy on GitHub (Nov 20, 2022).
Original GitHub issue: https://github.com/PlayCover/PlayCover/issues/529

Describe the bug

When I add a custom contextmenu item, I get a build error: Trailing closure passed to parameter of type 'ContextMenu?' that does not accept a closure ( Generic parameter 'MenuItems' coudl not be inferred). But I only add a custom menuitem copyed from a existing one, I still get a error. The source code(In the file PlayAppView line 59) like:
Button(action: {
app.showInFinder()
}, label: {
Text("playapp.showInFinder")
})
Button(action: {
app.sign() // change here
}, label: {
Text("playapp.showInFinder") // temp use the existing text
})

Steps to reproduce

Only add a custom menuitem at line 59 in PlayAppView copyed from a existing one(line 54-58), and change the action to app.sign(), save the file and build

Expected behaviour

No build error

Crash log

No response

What version of PlayCover are you using?

Nightly/beta

What version of macOS are you using?

Monterey (macOS 12)

Issue Language

  • Yes my issue is written in English
Originally created by @lstarboy on GitHub (Nov 20, 2022). Original GitHub issue: https://github.com/PlayCover/PlayCover/issues/529 ### Describe the bug When I add a custom contextmenu item, I get a build error: Trailing closure passed to parameter of type 'ContextMenu<MenuItem>?' that does not accept a closure ( Generic parameter 'MenuItems' coudl not be inferred). But I only add a custom menuitem copyed from a existing one, I still get a error. The source code(In the file PlayAppView line 59) like: Button(action: { app.showInFinder() }, label: { Text("playapp.showInFinder") }) Button(action: { app.sign() // change here }, label: { Text("playapp.showInFinder") // temp use the existing text }) ### Steps to reproduce Only add a custom menuitem at line 59 in PlayAppView copyed from a existing one(line 54-58), and change the action to app.sign(), save the file and build ### Expected behaviour No build error ### Crash log _No response_ ### What version of PlayCover are you using? Nightly/beta ### What version of macOS are you using? Monterey (macOS 12) ### Issue Language - [X] Yes my issue is written in English
kerem 2026-03-03 18:56:10 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@IsaacMarovitz commented on GitHub (Dec 29, 2022):

Issues are not a place to ask code-related questions.

<!-- gh-comment-id:1367632013 --> @IsaacMarovitz commented on GitHub (Dec 29, 2022): Issues are not a place to ask code-related questions.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/PlayCover#252
No description provided.