From d4b778b4586aee26bdb9e5128841e6497423e242 Mon Sep 17 00:00:00 2001 From: neon443 <69979447+neon443@users.noreply.github.com> Date: Fri, 7 Nov 2025 11:12:41 +0000 Subject: [PATCH] =?UTF-8?q?fix=20closing=20a=20session=20crash=20remove=20?= =?UTF-8?q?theme=20preview=20thingy=20cos=20it=20doesnt=20work=20?= =?UTF-8?q?=F0=9F=98=AD=20padding=20on=20aboutview?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ShhShell/Views/About/AboutView.swift | 1 + ShhShell/Views/Hosts/ConnectionView.swift | 6 ++- ShhShell/Views/Sessions/SessionView.swift | 1 + ShhShell/Views/Terminal/ShellTabView.swift | 6 ++- ShhShell/Views/Themes/ThemeEditorView.swift | 54 ++++++++++----------- 5 files changed, 38 insertions(+), 30 deletions(-) diff --git a/ShhShell/Views/About/AboutView.swift b/ShhShell/Views/About/AboutView.swift index e1ef40f..e9073fd 100644 --- a/ShhShell/Views/About/AboutView.swift +++ b/ShhShell/Views/About/AboutView.swift @@ -55,6 +55,7 @@ struct AboutView: View { } label: { Text("Show Welcome") } + .padding() NavigationLink { ShaderTestingView() diff --git a/ShhShell/Views/Hosts/ConnectionView.swift b/ShhShell/Views/Hosts/ConnectionView.swift index f5476f2..4b0b9ac 100644 --- a/ShhShell/Views/Hosts/ConnectionView.swift +++ b/ShhShell/Views/Hosts/ConnectionView.swift @@ -159,7 +159,11 @@ Hostkey fingerprint is \(handler.getHostkey() ?? "nil") } } .fullScreenCover(isPresented: $showTerminal) { - ShellTabView(handler: handler, hostsManager: hostsManager) + ShellTabView( + handler: handler, + hostsManager: hostsManager, + keyManager: keyManager + ) } } } diff --git a/ShhShell/Views/Sessions/SessionView.swift b/ShhShell/Views/Sessions/SessionView.swift index 032cced..a1685c0 100644 --- a/ShhShell/Views/Sessions/SessionView.swift +++ b/ShhShell/Views/Sessions/SessionView.swift @@ -38,6 +38,7 @@ struct SessionView: View { ShellTabView( handler: nil, hostsManager: hostsManager, + keyManager: keyManager, selectedID: key ) } diff --git a/ShhShell/Views/Terminal/ShellTabView.swift b/ShhShell/Views/Terminal/ShellTabView.swift index ae75916..8cc520e 100644 --- a/ShhShell/Views/Terminal/ShellTabView.swift +++ b/ShhShell/Views/Terminal/ShellTabView.swift @@ -11,12 +11,13 @@ import SwiftTerm struct ShellTabView: View { @State var handler: SSHHandler? @ObservedObject var hostsManager: HostsManager + @ObservedObject var keyManager: KeyManager @ObservedObject var container = TerminalViewContainer.shared @State var selectedID: UUID? var selectedHandler: SSHHandler { guard let selectedID, let contained = container.sessions[selectedID] else { - guard let handler else { fatalError("no handler in shelltabview") } + guard let handler else { return SSHHandler(host: Host.blank, keyManager: nil) } return handler } return contained.handler @@ -206,6 +207,7 @@ struct ShellTabView: View { #Preview { ShellTabView( handler: SSHHandler(host: Host.blank, keyManager: nil), - hostsManager: HostsManager() + hostsManager: HostsManager(), + keyManager: KeyManager() ) } diff --git a/ShhShell/Views/Themes/ThemeEditorView.swift b/ShhShell/Views/Themes/ThemeEditorView.swift index 6369dc2..7c525a7 100644 --- a/ShhShell/Views/Themes/ThemeEditorView.swift +++ b/ShhShell/Views/Themes/ThemeEditorView.swift @@ -20,33 +20,33 @@ struct ThemeEditorView: View { hostsManager.selectedTheme.background.suiColor.opacity(0.5) .ignoresSafeArea(.all) NavigationStack { - ZStack { - RoundedRectangle(cornerRadius: 20) - .foregroundStyle(theme.background.suiColor) - VStack { - Text(theme.name) - .foregroundStyle(theme.foreground.suiColor) - .font(.headline) - .lineLimit(1) - Spacer() - VStack(spacing: 0) { - ForEach(0...1, id: \.self) { row in - HStack(spacing: 0) { - let range = row == 0 ? 0..<8 : 8..<16 - ForEach(range, id: \.self) { col in - Rectangle() - .aspectRatio(1, contentMode: .fit) - .foregroundStyle(theme.ansi[col].suiColor) - } - } - } - } - .clipShape(RoundedRectangle(cornerRadius: 10)) - } - .padding(10) - } - .fixedSize(horizontal: false, vertical: true) - .padding(.horizontal) +// ZStack { +// RoundedRectangle(cornerRadius: 20) +// .foregroundStyle(theme.background.suiColor) +// VStack { +// Text(theme.name) +// .foregroundStyle(theme.foreground.suiColor) +// .font(.headline) +// .lineLimit(1) +// Spacer() +// VStack(spacing: 0) { +// ForEach(0...1, id: \.self) { row in +// HStack(spacing: 0) { +// let range = row == 0 ? 0..<8 : 8..<16 +// ForEach(range, id: \.self) { col in +// Rectangle() +// .aspectRatio(1, contentMode: .fit) +// .foregroundStyle(theme.ansi[col].suiColor) +// } +// } +// } +// } +// .clipShape(RoundedRectangle(cornerRadius: 10)) +// } +// .padding(10) +// } +// .fixedSize(horizontal: false, vertical: true) +// .padding(.horizontal) List { Section("Main Colors") {