From 074052763638a36e274e18d00f5f5ab21846be28 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Sat, 25 Jul 2026 11:35:46 -0500 Subject: feat: enrich Settings → App Info with metadata & resource links (#56) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the three-row App Info screen with a full About/Resources/Support/ Legal layout, driven by a declarative AppInfoRow model with all URLs centralized in one AppLinks namespace. - About: Version now shows "5.0.0 (build N)" (CFBundleShortVersionString + CFBundleVersion), plus Storage, Backup Schema, and Minimum iOS (17.6). - Resources: What's New (bundled ReleaseNotes.json sheet, no network), Documentation & FAQ, Source Code, Privacy Policy, and Acknowledgements ("no third-party dependencies" + MIT license). - Support: Report an Issue (a sheet that shows the locally-assembled version/OS/device diagnostics before offering Email or GitHub — nothing is collected silently) and Contact (mailto). - Support the App: Rate (SwiftUI's @Environment(\.requestReview), which handles the scene internally and respects Apple's throttling — the modern, safer equivalent of the issue's SKStoreReviewController + connectedScenes path) and Share (ShareLink to the App Store listing). - Legal: copyright footer with the current year. External rows use Link/openURL with an "opens outside the app" accessibility hint; the screen is standard adaptive Form controls with semantic colors, so it tracks Dynamic Type and light/dark automatically. New files (AppLinks, AppInfo, ReleaseNotes[.swift/.json], AppInfoView) auto- compile/bundle via the synchronized DomainDig/ group. AppInfoTests covers the mailto builder, version format, diagnostics contents, and that the bundled notes ship and parse. Unit suite green. Placeholder pending the App Store listing: AppLinks.appStoreID (the review/share URLs derive from it), flagged with a TODO. --- DomainDigTests/AppInfoTests.swift | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 DomainDigTests/AppInfoTests.swift (limited to 'DomainDigTests') diff --git a/DomainDigTests/AppInfoTests.swift b/DomainDigTests/AppInfoTests.swift new file mode 100644 index 0000000..5b574f7 --- /dev/null +++ b/DomainDigTests/AppInfoTests.swift @@ -0,0 +1,45 @@ +import XCTest +@testable import DomainDig + +/// Tests for the App Info surface's deterministic logic: the mailto builder, the +/// version display format, and that the bundled release notes ship and parse. +final class AppInfoTests: XCTestCase { + + func testMailURLEncodesSubjectAndBody() throws { + let url = try XCTUnwrap(AppInfoView.mailURL( + to: "hello@zerolabs.sh", + subject: "DomainDig Issue Report", + body: "line one\nline two" + )) + + XCTAssertEqual(url.scheme, "mailto") + let string = url.absoluteString + XCTAssertTrue(string.hasPrefix("mailto:hello@zerolabs.sh?")) + XCTAssertTrue(string.contains("subject=DomainDig%20Issue%20Report")) + XCTAssertTrue(string.contains("body=line%20one%0Aline%20two")) + } + + func testMailURLOmitsEmptyQueryItems() throws { + let url = try XCTUnwrap(AppInfoView.mailURL(to: "hello@zerolabs.sh", subject: "", body: "")) + XCTAssertEqual(url.absoluteString, "mailto:hello@zerolabs.sh") + } + + func testVersionDisplayPairsMarketingVersionAndBuild() { + XCTAssertEqual(AppInfo.versionDisplay, "\(AppInfo.marketingVersion) (build \(AppInfo.buildNumber))") + } + + func testDiagnosticsReportContainsVersionOSAndModelOnly() { + let report = AppInfo.diagnosticsReport + XCTAssertTrue(report.contains(AppInfo.marketingVersion)) + XCTAssertTrue(report.contains(AppInfo.systemVersion)) + XCTAssertTrue(report.contains(AppInfo.deviceModel)) + // Three lines, nothing more — no identifiers beyond version/OS/model. + XCTAssertEqual(report.split(separator: "\n").count, 3) + } + + func testBundledReleaseNotesShipAndParse() throws { + let notes = try XCTUnwrap(ReleaseNotes.bundled(), "ReleaseNotes.json must be bundled and decodable") + XCTAssertFalse(notes.version.isEmpty) + XCTAssertFalse(notes.highlights.isEmpty) + } +} -- cgit v1.2.3