feat(settings): add open source links
Oldsky.xcodeproj/project.pbxproj+4−0
| @@ -9,6 +9,7 @@ | ||
/* Begin PBXBuildFile section */ | ||
0209EFCC96361379925699D8 /* ATProtoServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 25B4649EB7F4F1937943943F /* ATProtoServiceTests.swift */; }; | ||
081FA53D7337018DAAE8EC4F /* ProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 419B22CBC85D0FF85FBDEF85 /* ProfileView.swift */; }; | ||
13EDB20CB5ADEBA0FB9C3F8E /* AboutLinksTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C1872C6312C6A5CB8C31E4 /* AboutLinksTests.swift */; }; | ||
1FC93CC2B645B0DE0B5496DA /* ATProtoKit in Frameworks */ = {isa = PBXBuildFile; productRef = C38E0D11567B0A8E681E1E6E /* ATProtoKit */; }; | ||
2727E089A444ED660DCA6FBD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 14AA13D2048D7CB44D42A687 /* Assets.xcassets */; }; | ||
37345BA4571D4C3923FB6DFE /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A1ABB191814FFEF245E7285 /* Models.swift */; }; | ||
| @@ -51,6 +52,7 @@ | ||
813BB10D77A01E0CA7575D9E /* OldskyUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OldskyUITests.swift; sourceTree = "<group>"; }; | ||
8387EFC128494051D336F147 /* OldskyTests.xctest */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.cfbundle; path = OldskyTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
9A1ABB191814FFEF245E7285 /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = "<group>"; }; | ||
A3C1872C6312C6A5CB8C31E4 /* AboutLinksTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutLinksTests.swift; sourceTree = "<group>"; }; | ||
AD99E9D9710A09188269126B /* OldskyApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OldskyApp.swift; sourceTree = "<group>"; }; | ||
BC6525AA8B2A2794C5FA2472 /* ModerationPolicyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModerationPolicyTests.swift; sourceTree = "<group>"; }; | ||
C9DBEA8CDC0E2002A4CD2C1F /* Oldsky.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = Oldsky.app; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
| @@ -131,6 +133,7 @@ | ||
DD3AF76E65045408F767FD2D /* OldskyTests */ = { | ||
isa = PBXGroup; | ||
children = ( | ||
A3C1872C6312C6A5CB8C31E4 /* AboutLinksTests.swift */, | ||
FE8BC1C597B2A9CB85D931B0 /* AppModelTests.swift */, | ||
25B4649EB7F4F1937943943F /* ATProtoServiceTests.swift */, | ||
BC6525AA8B2A2794C5FA2472 /* ModerationPolicyTests.swift */, | ||
| @@ -281,6 +284,7 @@ | ||
buildActionMask = 2147483647; | ||
files = ( | ||
0209EFCC96361379925699D8 /* ATProtoServiceTests.swift in Sources */, | ||
13EDB20CB5ADEBA0FB9C3F8E /* AboutLinksTests.swift in Sources */, | ||
B7AFAF450FA4B8632008B38E /* AppModelTests.swift in Sources */, | ||
56C03F63AFA345B0649A1969 /* ModerationPolicyTests.swift in Sources */, | ||
); | ||
Sources/Oldsky/OldskyApp.swift+38−0
| @@ -799,6 +799,36 @@ struct NotificationsView: View { | ||
} | ||
} | ||
| ||
enum AboutLinks { | ||
static let repository = URL(string: "https://knotless.dev/geesawra.industries/old-fella")! | ||
static let appLicense = URL(string: "https://knotless.dev/geesawra.industries/old-fella/blob/main/LICENSE")! | ||
static let atProtoKitLicense = URL(string: "https://github.com/MasterJ93/ATProtoKit/blob/0.34.1/LICENSE.md")! | ||
static let swiftLogLicense = URL(string: "https://github.com/apple/swift-log/blob/1.16.2/LICENSE.txt")! | ||
static let swiftLogNotice = URL(string: "https://github.com/apple/swift-log/blob/1.16.2/NOTICE.txt")! | ||
} | ||
| ||
struct OpenSourceLicensesView: View { | ||
var body: some View { | ||
List { | ||
Section("Old Fella") { | ||
Link("MIT License", destination: AboutLinks.appLicense) | ||
Text("Copyright (c) 2026 Oldsky contributors") | ||
} | ||
Section("ATProtoKit") { | ||
Link("MIT License", destination: AboutLinks.atProtoKitLicense) | ||
Text("Copyright (c) 2026 Christopher Jr Riley") | ||
} | ||
Section("swift-log") { | ||
Link("Apache License 2.0", destination: AboutLinks.swiftLogLicense) | ||
Link("Notice", destination: AboutLinks.swiftLogNotice) | ||
Text("Copyright 2018, 2019 The SwiftLog Project") | ||
} | ||
} | ||
.navigationTitle("Open Source Licenses") | ||
.navigationBarTitleDisplayMode(.inline) | ||
} | ||
} | ||
| ||
struct SettingsView: View { | ||
@EnvironmentObject private var model: AppModel | ||
@State private var confirmsSignOut = false | ||
| @@ -822,6 +852,14 @@ struct SettingsView: View { | ||
Toggle("Open links in Old Fella", isOn: $openLinksInApp) | ||
.accessibilityIdentifier("openLinksInApp") | ||
} | ||
Section("About") { | ||
NavigationLink("Open Source Licenses") { | ||
OpenSourceLicensesView() | ||
} | ||
.accessibilityIdentifier("openSourceLicenses") | ||
Link("Source Repository", destination: AboutLinks.repository) | ||
.accessibilityIdentifier("sourceRepository") | ||
} | ||
if let account = model.account { | ||
Section("Account") { | ||
HStack(spacing: 12) { | ||
Tests/OldskyTests/AboutLinksTests.swiftnew+12−0
| @@ -0,0 +1,12 @@ | ||
import XCTest | ||
@testable import Oldsky | ||
| ||
final class AboutLinksTests: XCTestCase { | ||
func testAboutLinksPointToSourceAndLicenseTexts() { | ||
XCTAssertEqual(AboutLinks.repository.absoluteString, "https://knotless.dev/geesawra.industries/old-fella") | ||
XCTAssertEqual(AboutLinks.appLicense.absoluteString, "https://knotless.dev/geesawra.industries/old-fella/blob/main/LICENSE") | ||
XCTAssertEqual(AboutLinks.atProtoKitLicense.absoluteString, "https://github.com/MasterJ93/ATProtoKit/blob/0.34.1/LICENSE.md") | ||
XCTAssertEqual(AboutLinks.swiftLogLicense.absoluteString, "https://github.com/apple/swift-log/blob/1.16.2/LICENSE.txt") | ||
XCTAssertEqual(AboutLinks.swiftLogNotice.absoluteString, "https://github.com/apple/swift-log/blob/1.16.2/NOTICE.txt") | ||
} | ||
} | ||
Tests/OldskyUITests/OldskyUITests.swift+16−0
| @@ -1,6 +1,22 @@ | ||
import XCTest | ||
| ||
final class OldskyUITests: XCTestCase { | ||
func testSettingsShowsOpenSourceLicensesAndRepository() { | ||
let app = XCUIApplication() | ||
app.launchArguments = ["-ui-testing", "-ui-testing-signed-in"] | ||
app.launch() | ||
app.tabBars.buttons["Settings"].tap() | ||
let licenses = app.buttons["openSourceLicenses"] | ||
XCTAssertTrue(licenses.waitForExistence(timeout: 5)) | ||
XCTAssertTrue(app.links["sourceRepository"].exists || app.buttons["sourceRepository"].exists) | ||
licenses.tap() | ||
XCTAssertTrue(app.navigationBars["Open Source Licenses"].waitForExistence(timeout: 5)) | ||
XCTAssertTrue(app.staticTexts["Old Fella"].exists) | ||
XCTAssertTrue(app.staticTexts["ATProtoKit"].exists) | ||
XCTAssertTrue(app.staticTexts["swift-log"].exists) | ||
XCTAssertTrue(app.staticTexts["Copyright (c) 2026 Christopher Jr Riley"].exists) | ||
} | ||
| ||
func testMutedWordHidesMatchingPost() { | ||
let app = XCUIApplication() | ||
app.launchArguments = ["-ui-testing", "-ui-testing-muted-word"] | ||