Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into update-german-local…
Browse files Browse the repository at this point in the history
…ization
  • Loading branch information
Schr0eder committed Mar 11, 2024
2 parents dc691ad + 6f432ee commit fd6baa8
Show file tree
Hide file tree
Showing 16 changed files with 1,520 additions and 155 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/appcast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
persist-credentials: false

- name: Cache 📦
uses: actions/cache@v4.0.0
uses: actions/cache@v4.0.1
with:
path: AppCast/vendor/bundle
key: ${{ runner.os }}-gems-v1.0-${{ hashFiles('AppCast/Gemfile') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Setup Ruby, JRuby and TruffleRuby
uses: ruby/setup-ruby@v1.171.0
uses: ruby/setup-ruby@v1.172.0
with:
ruby-version: '3.0'

Expand Down
4 changes: 2 additions & 2 deletions Xcodes/Backend/AppState+Runtimes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ extension AppState {
var updatedRuntime = runtime

// This loops through and matches up the simulatorVersion to the mappings
let simulatorBuildUpdate = downloadableRuntimes.sdkToSimulatorMappings.first { SDKToSimulatorMapping in
let simulatorBuildUpdate = downloadableRuntimes.sdkToSimulatorMappings.filter { SDKToSimulatorMapping in
SDKToSimulatorMapping.simulatorBuildUpdate == runtime.simulatorVersion.buildUpdate
}
updatedRuntime.sdkBuildUpdate = simulatorBuildUpdate?.sdkBuildUpdate
updatedRuntime.sdkBuildUpdate = simulatorBuildUpdate.map { $0.sdkBuildUpdate }
return updatedRuntime
}

Expand Down
2 changes: 1 addition & 1 deletion Xcodes/Frontend/About/AcknowledgementsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct AcknowledgmentsView: View {
)!
.addingAttribute(.foregroundColor, value: NSColor.labelColor)
)
.frame(minWidth: 500, minHeight: 500)
.frame(minWidth: 600, minHeight: 500)
}
}

Expand Down
4 changes: 3 additions & 1 deletion Xcodes/Frontend/InfoPane/CompilersView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ struct CompilersView: View {
if let compilers = compilers {
VStack(alignment: .leading) {
Text("Compilers").font(.headline)
Text(Self.content(from: compilers)).font(.subheadline)
Text(Self.content(from: compilers))
.font(.subheadline)
.textSelection(.enabled)
}
} else {
EmptyView()
Expand Down
5 changes: 3 additions & 2 deletions Xcodes/Frontend/InfoPane/InfoPane.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ struct InfoPane: View {
Text(verbatim: "Xcode \(xcode.description) \(xcode.version.buildMetadataIdentifiersDisplay)")
.font(.title)
.frame(maxWidth: .infinity, alignment: .leading)
.textSelection(.enabled)
}
InfoPaneControls(xcode: xcode)
}
Expand Down Expand Up @@ -146,12 +147,12 @@ var xcodeDict: [XcodePreviewName: Xcode] = [
var downloadableRuntimes: [DownloadableRuntime] = {
var runtimes = try! JSONDecoder().decode([DownloadableRuntime].self, from: Current.files.contents(atPath: Path.runtimeCacheFile.string)!)
// set iOS to installed
let iOSIndex = runtimes.firstIndex { $0.sdkBuildUpdate == "19E239" }!
let iOSIndex = 0//runtimes.firstIndex { $0.sdkBuildUpdate.contains == "19E239" }!
var iOSRuntime = runtimes[iOSIndex]
iOSRuntime.installState = .installed
runtimes[iOSIndex] = iOSRuntime

let watchOSIndex = runtimes.firstIndex { $0.sdkBuildUpdate == "20R362" }!
let watchOSIndex = 0//runtimes.firstIndex { $0.sdkBuildUpdate.first == "20R362" }!
var runtime = runtimes[watchOSIndex]
runtime.installState = .installing(
RuntimeInstallationStep.downloading(
Expand Down
2 changes: 1 addition & 1 deletion Xcodes/Frontend/InfoPane/PlatformsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct PlatformsView: View {
let builds = xcode.sdks?.allBuilds()
let runtimes = builds?.flatMap { sdkBuild in
appState.downloadableRuntimes.filter {
$0.sdkBuildUpdate == sdkBuild
$0.sdkBuildUpdate?.contains(sdkBuild) ?? false
}
}

Expand Down
4 changes: 3 additions & 1 deletion Xcodes/Frontend/InfoPane/SDKsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ struct SDKsView: View {
} else {
VStack(alignment: .leading) {
Text("SDKs").font(.headline)
Text(content).font(.subheadline)
Text(content)
.font(.subheadline)
.textSelection(.enabled)
}
}
}
Expand Down
22 changes: 13 additions & 9 deletions Xcodes/Frontend/Preferences/AdvancedPreferencePane.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ struct AdvancedPreferencePane: View {
}
Text("InstallPathDescription")
.font(.footnote)
.foregroundStyle(.secondary)
.fixedSize(horizontal: false, vertical: true)
}
}
Expand Down Expand Up @@ -73,6 +74,7 @@ struct AdvancedPreferencePane: View {
}
Text("LocalCachePathDescription")
.font(.footnote)
.foregroundStyle(.secondary)
.fixedSize(horizontal: false, vertical: true)
}
}
Expand All @@ -94,6 +96,7 @@ struct AdvancedPreferencePane: View {

Text(appState.onSelectActionType.detailedDescription)
.font(.footnote)
.foregroundStyle(.secondary)
.fixedSize(horizontal: false, vertical: true)
Spacer()
.frame(height: 20)
Expand All @@ -102,6 +105,7 @@ struct AdvancedPreferencePane: View {
.disabled(appState.createSymLinkOnSelectDisabled)
Text("AutomaticallyCreateSymbolicLinkDescription")
.font(.footnote)
.foregroundStyle(.secondary)
.fixedSize(horizontal: false, vertical: true)
}
.fixedSize(horizontal: false, vertical: true)
Expand All @@ -114,6 +118,7 @@ struct AdvancedPreferencePane: View {
.disabled(appState.createSymLinkOnSelectDisabled)
Text("ShowOpenInRosettaDescription")
.font(.footnote)
.foregroundStyle(.secondary)
.fixedSize(horizontal: false, vertical: true)
}
.groupBoxStyle(PreferencesGroupBoxStyle())
Expand All @@ -128,16 +133,18 @@ struct AdvancedPreferencePane: View {
case .installed:
Text("HelperInstalled")
case .notInstalled:
HStack {
Text("HelperNotInstalled")
VStack(alignment: .leading) {
Button("InstallHelper") {
appState.installHelperIfNecessary()
}
Text("HelperNotInstalled")
.font(.footnote)
}
}

Text("PrivilegedHelperDescription")
.font(.footnote)
.foregroundStyle(.secondary)
.fixedSize(horizontal: false, vertical: true)

Spacer()
Expand All @@ -153,21 +160,18 @@ struct AdvancedPreferencePane_Previews: PreviewProvider {
Group {
AdvancedPreferencePane()
.environmentObject(AppState())
.frame(maxWidth: 500)
.frame(maxWidth: 600)
}
.frame(width: 500, height: 700, alignment: .center)
.frame(width: 600, height: 700, alignment: .center)
}
}

// A group style for the preferences
struct PreferencesGroupBoxStyle: GroupBoxStyle {
func makeBody(configuration: Configuration) -> some View {
HStack(alignment: .top, spacing: 20) {
HStack {
Spacer()
configuration.label
}
.frame(width: 120)
configuration.label
.frame(width: 180, alignment: .trailing)

VStack(alignment: .leading) {
configuration.content
Expand Down
11 changes: 7 additions & 4 deletions Xcodes/Frontend/Preferences/DownloadPreferencePane.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct DownloadPreferencePane: View {
}
}
.labelsHidden()
.fixedSize()

AttributedText(dataSourceFootnote)
}
Expand All @@ -34,6 +35,7 @@ struct DownloadPreferencePane: View {
}
}
.labelsHidden()
.fixedSize()

AttributedText(downloaderFootnote)
}
Expand All @@ -50,7 +52,7 @@ struct DownloadPreferencePane: View {
string: string,
attributes: [
.font: NSFont.preferredFont(forTextStyle: .footnote, options: [:]),
.foregroundColor: NSColor.labelColor
.foregroundColor: NSColor.secondaryLabelColor
]
)
attributedString.addAttribute(.link, value: URL(string: "https://xcodereleases.com")!, range: NSRange(string.range(of: "Xcode Releases")!, in: string))
Expand All @@ -63,7 +65,7 @@ struct DownloadPreferencePane: View {
string: string,
attributes: [
.font: NSFont.preferredFont(forTextStyle: .footnote, options: [:]),
.foregroundColor: NSColor.labelColor
.foregroundColor: NSColor.secondaryLabelColor
]
)
attributedString.addAttribute(.link, value: URL(string: "https://github.com/aria2/aria2")!, range: NSRange(string.range(of: "aria2")!, in: string))
Expand All @@ -74,9 +76,10 @@ struct DownloadPreferencePane: View {
struct DownloadPreferencePane_Previews: PreviewProvider {
static var previews: some View {
Group {
GeneralPreferencePane()
DownloadPreferencePane()
.environmentObject(AppState())
.frame(maxWidth: 500)
.frame(maxWidth: 600)
.frame(minHeight: 300)
}
}
}
6 changes: 2 additions & 4 deletions Xcodes/Frontend/Preferences/ExperiementsPreferencePane.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ struct ExperimentsPreferencePane: View {
.fixedSize(horizontal: false, vertical: true)
}
.groupBoxStyle(PreferencesGroupBoxStyle())

Divider()
}
}

Expand All @@ -29,7 +27,7 @@ struct ExperimentsPreferencePane: View {
string: string,
attributes: [
.font: NSFont.preferredFont(forTextStyle: .footnote, options: [:]),
.foregroundColor: NSColor.labelColor
.foregroundColor: NSColor.secondaryLabelColor
]
)
attributedString.addAttribute(.link, value: URL(string: "https://twitter.com/_saagarjha")!, range: NSRange(string.range(of: "@_saagarjha")!, in: string))
Expand All @@ -43,7 +41,7 @@ struct ExperimentsPreferencePane_Previews: PreviewProvider {
Group {
ExperimentsPreferencePane()
.environmentObject(AppState())
.frame(maxWidth: 500)
.frame(maxWidth: 600)
}
}
}
2 changes: 1 addition & 1 deletion Xcodes/Frontend/Preferences/GeneralPreferencePane.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct GeneralPreferencePane_Previews: PreviewProvider {
Group {
GeneralPreferencePane()
.environmentObject(AppState())
.frame(maxWidth: 500)
.frame(maxWidth: 600)
}
}
}
2 changes: 1 addition & 1 deletion Xcodes/Frontend/Preferences/PreferencesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ struct PreferencesView: View {
.tag(Tabs.experiment)
}
.padding(20)
.frame(width: 500)
.frame(width: 600)
}
}
6 changes: 5 additions & 1 deletion Xcodes/Frontend/Preferences/UpdatesPreferencePane.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ struct UpdatesPreferencePane: View {
Button("CheckNow") {
updater.checkForUpdates()
}
.padding(.top)

Text(String(format: localizeString("LastChecked"), lastUpdatedString))
.font(.footnote)
.foregroundStyle(.secondary)
}
.frame(maxWidth: .infinity, alignment: .leading)
}
Expand Down Expand Up @@ -140,7 +142,9 @@ struct UpdatesPreferencePane_Previews: PreviewProvider {
Group {
UpdatesPreferencePane()
.environmentObject(AppState())
.frame(maxWidth: 500)
.environmentObject(ObservableUpdater())
.frame(maxWidth: 600)
.frame(minHeight: 300)
}
}
}
7 changes: 7 additions & 0 deletions Xcodes/Frontend/SignIn/SignInCredentialsView.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import SwiftUI

struct SignInCredentialsView: View {
private enum FocusedField {
case username, password
}

@EnvironmentObject var appState: AppState
@State private var username: String = ""
@State private var password: String = ""
@FocusState private var focusedField: FocusedField?

var body: some View {
VStack(alignment: .leading) {
Expand All @@ -16,11 +21,13 @@ struct SignInCredentialsView: View {
TextField(text: $username) {
Text(verbatim: "example@icloud.com")
}
.focused($focusedField, equals: .username)
}
HStack {
Text("Password")
.frame(minWidth: 100, alignment: .trailing)
SecureField("Required", text: $password)
.focused($focusedField, equals: .password)
}
if appState.authError != nil {
HStack {
Expand Down
Loading

0 comments on commit fd6baa8

Please sign in to comment.