Skip to content

Commit b8b931e

Browse files
committed
Copy Version Info On Click
1 parent a5d8fa7 commit b8b931e

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

CodeEdit/Features/About/Views/AboutDefaultView.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77

88
import SwiftUI
9+
import Foundation
910

1011
struct AboutDefaultView: View {
1112
private var appVersion: String {
@@ -64,6 +65,15 @@ struct AboutDefaultView: View {
6465
)
6566
.blur(radius: aboutMode == .about ? 0 : 10)
6667
.opacity(aboutMode == .about ? 1 : 0)
68+
.onTapGesture {
69+
// Create a string suitable for pasting into a bug report
70+
let macOSVersion = ProcessInfo.processInfo.operatingSystemVersion.semverString
71+
NSPasteboard.general.clearContents()
72+
NSPasteboard.general.setString(
73+
"CodeEdit: \(appVersion) (\(appBuild))\nmacOS: \(macOSVersion)",
74+
forType: .string
75+
)
76+
}
6777
}
6878
.padding(.horizontal)
6979
}
@@ -96,7 +106,6 @@ struct AboutDefaultView: View {
96106
Link(destination: Self.licenseURL) {
97107
Text("MIT License")
98108
.underline()
99-
100109
}
101110
Text(Bundle.copyrightString ?? "")
102111
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//
2+
// OperatingSystemVersion+String.swift
3+
// CodeEdit
4+
//
5+
// Created by Khan Winter on 5/27/25.
6+
//
7+
8+
import Foundation
9+
10+
extension OperatingSystemVersion {
11+
var semverString: String {
12+
"\(majorVersion).\(minorVersion).\(patchVersion)"
13+
}
14+
}

0 commit comments

Comments
 (0)