From 0d61e05e98f6f020722ee4d43f024c1da348d2a9 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Thu, 14 May 2026 12:41:55 -0500 Subject: feat: add Safari extension for sourcehut deep links --- Hutch/Views/Settings/SafariExtensionHelpView.swift | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 Hutch/Views/Settings/SafariExtensionHelpView.swift (limited to 'Hutch/Views/Settings/SafariExtensionHelpView.swift') diff --git a/Hutch/Views/Settings/SafariExtensionHelpView.swift b/Hutch/Views/Settings/SafariExtensionHelpView.swift new file mode 100644 index 0000000..5da1a3d --- /dev/null +++ b/Hutch/Views/Settings/SafariExtensionHelpView.swift @@ -0,0 +1,59 @@ +import SwiftUI + +struct SafariExtensionHelpView: View { + private let supportedServices = [ + "git.sr.ht", + "hg.sr.ht", + "todo.sr.ht", + "builds.sr.ht", + "lists.sr.ht", + "meta.sr.ht", + "sr.ht", + ] + + var body: some View { + Form { + Section { + Text("Enable Open in Hutch from Settings > Apps > Safari > Extensions, then turn on Hutch and allow it for SourceHut websites.") + .font(.subheadline) + .foregroundStyle(.secondary) + .themedRow() + } header: { + Text("Enable") + } + + Section("Supported Services") { + ForEach(supportedServices, id: \.self) { service in + Label(service, systemImage: "checkmark.circle") + .themedRow() + } + } + + Section { + Text("The extension adds a Safari action named Open in Hutch. It converts supported SourceHut web URLs into Hutch deep links, then opens the matching screen in the app.") + .font(.subheadline) + .foregroundStyle(.secondary) + .themedRow() + + Text("This is separate from Universal Links. Hutch cannot claim sr.ht links system-wide because those domains are owned by SourceHut and would need Apple App Site Association files hosted there.") + .font(.subheadline) + .foregroundStyle(.secondary) + .themedRow() + } header: { + Text("How It Works") + } + + Section { + Text("Pages are never redirected automatically by default. The optional in-page Open in Hutch banner is off unless the extension setting is explicitly enabled.") + .font(.subheadline) + .foregroundStyle(.secondary) + .themedRow() + } header: { + Text("Privacy") + } + } + .themedList() + .navigationTitle("Safari Extension") + .navigationBarTitleDisplayMode(.inline) + } +} -- cgit v1.2.3