From e84e5543be9be548784859f4b082b9d7a3122f15 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Wed, 1 Apr 2026 13:50:09 -0500 Subject: Rewrite file viewer with pinned gutter, syntax highlighting, and toolbar Replace the SwiftUI-only CodeFileTextView with a UIViewRepresentable backed by CodeFileUIView. The previous approach could not support a fixed line number gutter while independently scrolling code content horizontally. Changes: - Gutter is pinned outside the horizontal scroll view and never scrolls left - Vertical scroll is handled by a single outer UIScrollView shared by both the gutter and code content, keeping them in sync - Line numbers are right-aligned in a fixed-width gutter calculated from the total line count - Syntax highlighting via Splash for .swift files, with plain monospaced rendering as fallback for unsupported file types - Wrap toggle persisted via AppStorage (wrapRepositoryFileLines) - Bottom toolbar replaces the floating Share button, adding Copy All and Wrap toggle actions - Copy All shows a brief checkmark confirmation that resets after 2 seconds - Font fixed at SFMono-Regular 12pt, not scaled with Dynamic Type Implements: https://todo.sr.ht/~ccleberg/Hutch/7 --- Hutch.xcodeproj/project.pbxproj | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Hutch.xcodeproj/project.pbxproj') diff --git a/Hutch.xcodeproj/project.pbxproj b/Hutch.xcodeproj/project.pbxproj index cb7bea9..d844cd3 100644 --- a/Hutch.xcodeproj/project.pbxproj +++ b/Hutch.xcodeproj/project.pbxproj @@ -16,6 +16,7 @@ 8BE09E812F7B2CC300F88693 /* styles.css in Resources */ = {isa = PBXBuildFile; fileRef = 8BE09E7D2F7B2CC300F88693 /* styles.css */; }; 8BE09E822F7B2CC300F88693 /* privacy.html in Resources */ = {isa = PBXBuildFile; fileRef = 8BE09E7B2F7B2CC300F88693 /* privacy.html */; }; 8BF100032F9A000100000001 /* Markdown in Frameworks */ = {isa = PBXBuildFile; productRef = 8BF100022F9A000100000001 /* Markdown */; }; + 8BF100052F9A000100000002 /* Splash in Frameworks */ = {isa = PBXBuildFile; productRef = 8BF100042F9A000100000002 /* Splash */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -116,6 +117,7 @@ buildActionMask = 2147483647; files = ( 8BF100032F9A000100000001 /* Markdown in Frameworks */, + 8BF100052F9A000100000002 /* Splash in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -198,6 +200,7 @@ name = Hutch; packageProductDependencies = ( 8BF100022F9A000100000001 /* Markdown */, + 8BF100042F9A000100000002 /* Splash */, ); productName = Hutch; productReference = 8B4B28D12F6704280045FA19 /* Hutch.app */; @@ -279,6 +282,7 @@ minimizedProjectReferenceProxies = 1; packageReferences = ( 8BF100012F9A000100000001 /* XCRemoteSwiftPackageReference "swift-markdown" */, + 8BF100062F9A000100000002 /* XCRemoteSwiftPackageReference "Splash" */, ); preferredProjectObjectVersion = 77; productRefGroup = 8B4B28D22F6704280045FA19 /* Products */; @@ -710,6 +714,14 @@ minimumVersion = 0.7.3; }; }; + 8BF100062F9A000100000002 /* XCRemoteSwiftPackageReference "Splash" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/JohnSundell/Splash"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 0.16.0; + }; + }; /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ @@ -718,6 +730,11 @@ package = 8BF100012F9A000100000001 /* XCRemoteSwiftPackageReference "swift-markdown" */; productName = Markdown; }; + 8BF100042F9A000100000002 /* Splash */ = { + isa = XCSwiftPackageProductDependency; + package = 8BF100062F9A000100000002 /* XCRemoteSwiftPackageReference "Splash" */; + productName = Splash; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 8B4B28C92F6704280045FA19 /* Project object */; -- cgit v1.2.3