From bcd52143cb12dad5c3ca651c531080cc9cd1ecff Mon Sep 17 00:00:00 2001 From: neon443 <69979447+neon443@users.noreply.github.com> Date: Mon, 1 Sep 2025 12:01:29 +0100 Subject: [PATCH] improve ios 16 ux: fix missing symbol in onboarding fix settings empty headers --- .../Contents.json | 12 +++ .../apple.terminal.on.rectangle.fill.svg | 95 +++++++++++++++++++ ShhShell/Host/HostsManager.swift | 2 +- ShhShell/Views/Onboarding/WelcomeChunk.swift | 17 +++- ShhShell/Views/Onboarding/WelcomeView.swift | 10 +- ShhShell/Views/Settings/SettingsView.swift | 51 ++++++---- 6 files changed, 157 insertions(+), 30 deletions(-) create mode 100644 Resources/Assets.xcassets/apple.terminal.on.rectangle.fill.symbolset/Contents.json create mode 100644 Resources/Assets.xcassets/apple.terminal.on.rectangle.fill.symbolset/apple.terminal.on.rectangle.fill.svg diff --git a/Resources/Assets.xcassets/apple.terminal.on.rectangle.fill.symbolset/Contents.json b/Resources/Assets.xcassets/apple.terminal.on.rectangle.fill.symbolset/Contents.json new file mode 100644 index 0000000..c7caa20 --- /dev/null +++ b/Resources/Assets.xcassets/apple.terminal.on.rectangle.fill.symbolset/Contents.json @@ -0,0 +1,12 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "symbols" : [ + { + "filename" : "apple.terminal.on.rectangle.fill.svg", + "idiom" : "universal" + } + ] +} diff --git a/Resources/Assets.xcassets/apple.terminal.on.rectangle.fill.symbolset/apple.terminal.on.rectangle.fill.svg b/Resources/Assets.xcassets/apple.terminal.on.rectangle.fill.symbolset/apple.terminal.on.rectangle.fill.svg new file mode 100644 index 0000000..c1dc312 --- /dev/null +++ b/Resources/Assets.xcassets/apple.terminal.on.rectangle.fill.symbolset/apple.terminal.on.rectangle.fill.svg @@ -0,0 +1,95 @@ + + + + + + + + + + Weight/Scale Variations + Ultralight + Thin + Light + Regular + Medium + Semibold + Bold + Heavy + Black + + + + + + + + + + + Design Variations + Symbols are supported in up to nine weights and three scales. + For optimal layout with text and other symbols, vertically align + symbols with the adjacent text. + + + + + + Margins + Leading and trailing margins on the left and right side of each symbol + can be adjusted by modifying the x-location of the margin guidelines. + Modifications are automatically applied proportionally to all + scales and weights. + + + + Exporting + Symbols should be outlined when exporting to ensure the + design is preserved when submitting to Xcode. + Template v.6.0 + Requires Xcode 16 or greater + Generated from apple.terminal.on.rectangle.fill + Typeset at 100.0 points + Small + Medium + Large + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ShhShell/Host/HostsManager.swift b/ShhShell/Host/HostsManager.swift index 3e3d953..d028c28 100644 --- a/ShhShell/Host/HostsManager.swift +++ b/ShhShell/Host/HostsManager.swift @@ -16,7 +16,7 @@ class HostsManager: ObservableObject, @unchecked Sendable { @Published var themes: [Theme] = [] @Published var selectedTheme: Theme = Theme.decodeLocalTheme(fileName: "xcodeDarkHC") ?? Theme.defaultTheme - @Published var selectedAnsi: Int = 1 + @Published var selectedAnsi: Int = 4 @Published var fonts: [UIFont] = [] @Published var selectedFont: String = "SF Mono" diff --git a/ShhShell/Views/Onboarding/WelcomeChunk.swift b/ShhShell/Views/Onboarding/WelcomeChunk.swift index 55d8e36..9a4ae90 100644 --- a/ShhShell/Views/Onboarding/WelcomeChunk.swift +++ b/ShhShell/Views/Onboarding/WelcomeChunk.swift @@ -8,19 +8,30 @@ import SwiftUI struct WelcomeChunk: View { - @State var symbol: String + @State var systemImage: String? + @State var image: String? @State var title: String @State var para: String @State var delay: TimeInterval = 0 @State private var spawnDate: Date = .now + var imageUnwrapped: Image { + if let systemImage { + return Image(systemName: systemImage) + } else if let image { + return Image(image) + } else { + return Image(systemName: "questionmark") + } + } + var body: some View { TimelineView(.animation) { tl in let time = tl.date.timeIntervalSince(spawnDate) HStack(spacing: 25) { if time > delay { - Image(systemName: symbol) + imageUnwrapped .resizable().scaledToFit() .symbolRenderingMode(.hierarchical) .frame(width: 50, height: 50) @@ -56,7 +67,7 @@ struct WelcomeChunk: View { #Preview { WelcomeChunk( - symbol: "trash", + systemImage: "trash", title: "The Trash", para: "Here's to the crazy ones." ) diff --git a/ShhShell/Views/Onboarding/WelcomeView.swift b/ShhShell/Views/Onboarding/WelcomeView.swift index 15e4de7..c59513a 100644 --- a/ShhShell/Views/Onboarding/WelcomeView.swift +++ b/ShhShell/Views/Onboarding/WelcomeView.swift @@ -40,31 +40,31 @@ struct WelcomeView: View { } WelcomeChunk( - symbol: "bolt.fill", + systemImage: "bolt.fill", title: "Blazing Fast", para: "", delay: 4 ) WelcomeChunk( - symbol: "apple.terminal.on.rectangle.fill", + image: "apple.terminal.on.rectangle.fill", title: "Multiple Sessions", para: "Connect to the same host again and again, or different ones", delay: 5 ) WelcomeChunk( - symbol: "swatchpalette.fill", + systemImage: "swatchpalette.fill", title: "Themes", para: "Customise ShhShell by importing themes, or make your own!", delay: 6 ) WelcomeChunk( - symbol: "lock.shield.fill", + systemImage: "lock.shield.fill", title: "Secure", para: "ShhShell uses secure Elliptic Curve keys, and keeps you safe by verifying hostkeys haven't changed", delay: 7 ) WelcomeChunk( - symbol: "ellipsis.circle", + systemImage: "ellipsis.circle", title: "And more...", para: "Snippets, iCloud Sync, Fonts, Terminal Filters, Connection History", delay: 8 diff --git a/ShhShell/Views/Settings/SettingsView.swift b/ShhShell/Views/Settings/SettingsView.swift index ac034f1..b3938cd 100644 --- a/ShhShell/Views/Settings/SettingsView.swift +++ b/ShhShell/Views/Settings/SettingsView.swift @@ -101,7 +101,7 @@ struct SettingsView: View { } .pickerStyle(.segmented) - Picker("", selection: $hostsManager.settings.cursorType.cursorShape) { + Picker("Shape", selection: $hostsManager.settings.cursorType.cursorShape) { ForEach(CursorShape.allCases, id: \.self) { type in Text(type.description).tag(type) } @@ -110,28 +110,37 @@ struct SettingsView: View { .labelsHidden() } - Toggle("location persistence", systemImage: "location.fill", isOn: $hostsManager.settings.locationPersist) - .onChange(of: hostsManager.settings.locationPersist) { _ in - if hostsManager.settings.locationPersist && !Backgrounder.shared.checkPermsStatus() { - Backgrounder.shared.requestPerms() + Section("Keepalive") { + Toggle("location persistence", systemImage: "location.fill", isOn: $hostsManager.settings.locationPersist) + .onChange(of: hostsManager.settings.locationPersist) { _ in + if hostsManager.settings.locationPersist && !Backgrounder.shared.checkPermsStatus() { + Backgrounder.shared.requestPerms() + } + } + Toggle("keep screen awake", systemImage: "cup.and.saucer.fill", isOn: $hostsManager.settings.caffeinate) + } + + Section("Bell") { + Toggle("bell sound", systemImage: "bell.and.waves.left.and.right", isOn: $hostsManager.settings.bellSound) + Toggle("bell haptic",systemImage: "iphone.radiowaves.left.and.right", isOn: $hostsManager.settings.bellHaptic) + } + + + Section("Terminal Filter") { + if #unavailable(iOS 17), hostsManager.settings.filter == .crt { + Label("iOS 17 Required", systemImage: "exclamationmark.triangle.fill") + .foregroundStyle(.yellow) + .transition(.opacity) + } + Picker("", selection: $hostsManager.settings.filter) { + ForEach(TerminalFilter.allCases, id: \.self) { filter in + Text(filter.description).tag(filter) } } - - Toggle("bell sound", systemImage: "bell.and.waves.left.and.right", isOn: $hostsManager.settings.bellSound) - Toggle("bell haptic",systemImage: "iphone.radiowaves.left.and.right", isOn: $hostsManager.settings.bellHaptic) - - Toggle("keep screen awake", systemImage: "cup.and.saucer.fill", isOn: $hostsManager.settings.caffeinate) - - if #unavailable(iOS 17), hostsManager.settings.filter == .crt { - Label("iOS 17 Required", systemImage: "exclamationmark.triangle.fill") - .foregroundStyle(.yellow) + .pickerStyle(.inline) + .labelsHidden() } - Picker("terminal filter", selection: $hostsManager.settings.filter) { - ForEach(TerminalFilter.allCases, id: \.self) { filter in - Text(filter.description).tag(filter) - } - } - .pickerStyle(.inline) + .animation(.spring, value: hostsManager.settings.filter) Section("App Icon") { ScrollView(.horizontal) { @@ -166,7 +175,7 @@ struct SettingsView: View { } } } - .listStyle(.sidebar) + .listStyle(.insetGrouped) .scrollContentBackground(.hidden) .onChange(of: hostsManager.settings) { _ in hostsManager.saveSettings()