From ccec322f8eac4d14638f5abdae7dae7abc95eb7e Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Wed, 15 Jul 2026 21:42:38 -0500 Subject: refactor: share the email body diff splitter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit segmentMessageBody and its helpers were private to ThreadViewModel, reachable from tests only through a segmentMessageBodyForTesting shim. Patchset review needs the same splitting, because sr.ht's Patch type carries no diff — the diff only exists inside the email body — so this has to be shared rather than duplicated. Moved to InboxThreadUtilities. The shim is gone; the existing test calls the real function directly now. Also adds the Patchset model layer that the coming views build on. --- HutchTests/InboxViewModelTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'HutchTests') diff --git a/HutchTests/InboxViewModelTests.swift b/HutchTests/InboxViewModelTests.swift index 7bfc199..e67d317 100644 --- a/HutchTests/InboxViewModelTests.swift +++ b/HutchTests/InboxViewModelTests.swift @@ -186,7 +186,7 @@ struct InboxViewModelTests { 2.50.1 (Apple Git-155) """ - let segments = ThreadViewModel.segmentMessageBodyForTesting(body, isPatch: true) + let segments = InboxThreadUtilities.segmentMessageBody(body, isPatch: true) #expect(segments.count == 3) -- cgit v1.2.3