summaryrefslogtreecommitdiff
path: root/Hutch/Views
diff options
context:
space:
mode:
Diffstat (limited to 'Hutch/Views')
-rw-r--r--Hutch/Views/Lookup/LookupView.swift2
-rw-r--r--Hutch/Views/Settings/SafariExtensionHelpView.swift59
-rw-r--r--Hutch/Views/Settings/SettingsView.swift17
3 files changed, 78 insertions, 0 deletions
diff --git a/Hutch/Views/Lookup/LookupView.swift b/Hutch/Views/Lookup/LookupView.swift
index f464da5..55c421b 100644
--- a/Hutch/Views/Lookup/LookupView.swift
+++ b/Hutch/Views/Lookup/LookupView.swift
@@ -443,6 +443,8 @@ struct LookupView: View {
SettingsView()
case .about:
AboutView()
+ case .userProfile(let owner):
+ UserProfileDeepLinkView(owner: owner)
case .mailingList(let mailingList):
MailingListDetailView(mailingList: mailingList)
case .thread(let thread):
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) {