crossmate

A collaborative crossword app for iOS
Log | Files | Refs | LICENSE

commit 47eb3e6ef088c00613b12d278f29252566b79ba9
parent 102b18d17470a2df2abd15972f40cd4b031d8ea8
Author: Michael Camilleri <[email protected]>
Date:   Thu, 16 Jul 2026 17:48:31 +0900

Remove caption in share sheet

Diffstat:
MCrossmate/Views/Puzzle/SuccessPanel.swift | 52+++++++++++++---------------------------------------
1 file changed, 13 insertions(+), 39 deletions(-)

diff --git a/Crossmate/Views/Puzzle/SuccessPanel.swift b/Crossmate/Views/Puzzle/SuccessPanel.swift @@ -65,22 +65,6 @@ struct SuccessPanel: View { /// before the clock existed has none). private var hasClock: Bool { roster.solveTime() > 0 } - /// The caption handed to the share sheet alongside the rendered card: - /// "I solved the puzzle '<title>' in <time> with N friends using Crossmate", - /// dropping the time clause when none is recorded or the user opted it out, - /// and the friends clause when solo. - private func shareMessage(includeClock: Bool) -> String { - var parts = ["I solved the puzzle ‘\(session.puzzle.title)’"] - let seconds = roster.solveTime() - if includeClock, seconds > 0 { - parts.append("in \(TimeLog.clockString(seconds))") - } - if friendCount > 0 { - parts.append("with \(friendCount) friend\(friendCount == 1 ? "" : "s")") - } - return parts.joined(separator: " ") + " using Crossmate" - } - /// The tint for a filled square, using the lighter author-attribution wash /// pre-composited over white. The share card's Canvas paints gridlines /// first, so using a translucent fill would blend the wash with gray rather @@ -244,8 +228,7 @@ struct SuccessPanel: View { title: session.puzzle.title, initialImage: image, hasClock: hasClock, - renderImage: { makeShareImage(includeClock: $0) }, - messageFor: { shareMessage(includeClock: $0) } + renderImage: { makeShareImage(includeClock: $0) } ) } } label: { @@ -507,8 +490,8 @@ private struct PlaybackControl: View { } /// Drives `.sheet(item:)`. Carries the initial rendered card (so the sheet -/// never opens empty) plus closures to re-render the card and rebuild the -/// caption when the "Include Time" toggle changes. +/// never opens empty) plus a closure to re-render the card when the +/// "Include Time" toggle changes. private struct SharePreviewItem: Identifiable { let id = UUID() let title: String @@ -516,7 +499,6 @@ private struct SharePreviewItem: Identifiable { /// Whether a solve time exists to offer the toggle for at all. let hasClock: Bool let renderImage: @MainActor (Bool) -> Image? - let messageFor: (Bool) -> String } /// A confirmation sheet that shows the rendered card at full size with its @@ -540,21 +522,15 @@ private struct SharePreviewSheet: View { NavigationStack { VStack(spacing: 20) { ScrollView { - VStack(spacing: 16) { - image - .resizable() - .scaledToFit() - .clipShape(RoundedRectangle(cornerRadius: 16, style: .continuous)) - .overlay( - RoundedRectangle(cornerRadius: 16, style: .continuous) - .strokeBorder(.separator, lineWidth: 0.5) - ) - Text(item.messageFor(includeClock)) - .font(.callout) - .foregroundStyle(.primary) - .multilineTextAlignment(.center) - } - .padding() + image + .resizable() + .scaledToFit() + .clipShape(RoundedRectangle(cornerRadius: 16, style: .continuous)) + .overlay( + RoundedRectangle(cornerRadius: 16, style: .continuous) + .strokeBorder(.separator, lineWidth: 0.5) + ) + .padding() } Toggle("Include Time", isOn: $includeClock) @@ -564,7 +540,6 @@ private struct SharePreviewSheet: View { ShareLink( item: image, subject: Text(item.title), - message: Text(item.messageFor(includeClock)), preview: SharePreview(item.title, image: image) ) { Label("Share", systemImage: "square.and.arrow.up") @@ -604,7 +579,7 @@ private struct SuccessShareCard: View { private static let width: CGFloat = 480 var body: some View { - VStack(spacing: 20) { + VStack(spacing: 24) { HStack(spacing: 6) { Text("Solved with") Image("AboutIcon") @@ -640,7 +615,6 @@ private struct SuccessShareCard: View { cols: puzzle.width ) .frame(maxWidth: 320) - .padding(.vertical, 12) Text(completionText) .font(.system(size: 20, weight: .medium, design: .rounded))