Skip to content

Commit c1c9f0e

Browse files
antazoeyclaude
andcommitted
fix(detail-views): replace text Back button with system chevron
User feedback: the custom "Back" text button looked fake next to the native back-chevron iOS uses elsewhere. Both the Hormone and Pill detail screens now show an SF chevron.backward (semi-bold) instead. Functionality is unchanged — we still need a custom button to intercept Back for the unsaved-changes confirmation flow. Only the label changes from text to icon. Accessibility label is kept as "Back" so VoiceOver users still hear what we mean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 5b77161 commit c1c9f0e

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

Sources/PatchDay/Hormones/Views/HormoneDetailView.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,14 @@ struct HormoneDetailView: View {
131131
.navigationBarBackButtonHidden(true)
132132
.toolbar {
133133
ToolbarItem(placement: .navigationBarLeading) {
134-
Button(ActionStrings.Back) { handleBack() }
135-
.accessibilityIdentifier("hormoneBackButton")
134+
Button {
135+
handleBack()
136+
} label: {
137+
Image(systemName: "chevron.backward")
138+
.fontWeight(.semibold)
139+
}
140+
.accessibilityIdentifier("hormoneBackButton")
141+
.accessibilityLabel(NSLocalizedString("Back", comment: ""))
136142
}
137143
ToolbarItem(placement: .navigationBarTrailing) {
138144
Button(ActionStrings.Save) { save() }

Sources/PatchDay/Pills/Views/PillDetailView.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,14 @@ struct PillDetailView: View {
119119
.navigationBarBackButtonHidden(true)
120120
.toolbar {
121121
ToolbarItem(placement: .navigationBarLeading) {
122-
Button(ActionStrings.Back) { handleBack() }
123-
.accessibilityIdentifier("pillBackButton")
122+
Button {
123+
handleBack()
124+
} label: {
125+
Image(systemName: "chevron.backward")
126+
.fontWeight(.semibold)
127+
}
128+
.accessibilityIdentifier("pillBackButton")
129+
.accessibilityLabel(NSLocalizedString("Back", comment: ""))
124130
}
125131
ToolbarItem(placement: .navigationBarTrailing) {
126132
Button(ActionStrings.Save) { save() }

0 commit comments

Comments
 (0)