From 7b42dbf35dd8ff67834b90962e61bf9a1c570064 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Sun, 4 Oct 2026 20:22:51 -0400 Subject: [PATCH] fix(chat): show the external link warning as an info dialog Retitle it "You're Leaving Flipcash" and change the body to "This will open . Never share your Access Key with a website". The dialog moves from the red alert style to info, with Open Website as the primary button and Cancel as the secondary. --- .../Deep Links/ExternalLinkOpener.swift | 16 ++++++++-------- FlipcashTests/ExternalLinkCheckTests.swift | 7 ++++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Flipcash/Core/Controllers/Deep Links/ExternalLinkOpener.swift b/Flipcash/Core/Controllers/Deep Links/ExternalLinkOpener.swift index fd3f385c7..32224f53c 100644 --- a/Flipcash/Core/Controllers/Deep Links/ExternalLinkOpener.swift +++ b/Flipcash/Core/Controllers/Deep Links/ExternalLinkOpener.swift @@ -61,7 +61,7 @@ struct ExternalLinkOpener { /// Where the warning is drawn. let session: Session - /// Opens `url` now if ``ExternalLinkCheck`` allows it, otherwise once the user picks Open Link. + /// Opens `url` now if ``ExternalLinkCheck`` allows it, otherwise once the user picks Open Website. func open(_ url: URL) { switch ExternalLinkCheck(url: url) { case .open: @@ -79,15 +79,15 @@ extension DialogItem { /// The warning in front of a link to `host`, matching Android's copy word for word. /// - /// Cancel is the primary button. The body is not emphasised around the host as Android's is: - /// the dialog sets its whole subtitle in bold already. + /// Open Website is the primary button. The body is not emphasised around the host as Android's + /// is: the dialog sets its whole subtitle in bold already. static func leavingFlipcash(host: String, open: @escaping () -> Void) -> DialogItem { - .alert( - title: "You're leaving Flipcash", - subtitle: "This link opens \(host). Flipcash will never ask for your Access Key on a website" + .info( + title: "You're Leaving Flipcash", + subtitle: "This will open \(host). Never share your Access Key with a website" ) { - DialogAction.standard("Cancel") {} - DialogAction.subtle("Open Link", action: open) + DialogAction.standard("Open Website", action: open) + DialogAction.cancel() } } } diff --git a/FlipcashTests/ExternalLinkCheckTests.swift b/FlipcashTests/ExternalLinkCheckTests.swift index 1bb0a86b8..9c89b0dc6 100644 --- a/FlipcashTests/ExternalLinkCheckTests.swift +++ b/FlipcashTests/ExternalLinkCheckTests.swift @@ -76,9 +76,10 @@ import FlipcashUI @Test func warningNamesTheHost() { let item = DialogItem.leavingFlipcash(host: "x.com") {} - #expect(item.title == "You're leaving Flipcash") - #expect(item.subtitle == "This link opens x.com. Flipcash will never ask for your Access Key on a website") - #expect(item.actions.map(\.title) == ["Cancel", "Open Link"]) + #expect(item.style == .standard) + #expect(item.title == "You're Leaving Flipcash") + #expect(item.subtitle == "This will open x.com. Never share your Access Key with a website") + #expect(item.actions.map(\.title) == ["Open Website", "Cancel"]) #expect(item.actions.map(\.kind) == [.standard, .subtle]) } }