diff options
| author | Christian Cleberg <[email protected]> | 2026-05-14 12:41:55 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-05-14 12:41:55 -0500 |
| commit | 0d61e05e98f6f020722ee4d43f024c1da348d2a9 (patch) | |
| tree | b388972b86cf83de380381c52c4390c3beafc69a /Hutch/Views/Settings | |
| parent | f28e5cee1643e3f99d7bf90476d1dcf9347229a0 (diff) | |
| download | hutch-0d61e05e98f6f020722ee4d43f024c1da348d2a9.tar.gz hutch-0d61e05e98f6f020722ee4d43f024c1da348d2a9.tar.bz2 hutch-0d61e05e98f6f020722ee4d43f024c1da348d2a9.zip | |
feat: add Safari extension for sourcehut deep linksv3.4.0
Diffstat (limited to 'Hutch/Views/Settings')
| -rw-r--r-- | Hutch/Views/Settings/SafariExtensionHelpView.swift | 59 | ||||
| -rw-r--r-- | Hutch/Views/Settings/SettingsView.swift | 17 |
2 files changed, 76 insertions, 0 deletions
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) + } +} diff --git a/Hutch/Views/Settings/SettingsView.swift b/Hutch/Views/Settings/SettingsView.swift index f307429..0dd4319 100644 --- a/Hutch/Views/Settings/SettingsView.swift +++ b/Hutch/Views/Settings/SettingsView.swift @@ -15,6 +15,7 @@ struct SettingsView: View { Form { appearanceSection() behaviorSection() + safariExtensionSection() authenticationSection() } .themedList() @@ -56,6 +57,22 @@ struct SettingsView: View { } @ViewBuilder + private func safariExtensionSection() -> some View { + Section { + NavigationLink { + SafariExtensionHelpView() + } label: { + Label("Safari Extension", systemImage: "safari") + } + .themedRow() + } header: { + Text("Browser") + } footer: { + Text("Open supported SourceHut pages in Hutch from Safari without claiming sr.ht links system-wide.") + } + } + + @ViewBuilder private func appearanceSection() -> some View { Section { Picker("Theme", selection: $appTheme) { |
