changed snippet picker opotions to use Buttons

using a sheet thats small by default
This commit is contained in:
neon443
2025-08-04 13:06:18 +01:00
parent 5a377eb8d9
commit 5f0df4f564
2 changed files with 12 additions and 9 deletions

View File

@@ -22,18 +22,19 @@ struct SnippetPicker: View {
.monospaced() .monospaced()
} }
ForEach(hostsManager.snippets) { snip in ForEach(hostsManager.snippets) { snip in
Text(snip.name) Button(snip.name) {
.onTapGesture { dismiss()
dismiss() callback?(snip)
callback?(snip) }
}
} }
} }
.toolbar { .toolbar {
Button() { ToolbarItem(placement: .topBarLeading) {
dismiss() Button() {
} label: { dismiss()
Image(systemName: "xmark") } label: {
Image(systemName: "xmark")
}
} }
} }
.listStyle(.grouped) .listStyle(.grouped)

View File

@@ -87,6 +87,8 @@ struct ShellTabView: View {
SnippetPicker(hostsManager: hostsManager) { SnippetPicker(hostsManager: hostsManager) {
container.sessions[selectedID ?? UUID()]?.handler.writeToChannel($0.content) container.sessions[selectedID ?? UUID()]?.handler.writeToChannel($0.content)
} }
.presentationDragIndicator(.visible)
.presentationDetents([.fraction(0.4), .large])
} }
} }
.padding(.horizontal, 10) .padding(.horizontal, 10)