From 59021ecf4ea28e6f9683cb6c0c0f3ebc57ea3416 Mon Sep 17 00:00:00 2001 From: Kaede Akino Date: Sun, 18 Oct 2026 22:36:36 +0800 Subject: [PATCH] fix: separate None from available keys in identity pickers --- Frameworks/TermindPresentation/IdentityFormSections.swift | 3 +++ TFI/Features/HostEditor/MobileHostEditor.swift | 3 +++ TFM/Features/HostEditor/HostEditorView.swift | 3 +++ 3 files changed, 9 insertions(+) diff --git a/Frameworks/TermindPresentation/IdentityFormSections.swift b/Frameworks/TermindPresentation/IdentityFormSections.swift index c2d849a6..cd81b894 100644 --- a/Frameworks/TermindPresentation/IdentityFormSections.swift +++ b/Frameworks/TermindPresentation/IdentityFormSections.swift @@ -82,6 +82,9 @@ public struct IdentityFormSections: View { if showsKey { Picker(AppStrings.Vault.key.swiftUIKey, selection: $keyID) { Text(AppStrings.Common.none).tag(SSHKeyRef.ID?.none) + if !keys.isEmpty { + Divider() + } ForEach(keys) { key in Text(key.label).tag(SSHKeyRef.ID?.some(key.id)) } diff --git a/TFI/Features/HostEditor/MobileHostEditor.swift b/TFI/Features/HostEditor/MobileHostEditor.swift index d8a5c36f..84516096 100644 --- a/TFI/Features/HostEditor/MobileHostEditor.swift +++ b/TFI/Features/HostEditor/MobileHostEditor.swift @@ -134,6 +134,9 @@ struct MobileHostEditor: View { } Picker(AppStrings.Vault.key.swiftUIKey, selection: $customIdentity.sshKeyID) { Text(AppStrings.Common.none).tag(SSHKeyRef.ID?.none) + if !library.keys.isEmpty { + Divider() + } ForEach(library.keys) { key in Text(key.label).tag(SSHKeyRef.ID?.some(key.id)) } } } diff --git a/TFM/Features/HostEditor/HostEditorView.swift b/TFM/Features/HostEditor/HostEditorView.swift index 99d73b38..55b38d03 100644 --- a/TFM/Features/HostEditor/HostEditorView.swift +++ b/TFM/Features/HostEditor/HostEditorView.swift @@ -246,6 +246,9 @@ struct HostEditorView: View { .disabled(!customIdentity.sshPasswordIsEditable) Picker(AppStrings.Vault.key.swiftUIKey, selection: $customIdentity.sshKeyID) { Text(AppStrings.Common.none).tag(SSHKeyRef.ID?.none) + if !app.hostLibrary.keys.isEmpty { + Divider() + } ForEach(app.hostLibrary.keys) { key in Text(key.label).tag(SSHKeyRef.ID?.some(key.id)) }