Add Copy Link to the macOS video context menu (#972)

SwiftUI's ShareLink menu on macOS offers no Copy Link item, so there was
no way to copy a video URL from a context menu. Add a macOS-only Copy
Link action next to Share.
This commit is contained in:
Arkadiusz Fal
2026-10-20 19:10:20 +02:00
parent c4272c86f7
commit cf880ab84b
2 changed files with 21 additions and 0 deletions

View File

@@ -20190,6 +20190,16 @@
}
}
},
"video.context.copyLink" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Copy Link"
}
}
}
},
"video.context.download" : {
"localizations" : {
"en" : {

View File

@@ -267,6 +267,17 @@ struct VideoContextMenuContent: View {
Label(String(localized: "video.context.share"), systemImage: "square.and.arrow.up")
}
#endif
// The macOS ShareLink menu has no Copy Link item (#972)
#if os(macOS)
Button {
let pasteboard = NSPasteboard.general
pasteboard.clearContents()
pasteboard.setString((appEnvironment?.shareURL(for: video) ?? video.shareURL).absoluteString, forType: .string)
} label: {
Label(String(localized: "video.context.copyLink"), systemImage: "link")
}
#endif
}
var body: some View {