Skip to content

Commit efc9056

Browse files
Ask about works trams with a link, not a box (#73)
When nothing was read, the number sheet opened with a box asking "A works tram?", which took a big part of the sheet for something rare. It's now the small link beside the status line, in the works colour, and the line about codes like S-9 shows once you tap it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 3e0131e commit efc9056

2 files changed

Lines changed: 17 additions & 46 deletions

File tree

‎Tabor/Resources/Localizable.xcstrings‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9394,22 +9394,12 @@
93949394
}
93959395
}
93969396
},
9397-
"A few of them carry a code like S-9 instead of a number.": {
9397+
"A few works trams carry a code like S-9 instead of a number.": {
93989398
"localizations": {
93999399
"pl": {
94009400
"stringUnit": {
94019401
"state": "translated",
9402-
"value": "Niektóre mają zamiast numeru oznaczenie, np. S-9."
9403-
}
9404-
}
9405-
}
9406-
},
9407-
"TYPE THE CODE": {
9408-
"localizations": {
9409-
"pl": {
9410-
"stringUnit": {
9411-
"state": "translated",
9412-
"value": "WPISZ OZNACZENIE"
9402+
"value": "Niektóre tramwaje techniczne mają zamiast numeru oznaczenie, np. S-9."
94139403
}
94149404
}
94159405
}

‎Tabor/Screens/CorrectionSheet.swift‎

Lines changed: 15 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,24 @@ struct CorrectionSheet: View {
7070
HStack(alignment: .firstTextBaseline) {
7171
Mono(status(match, number: number), size: 10.5, color: statusColor(match, number: number))
7272
Spacer(minLength: 8)
73-
// A few works cars have a code painted on instead of a number.
74-
if !offersCode || codeMode {
75-
Button(action: toggleCode) {
76-
Mono(codeMode ? String(localized: "A NUMBER") : String(localized: "A CODE, LIKE S-9?"),
77-
size: 10.5, weight: 600, color: Palette.yellow)
78-
}
79-
.buttonStyle(.plain)
73+
// A few works cars have a code painted on instead of a number. Nothing read
74+
// is all the camera gets off one, so then it asks in the works colour.
75+
Button(action: toggleCode) {
76+
Mono(codeMode ? String(localized: "A NUMBER")
77+
: offersCode ? String(localized: "A WORKS TRAM?") : String(localized: "A CODE, LIKE S-9?"),
78+
size: 10.5, weight: 600, color: offersCode && !codeMode ? Tier.works.color : Palette.yellow)
8079
}
80+
.buttonStyle(.plain)
8181
}
8282
.padding(.top, 8)
8383

84-
if offersCode, !codeMode {
85-
codeBanner.padding(.top, 16)
84+
// Said once it's asked for, not up front: a box saying it took half the sheet (#73).
85+
if codeMode {
86+
Text("A few works trams carry a code like S-9 instead of a number.")
87+
.font(TaborFont.grotesk(12.5))
88+
.foregroundStyle(Palette.sub)
89+
.fixedSize(horizontal: false, vertical: true)
90+
.padding(.top, 8)
8691
}
8792

8893
// Missed the number? What was running right there when you shot (#41).
@@ -347,33 +352,9 @@ struct CorrectionSheet: View {
347352
}
348353

349354
/// Nothing was read, which is all the camera gets off a works car with a code painted on
350-
/// instead of a number (S-9, P1): say so up front. They're all trams, so not in BUS mode.
355+
/// instead of a number (S-9, P1). They're all trams, so not in BUS mode.
351356
private var offersCode: Bool { draft.number == nil && draft.mode != .bus }
352357

353-
private var codeBanner: some View {
354-
let tint = Tier.works.color
355-
return VStack(alignment: .leading, spacing: 8) {
356-
Mono(String(localized: "A WORKS TRAM?"), size: 11, weight: 600, spacing: 0.14, color: tint)
357-
Text("A few of them carry a code like S-9 instead of a number.")
358-
.font(TaborFont.grotesk(13))
359-
.foregroundStyle(Palette.ink.opacity(0.85))
360-
.fixedSize(horizontal: false, vertical: true)
361-
Button(action: toggleCode) {
362-
Mono(String(localized: "TYPE THE CODE"), size: 11, weight: 700, spacing: 0.1, color: Palette.bg)
363-
.padding(.vertical, 8)
364-
.padding(.horizontal, 14)
365-
.background(tint, in: Capsule())
366-
}
367-
.buttonStyle(.plain)
368-
.padding(.top, 2)
369-
}
370-
.frame(maxWidth: .infinity, alignment: .leading)
371-
.padding(.vertical, 13)
372-
.padding(.horizontal, 15)
373-
.background(tint.opacity(0.08), in: RoundedRectangle(cornerRadius: 14, style: .continuous))
374-
.overlay(RoundedRectangle(cornerRadius: 14, style: .continuous).stroke(tint.opacity(0.28)))
375-
}
376-
377358
private func toggleCode() {
378359
Haptics.shared.tick()
379360
codeMode.toggle()

0 commit comments

Comments
 (0)