From 5f0df4f564d22de73b4be1098570f3eeedd7fbc2 Mon Sep 17 00:00:00 2001 From: neon443 <69979447+neon443@users.noreply.github.com> Date: Mon, 4 Aug 2025 13:06:18 +0100 Subject: [PATCH] changed snippet picker opotions to use Buttons using a sheet thats small by default --- ShhShell/Views/Snippets/SnippetPicker.swift | 19 ++++++++++--------- ShhShell/Views/Terminal/ShellTabView.swift | 2 ++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ShhShell/Views/Snippets/SnippetPicker.swift b/ShhShell/Views/Snippets/SnippetPicker.swift index 18950c2..a81bd8e 100644 --- a/ShhShell/Views/Snippets/SnippetPicker.swift +++ b/ShhShell/Views/Snippets/SnippetPicker.swift @@ -22,18 +22,19 @@ struct SnippetPicker: View { .monospaced() } ForEach(hostsManager.snippets) { snip in - Text(snip.name) - .onTapGesture { - dismiss() - callback?(snip) - } + Button(snip.name) { + dismiss() + callback?(snip) + } } } .toolbar { - Button() { - dismiss() - } label: { - Image(systemName: "xmark") + ToolbarItem(placement: .topBarLeading) { + Button() { + dismiss() + } label: { + Image(systemName: "xmark") + } } } .listStyle(.grouped) diff --git a/ShhShell/Views/Terminal/ShellTabView.swift b/ShhShell/Views/Terminal/ShellTabView.swift index c951f06..a39ef95 100644 --- a/ShhShell/Views/Terminal/ShellTabView.swift +++ b/ShhShell/Views/Terminal/ShellTabView.swift @@ -87,6 +87,8 @@ struct ShellTabView: View { SnippetPicker(hostsManager: hostsManager) { container.sessions[selectedID ?? UUID()]?.handler.writeToChannel($0.content) } + .presentationDragIndicator(.visible) + .presentationDetents([.fraction(0.4), .large]) } } .padding(.horizontal, 10)