commit 92bb8a747986deb88ad5f98c9ff030a7d4b63aab
parent 6ebde24ee34e1edd57e22e7665f963aff85d2a55
Author: Michael Camilleri <[email protected]>
Date: Wed, 20 May 2026 21:38:39 +0900
Remove numbers from all grid cells
Diffstat:
2 files changed, 2 insertions(+), 43 deletions(-)
diff --git a/Crossmate/Views/CellView.swift b/Crossmate/Views/CellView.swift
@@ -6,7 +6,6 @@ struct CellView: View, Equatable {
let mark: CellMark
let isSelected: Bool
let isHighlighted: Bool
- let showsNumber: Bool
/// Passive cross-reference texture for this cell, or `nil` if the cell
/// belongs to no cross-referenced clue. Each group in the puzzle is
/// assigned a distinct pattern so separate links read differently.
@@ -30,7 +29,6 @@ struct CellView: View, Equatable {
&& lhs.mark == rhs.mark
&& lhs.isSelected == rhs.isSelected
&& lhs.isHighlighted == rhs.isHighlighted
- && lhs.showsNumber == rhs.showsNumber
&& lhs.crossRefPattern == rhs.crossRefPattern
&& lhs.gridRow == rhs.gridRow
&& lhs.gridCol == rhs.gridCol
@@ -45,8 +43,8 @@ struct CellView: View, Equatable {
if !cell.isBlock {
// Passive cross-reference texture. Sits above the
// background tints (so it survives selection/author
- // colour) but below the number, letter and corner
- // markers so it never fights legibility.
+ // colour) but below the letter and corner markers so it
+ // never fights legibility.
if let crossRefPattern {
CrossRefPatternView(
pattern: crossRefPattern,
@@ -68,14 +66,6 @@ struct CellView: View, Equatable {
.allowsTightening(true)
.padding(.horizontal, 2)
.frame(maxWidth: .infinity, maxHeight: .infinity)
- if showsNumber, let number = cell.number {
- Text(String(number))
- .font(.system(size: 13, weight: .semibold, design: .rounded))
- .foregroundStyle(Color.secondary.opacity(0.75))
- .lineLimit(1)
- .padding(.top, 3)
- .padding(.leading, 4)
- }
if let triangleColor = cornerTriangleColor {
CornerTriangle()
.fill(triangleColor)
diff --git a/Crossmate/Views/GridView.swift b/Crossmate/Views/GridView.swift
@@ -6,19 +6,10 @@ struct GridView: View {
let showsSharedAnnotations: Bool
private let spacing: CGFloat = 1
- private let numberVisibilityCellSize: CGFloat = 34
- @State private var laidOutGridSize: CGSize = .zero
var body: some View {
let width = session.puzzle.width
let height = session.puzzle.height
- let cellSize = PuzzleGridMetrics.cellSize(
- in: laidOutGridSize,
- columns: width,
- rows: height,
- spacing: spacing
- )
- let showsCellNumbers = cellSize >= numberVisibilityCellSize
let tintByCell: [GridPosition: Color] = showsSharedAnnotations ? remoteTrackTints() : [:]
let authorTintByID: [String: Color] = showsSharedAnnotations
? Dictionary(
@@ -49,7 +40,6 @@ struct GridView: View {
mark: square.mark,
isSelected: session.selectedRow == r && session.selectedCol == c,
isHighlighted: currentWordCells.contains(pos),
- showsNumber: showsCellNumbers,
crossRefPattern: cellGroups[pos].map {
patternPalette[$0 % patternPalette.count]
},
@@ -69,11 +59,6 @@ struct GridView: View {
}
}
.background(Color.black)
- .onGeometryChange(for: CGSize.self) { proxy in
- proxy.size
- } action: { newSize in
- laidOutGridSize = newSize
- }
}
/// Builds remote word-tint overlays from each peer's persisted cursor
@@ -101,22 +86,6 @@ struct GridView: View {
private enum PuzzleGridMetrics {
static func cellSize(
- in size: CGSize,
- columns: Int,
- rows: Int,
- spacing: CGFloat
- ) -> CGFloat {
- guard size.width > 0, size.height > 0 else { return 0 }
- return cellSize(
- availableWidth: size.width,
- availableHeight: size.height,
- columns: columns,
- rows: rows,
- spacing: spacing
- )
- }
-
- static func cellSize(
for proposal: ProposedViewSize,
columns: Int,
rows: Int,