Complete accessibility identifier coverage across all 152 project files

Exhaustive file-by-file audit of every Swift file in the project (iOS app,
Watch app, Widget extension). Every interactive UI element — buttons, toggles,
pickers, links, menus, tap gestures, text editors, color pickers, photo
pickers — now has an accessibilityIdentifier for XCUITest automation.

46 files changed across Shared/, Onboarding/, Watch App/, and Widget targets.
Added ~100 new ID definitions covering settings debug controls, export/photo
views, sharing templates, customization subviews, onboarding flows, tip
modals, widget voting buttons, and watch mood buttons.
This commit is contained in:
Trey T
2026-03-26 08:34:56 -05:00
parent e7648ddd8a
commit ed8205cd88
46 changed files with 391 additions and 13 deletions

View File

@@ -696,7 +696,7 @@ struct NeonEqualizerBar: View {
}
.buttonStyle(NeonBarButtonStyle(isPressed: $isPressed))
.frame(maxWidth: .infinity)
.accessibilityIdentifier(AccessibilityID.MoodButton.id(for: mood.widgetDisplayName))
.accessibilityIdentifier(AccessibilityID.NeonMoodButton.id(for: mood.widgetDisplayName))
.accessibilityLabel(mood.strValue)
.accessibilityHint(String(localized: "Select this mood"))
}

View File

@@ -109,7 +109,8 @@ struct CreateWidgetView: View {
.frame(minWidth: 0, maxWidth: .infinity)
.frame(minHeight: 40, maxHeight: .infinity)
.background(.blue)
.accessibilityIdentifier(AccessibilityID.CustomWidget.shuffleButton)
Button(action: {
AnalyticsManager.shared.track(.widgetCreated)
UserDefaultsStore.saveCustomWidget(widgetModel: customWidget, inUse: false)
@@ -127,7 +128,8 @@ struct CreateWidgetView: View {
.frame(minWidth: 0, maxWidth: .infinity)
.frame(minHeight: 40, maxHeight: .infinity)
.background(.green)
.accessibilityIdentifier(AccessibilityID.CustomWidget.saveButton)
Button(action: {
AnalyticsManager.shared.track(.widgetUsed)
UserDefaultsStore.saveCustomWidget(widgetModel: customWidget, inUse: true)
@@ -145,7 +147,8 @@ struct CreateWidgetView: View {
.frame(minWidth: 0, maxWidth: .infinity)
.frame(minHeight: 40, maxHeight: .infinity)
.background(.pink)
.accessibilityIdentifier(AccessibilityID.CustomWidget.useButton)
if customWidget.isSaved {
Button(action: {
AnalyticsManager.shared.track(.widgetDeleted)
@@ -163,6 +166,7 @@ struct CreateWidgetView: View {
.frame(minWidth: 0, maxWidth: .infinity)
.frame(minHeight: 40, maxHeight: .infinity)
.background(.orange)
.accessibilityIdentifier(AccessibilityID.CustomWidget.deleteButton)
}
}
.frame(minHeight: 40, maxHeight: .infinity)
@@ -178,6 +182,7 @@ struct CreateWidgetView: View {
AnalyticsManager.shared.track(.widgetColorUpdated(part: "background"))
}
.labelsHidden()
.accessibilityIdentifier(AccessibilityID.CustomWidget.colorPicker("bg"))
}
.frame(minWidth: 0, maxWidth: .infinity)
@@ -188,6 +193,7 @@ struct CreateWidgetView: View {
AnalyticsManager.shared.track(.widgetColorUpdated(part: "inner"))
}
.labelsHidden()
.accessibilityIdentifier(AccessibilityID.CustomWidget.colorPicker("inner"))
}
.frame(minWidth: 0, maxWidth: .infinity)
@@ -198,6 +204,7 @@ struct CreateWidgetView: View {
AnalyticsManager.shared.track(.widgetColorUpdated(part: "outline"))
}
.labelsHidden()
.accessibilityIdentifier(AccessibilityID.CustomWidget.colorPicker("stroke"))
}
.frame(minWidth: 0, maxWidth: .infinity)
}
@@ -210,6 +217,7 @@ struct CreateWidgetView: View {
AnalyticsManager.shared.track(.widgetColorUpdated(part: "left_eye"))
}
.labelsHidden()
.accessibilityIdentifier(AccessibilityID.CustomWidget.colorPicker("leftEye"))
}
.frame(minWidth: 0, maxWidth: .infinity)
@@ -220,6 +228,7 @@ struct CreateWidgetView: View {
AnalyticsManager.shared.track(.widgetColorUpdated(part: "right_eye"))
}
.labelsHidden()
.accessibilityIdentifier(AccessibilityID.CustomWidget.colorPicker("rightEye"))
}
.frame(minWidth: 0, maxWidth: .infinity)
@@ -230,6 +239,7 @@ struct CreateWidgetView: View {
AnalyticsManager.shared.track(.widgetColorUpdated(part: "mouth"))
}
.labelsHidden()
.accessibilityIdentifier(AccessibilityID.CustomWidget.colorPicker("mouth"))
}
.frame(minWidth: 0, maxWidth: .infinity)
}
@@ -250,16 +260,19 @@ struct CreateWidgetView: View {
.frame(minWidth: 10, idealWidth: 40, maxWidth: 40,
minHeight: 10, idealHeight: 40, maxHeight: 40,
alignment: .center)
.accessibilityIdentifier(AccessibilityID.CustomWidget.backgroundOption(CustomWidgetBackGroundOptions.selectable.firstIndex(of: bg) ?? 0))
.onTapGesture {
update(background: bg)
}
}
mixBG
.accessibilityIdentifier(AccessibilityID.CustomWidget.randomBackgroundButton)
.onTapGesture {
update(background: .random)
}
Divider()
ColorPicker("", selection: $customWidget.bgOverlayColor)
.accessibilityIdentifier(AccessibilityID.CustomWidget.colorPicker("bgOverlay"))
}
.padding()
.background(
@@ -270,6 +283,7 @@ struct CreateWidgetView: View {
var faceImageOptions: some View {
HStack(alignment: .center) {
Text(String(localized: "create_widget_view_left_eye"))
.accessibilityIdentifier(AccessibilityID.CustomWidget.leftEyeButton)
.onTapGesture(perform: {
showLeftEyeImagePicker.toggle()
})
@@ -278,6 +292,7 @@ struct CreateWidgetView: View {
.frame(minWidth: 0, maxWidth: .infinity)
Divider()
Text(String(localized: "create_widget_view_right_eye"))
.accessibilityIdentifier(AccessibilityID.CustomWidget.rightEyeButton)
.onTapGesture(perform: {
showRightEyeImagePicker.toggle()
})
@@ -285,6 +300,7 @@ struct CreateWidgetView: View {
.frame(minWidth: 0, maxWidth: .infinity)
Divider()
Text(String(localized: "create_widget_view_mouth"))
.accessibilityIdentifier(AccessibilityID.CustomWidget.mouthButton)
.onTapGesture(perform: {
showMuthImagePicker.toggle()
})

View File

@@ -538,6 +538,7 @@ struct CelebrationAnimationPickerCompact: View {
)
}
.buttonStyle(.plain)
.accessibilityIdentifier(AccessibilityID.Customize.celebrationAnimationButton(animation.rawValue))
}
}
.padding(.horizontal, 4)
@@ -666,6 +667,7 @@ struct CustomWidgetSection: View {
CustomWidgetView(customWidgetModel: widget)
.frame(width: 60, height: 60)
.cornerRadius(12)
.accessibilityIdentifier(AccessibilityID.Customize.customWidget(UserDefaultsStore.getCustomWidgets().firstIndex(where: { $0.uuid == widget.uuid }) ?? 0))
.onTapGesture {
AnalyticsManager.shared.track(.widgetViewed)
selectedWidget.selectedItem = widget.copy() as? CustomWidgetModel
@@ -689,6 +691,7 @@ struct CustomWidgetSection: View {
.foregroundColor(.secondary)
}
}
.accessibilityIdentifier(AccessibilityID.Customize.customWidgetAdd)
}
}
@@ -701,6 +704,7 @@ struct CustomWidgetSection: View {
}
.foregroundColor(.accentColor)
}
.accessibilityIdentifier(AccessibilityID.Customize.widgetHowToLink)
}
.sheet(isPresented: $selectedWidget.showSheet) {
if let selectedItem = selectedWidget.selectedItem {
@@ -822,6 +826,7 @@ struct SubscriptionBannerView: View {
.padding(.horizontal, 16)
.padding(.vertical, 8)
.background(Capsule().fill(Color.green.opacity(0.15)))
.accessibilityIdentifier(AccessibilityID.Customize.manageSubscriptionButton)
}
.padding(16)
}
@@ -866,6 +871,7 @@ struct SubscriptionBannerView: View {
)
}
.buttonStyle(.plain)
.accessibilityIdentifier(AccessibilityID.Customize.unlockPremiumButton)
}
private func openSubscriptionManagement() async {

View File

@@ -23,6 +23,7 @@ struct CustomWigetView: View {
CustomWidgetView(customWidgetModel: widget)
.frame(width: 50, height: 50)
.cornerRadius(10)
.accessibilityIdentifier(AccessibilityID.Customize.customWidget(UserDefaultsStore.getCustomWidgets().firstIndex(where: { $0.uuid == widget.uuid }) ?? 0))
.onTapGesture {
AnalyticsManager.shared.track(.widgetViewed)
selectedWidget.selectedItem = widget.copy() as? CustomWidgetModel
@@ -34,6 +35,7 @@ struct CustomWigetView: View {
.overlay(
Image(systemName: "plus")
)
.accessibilityIdentifier(AccessibilityID.Customize.customWidgetAdd)
.onTapGesture {
AnalyticsManager.shared.track(.widgetCreateTapped)
selectedWidget.selectedItem = CustomWidgetModel.randomWidget
@@ -47,6 +49,7 @@ struct CustomWigetView: View {
.cornerRadius(10)
Text("[\(String(localized: "how_to_add_widget"))](https://support.apple.com/guide/iphone/add-widgets-iphb8f1bf206/ios)")
.accessibilityIdentifier(AccessibilityID.Customize.widgetHowToLink)
.accentColor(textColor)
.padding(.bottom)
}

View File

@@ -45,6 +45,7 @@ struct DayFilterPickerView: View {
.cornerRadius(8)
}
.buttonStyle(.plain)
.accessibilityIdentifier(AccessibilityID.Customize.dayFilterButton(day))
}
}
Text(String(localized: "day_picker_view_text"))

View File

@@ -64,6 +64,7 @@ struct IconPickerView: View {
})
.accessibilityLabel(String(localized: "Default app icon"))
.accessibilityHint(String(localized: "Double tap to select"))
.accessibilityIdentifier(AccessibilityID.Customize.iconButton("default"))
ForEach(iconSets, id: \.self.0){ iconSet in
@@ -80,6 +81,7 @@ struct IconPickerView: View {
})
.accessibilityLabel(String(localized: "App icon style \(iconSet.1.replacingOccurrences(of: "AppIcon", with: "").replacingOccurrences(of: "Image", with: ""))"))
.accessibilityHint(String(localized: "Double tap to select"))
.accessibilityIdentifier(AccessibilityID.Customize.iconButton(iconSet.1))
}
}
.padding()

View File

@@ -41,6 +41,7 @@ struct ImagePackPickerView: View {
.fill(imagePack == images ? theme.currentTheme.bgColor : .clear)
.padding([.top, .bottom], -3)
)
.accessibilityIdentifier(AccessibilityID.Customize.imagePackOption(String(describing: images)))
.onTapGesture {
let impactMed = UIImpactFeedbackGenerator(style: .heavy)
impactMed.impactOccurred()

View File

@@ -38,6 +38,7 @@ struct PersonalityPackPickerView: View {
.fill(personalityPack == aPack ? theme.currentTheme.bgColor : .clear)
.padding(5)
)
.accessibilityIdentifier(AccessibilityID.Customize.personalityPackOption(aPack.title()))
.onTapGesture {
let impactMed = UIImpactFeedbackGenerator(style: .heavy)
impactMed.impactOccurred()

View File

@@ -31,6 +31,7 @@ struct ShapePickerView: View {
.resizable()
.frame(width: 20, height: 20, alignment: .trailing)
.foregroundColor(Color(UIColor.systemGray))
.accessibilityIdentifier(AccessibilityID.Customize.shapeRefresh)
.onTapGesture {
shapeRefreshToggleThing.toggle()
}
@@ -43,6 +44,7 @@ struct ShapePickerView: View {
bgColor: moodTint.color(forMood: Mood.allValues.randomElement()!), textColor: textColor)
.frame(height: 50)
.frame(minWidth: 0, maxWidth: .infinity)
.accessibilityIdentifier(AccessibilityID.Customize.shapeOption(String(describing: ashape)))
.onTapGesture {
let impactMed = UIImpactFeedbackGenerator(style: .heavy)
impactMed.impactOccurred()

View File

@@ -58,6 +58,7 @@ struct ThemePickerView: View {
.fill(selectedTheme == theme ? selectedTheme.currentTheme.bgColor : .clear)
.padding(-5)
)
.accessibilityIdentifier(AccessibilityID.Customize.themeButton(theme.title))
}
private func selectTheme(_ theme: Theme) {

View File

@@ -59,6 +59,7 @@ struct VotingLayoutPickerView: View {
)
}
.buttonStyle(.plain)
.accessibilityIdentifier(AccessibilityID.Customize.votingLayoutButton(layout.displayName))
}
}
.padding(.horizontal)

View File

@@ -104,6 +104,7 @@ struct ExportView: View {
Button("Cancel") {
dismiss()
}
.accessibilityIdentifier(AccessibilityID.Export.cancelButton)
}
}
.sheet(isPresented: $showShareSheet) {
@@ -113,6 +114,7 @@ struct ExportView: View {
}
.alert("Export Failed", isPresented: $showError) {
Button("OK", role: .cancel) { }
.accessibilityIdentifier(AccessibilityID.Export.alertOKButton)
} message: {
Text(errorMessage)
}
@@ -230,6 +232,7 @@ struct ExportView: View {
)
}
.buttonStyle(.plain)
.accessibilityIdentifier(AccessibilityID.Export.formatButton(format.rawValue))
}
}
}
@@ -260,6 +263,7 @@ struct ExportView: View {
.background(Color(.systemBackground))
}
.buttonStyle(.plain)
.accessibilityIdentifier(AccessibilityID.Export.rangeButton(range.rawValue))
if range != DateRange.allCases.last {
Divider()
@@ -293,6 +297,7 @@ struct ExportView: View {
.clipShape(RoundedRectangle(cornerRadius: 14))
}
.disabled(isExporting || validEntries.isEmpty)
.accessibilityIdentifier(AccessibilityID.Export.exportButton)
.padding(.top, 8)
}

View File

@@ -29,6 +29,7 @@ struct ImagePickerGridView: View {
.scaledToFit()
.frame(width: 40, height: 40)
.foregroundColor(textColor)
.accessibilityIdentifier(AccessibilityID.CustomWidget.imageOption(item.rawValue))
.onTapGesture {
pickedImageClosure(item)
presentationMode.wrappedValue.dismiss()

View File

@@ -277,6 +277,7 @@ struct InsightsSectionView: View {
.padding(.vertical, 14)
}
.buttonStyle(.plain)
.accessibilityIdentifier(AccessibilityID.Insights.expandCollapseButton)
.accessibilityAddTraits(.isHeader)
// Insights List (collapsible)

View File

@@ -146,6 +146,7 @@ struct ReportDateRangePicker: View {
.background(Color.accentColor.opacity(0.15))
.clipShape(Circle())
}
.accessibilityIdentifier(AccessibilityID.Reports.previousMonthButton)
.accessibilityLabel("Previous month")
Spacer()
@@ -172,6 +173,7 @@ struct ReportDateRangePicker: View {
.background(Color.accentColor.opacity(0.15))
.clipShape(Circle())
}
.accessibilityIdentifier(AccessibilityID.Reports.nextMonthButton)
.accessibilityLabel("Next month")
.disabled(isDisplayingCurrentMonth)
}
@@ -341,6 +343,7 @@ private struct ReportDayCell: View {
}
.buttonStyle(.plain)
.disabled(isFuture)
.accessibilityIdentifier(AccessibilityID.Reports.dayCell(dateString: dayNumber))
.frame(height: 40)
}
}

View File

@@ -95,7 +95,9 @@ struct ReportsView: View {
viewModel.exportDataPDF()
}
}
.accessibilityIdentifier(AccessibilityID.Reports.privacyShareButton)
Button(String(localized: "Cancel"), role: .cancel) {}
.accessibilityIdentifier(AccessibilityID.Reports.privacyCancelButton)
} message: {
Text("This report contains your personal mood data and journal notes. Only share it with people you trust.")
}

View File

@@ -1691,6 +1691,7 @@ struct LockScreenView: View {
.disabled(authManager.isAuthenticating)
.padding(.top, 16)
.opacity(showContent ? 1 : 0)
.accessibilityIdentifier(AccessibilityID.LockScreen.passcodeUnlockButton)
.accessibilityLabel("Use device passcode")
.accessibilityHint("Double tap to authenticate with your device passcode")
}

View File

@@ -117,6 +117,7 @@ struct MonthDetailView: View {
selectedEntry = nil
showUpdateEntryAlert = false
})
.accessibilityIdentifier(AccessibilityID.MonthDetail.cancelButton)
}
}
@@ -153,6 +154,7 @@ struct MonthDetailView: View {
LazyVGrid(columns: columns, spacing: 25) {
ForEach(entries, id: \.self) { entry in
listViewEntry(forEntry: entry)
.accessibilityIdentifier(AccessibilityID.MonthDetail.entryCell(DateFormattingCache.shared.string(for: entry.forDate, format: .dateMedium)))
.onTapGesture(perform: {
if entry.canEdit {
selectedEntry = entry

View File

@@ -378,6 +378,7 @@ struct MonthView: View {
.preferredColorScheme(theme.preferredColorScheme)
#if DEBUG
// Triple-tap to toggle demo mode for video recording
.accessibilityIdentifier(AccessibilityID.MonthView.debugDemoToggle)
.onTapGesture(count: 3) {
if demoManager.isDemoMode {
demoManager.stopDemoMode()
@@ -591,6 +592,7 @@ struct MonthCard: View, Equatable {
}
}
.buttonStyle(.plain)
.accessibilityIdentifier(AccessibilityID.MonthView.statsToggleButton)
.accessibilityLabel("\(Random.monthName(fromMonthInt: month)) \(String(year)), \(showStats ? "expanded" : "collapsed")")
.accessibilityHint("Double tap to toggle statistics")
@@ -661,6 +663,7 @@ struct MonthCard: View, Equatable {
.fill(theme.currentTheme.secondaryBGColor)
)
.contentShape(Rectangle())
.accessibilityIdentifier(AccessibilityID.MonthView.dayCell(dateString: "\(month)_\(year)"))
.onTapGesture {
onTap()
}
@@ -867,6 +870,7 @@ extension MonthView {
}
.padding(.top, 60)
.padding(.trailing)
.accessibilityIdentifier(AccessibilityID.MonthView.settingsButton)
Spacer()
}
}

View File

@@ -76,6 +76,7 @@ struct PhotoPickerView: View {
)
}
.disabled(isProcessing)
.accessibilityIdentifier(AccessibilityID.PhotoPicker.photosPicker)
// Camera
Button {
@@ -111,6 +112,7 @@ struct PhotoPickerView: View {
)
}
.disabled(isProcessing)
.accessibilityIdentifier(AccessibilityID.PhotoPicker.cameraButton)
}
.padding(.horizontal)
@@ -130,6 +132,7 @@ struct PhotoPickerView: View {
Button("Cancel") {
dismiss()
}
.accessibilityIdentifier(AccessibilityID.PhotoPicker.cancelButton)
}
}
.onChange(of: selectedItem) { _, newItem in
@@ -278,6 +281,7 @@ struct PhotoGalleryView: View {
}
}
}
.accessibilityIdentifier(AccessibilityID.PhotoPicker.photoImage)
} else {
VStack(spacing: 16) {
Image(systemName: "photo.badge.exclamationmark")
@@ -301,6 +305,7 @@ struct PhotoGalleryView: View {
.font(.title2)
.foregroundStyle(.white.opacity(0.7))
}
.accessibilityIdentifier(AccessibilityID.PhotoPicker.closeButton)
}
ToolbarItem(placement: .primaryAction) {
@@ -310,17 +315,20 @@ struct PhotoGalleryView: View {
} label: {
Label("Share", systemImage: "square.and.arrow.up")
}
.accessibilityIdentifier(AccessibilityID.PhotoPicker.shareButton)
Button(role: .destructive) {
showDeleteConfirmation = true
} label: {
Label("Delete", systemImage: "trash")
}
.accessibilityIdentifier(AccessibilityID.PhotoPicker.deleteButton)
} label: {
Image(systemName: "ellipsis.circle.fill")
.font(.title2)
.foregroundStyle(.white.opacity(0.7))
}
.accessibilityIdentifier(AccessibilityID.PhotoPicker.menuButton)
}
}
.confirmationDialog("Delete Photo", isPresented: $showDeleteConfirmation, titleVisibility: .visible) {
@@ -328,7 +336,9 @@ struct PhotoGalleryView: View {
onDelete()
dismiss()
}
.accessibilityIdentifier(AccessibilityID.PhotoPicker.deleteConfirmButton)
Button("Cancel", role: .cancel) { }
.accessibilityIdentifier(AccessibilityID.PhotoPicker.deleteCancelButton)
} message: {
Text("Are you sure you want to delete this photo?")
}

View File

@@ -175,6 +175,7 @@ struct PurchaseButtonView: View {
.background(Color.pink)
.cornerRadius(10)
}
.accessibilityIdentifier(AccessibilityID.Purchase.subscribeButton)
// Restore purchases
Button {

View File

@@ -46,6 +46,7 @@ struct ReflectSubscriptionStoreView: View {
}
.padding(16)
.accessibilityLabel("Close")
.accessibilityIdentifier(AccessibilityID.SubscriptionStore.closeButton)
}
.onAppear {
AppLogger.iap.info("SubscriptionStoreView appeared — source: \(source), productIDs: \(IAPManager.productIdentifiers.sorted().joined(separator: ", ")), groupID: \(IAPManager.subscriptionGroupID)")

View File

@@ -22,6 +22,7 @@ struct SampleEntryView: View {
.resizable()
.frame(width: 20, height: 20, alignment: .trailing)
.foregroundColor(Color(UIColor.systemGray))
.accessibilityIdentifier(AccessibilityID.SampleEntry.refreshButton)
.onTapGesture {
sampleListEntry = DataController.shared.generateObjectNotInArray(forDate: Date(), withMood: sampleListEntry.mood.next)
}

View File

@@ -54,6 +54,7 @@ struct DebugAnimationSettingsView: View {
Button("Done") {
dismiss()
}
.accessibilityIdentifier(AccessibilityID.Debug.animationDoneButton)
}
}
}
@@ -217,6 +218,7 @@ struct AnimationCard: View {
)
.scaleEffect(isPressed ? 0.95 : (isSelected ? 1.02 : 1.0))
}
.accessibilityIdentifier(AccessibilityID.Debug.animationCard(type.rawValue))
.buttonStyle(PlainButtonStyle())
.onLongPressGesture(minimumDuration: .infinity, pressing: { pressing in
withAnimation(.easeInOut(duration: 0.15)) {
@@ -336,6 +338,7 @@ struct DebugVotingContentView: View {
.fill(mood.color.opacity(0.15))
)
}
.accessibilityIdentifier(AccessibilityID.Debug.debugMoodButton(mood.strValue))
}
}

View File

@@ -58,6 +58,7 @@ struct LiveActivityPreviewView: View {
.background(Color.gray.opacity(0.2))
.cornerRadius(12)
}
.accessibilityIdentifier(AccessibilityID.Debug.liveActivityResetButton)
Button(action: toggleAnimation) {
Label(isAnimating ? "Pause" : "Start", systemImage: isAnimating ? "pause.fill" : "play.fill")
@@ -68,6 +69,7 @@ struct LiveActivityPreviewView: View {
.foregroundColor(.white)
.cornerRadius(12)
}
.accessibilityIdentifier(AccessibilityID.Debug.liveActivityToggleButton)
}
Button(action: { showRecordingMode = true }) {
@@ -79,6 +81,7 @@ struct LiveActivityPreviewView: View {
.foregroundColor(.white)
.cornerRadius(12)
}
.accessibilityIdentifier(AccessibilityID.Debug.liveActivityRecordButton)
}
.padding(.horizontal, 20)
.padding(.bottom, 40)
@@ -264,6 +267,7 @@ struct LiveActivityRecordingView: View {
.background(Color.orange)
.foregroundColor(.white)
.cornerRadius(12)
.accessibilityIdentifier(AccessibilityID.Debug.liveActivityDismissButton)
} else if isExporting {
Text("Exporting frames...")
.font(.title2.bold())
@@ -282,6 +286,7 @@ struct LiveActivityRecordingView: View {
}
}
}
.accessibilityIdentifier(AccessibilityID.Debug.liveActivityExportButton)
.onTapGesture {
if !isExporting && !exportComplete {
startExport()

View File

@@ -35,6 +35,7 @@ struct PaywallPreviewSettingsView: View {
Button("Done") {
dismiss()
}
.accessibilityIdentifier(AccessibilityID.Debug.paywallPreviewDoneButton)
}
}
.sheet(isPresented: $showFullPreview) {
@@ -160,6 +161,7 @@ struct PaywallPreviewSettingsView: View {
.foregroundColor(.white)
.clipShape(RoundedRectangle(cornerRadius: 14))
}
.accessibilityIdentifier(AccessibilityID.Debug.viewFullPaywallButton)
}
private var gradientColors: [Color] {
@@ -241,6 +243,7 @@ struct StyleOptionRow: View {
.stroke(isSelected ? Color.accentColor : Color.clear, lineWidth: 2)
)
}
.accessibilityIdentifier(AccessibilityID.Debug.paywallStyleOption(style.displayName))
.buttonStyle(.plain)
}

View File

@@ -255,6 +255,7 @@ struct WhyUpgradeView: View {
Button("Done") {
dismiss()
}
.accessibilityIdentifier(AccessibilityID.Settings.doneButton)
}
}
}

View File

@@ -149,6 +149,7 @@ struct SettingsContentView: View {
}
.padding()
})
.accessibilityIdentifier(AccessibilityID.Settings.reminderTimeButton)
.accessibilityLabel(String(localized: "Reminder Time"))
.accessibilityValue(formattedReminderTime)
.accessibilityHint(String(localized: "Opens time picker to change reminder time"))
@@ -269,6 +270,7 @@ struct SettingsContentView: View {
showTrialDatePicker = true
}
.font(.subheadline.weight(.medium))
.accessibilityIdentifier(AccessibilityID.Settings.changeTrialDateButton)
}
.padding()
}
@@ -283,6 +285,7 @@ struct SettingsContentView: View {
displayedComponents: .date
)
.datePickerStyle(.graphical)
.accessibilityIdentifier(AccessibilityID.Settings.trialDatePicker)
.padding()
.navigationTitle("Set Trial Start Date")
.navigationBarTitleDisplayMode(.inline)
@@ -295,6 +298,7 @@ struct SettingsContentView: View {
await iapManager.checkSubscriptionStatus()
}
}
.accessibilityIdentifier(AccessibilityID.Settings.trialDatePickerDoneButton)
}
}
}
@@ -338,6 +342,7 @@ struct SettingsContentView: View {
}
.padding()
}
.accessibilityIdentifier(AccessibilityID.Settings.paywallPreviewButton)
.background(theme.currentTheme.secondaryBGColor)
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
@@ -381,6 +386,7 @@ struct SettingsContentView: View {
}
.padding()
}
.accessibilityIdentifier(AccessibilityID.Settings.tipsPreviewButton)
.background(theme.currentTheme.secondaryBGColor)
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
@@ -418,6 +424,7 @@ struct SettingsContentView: View {
}
.padding()
}
.accessibilityIdentifier(AccessibilityID.Settings.testNotificationsButton)
.background(theme.currentTheme.secondaryBGColor)
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
@@ -470,6 +477,7 @@ struct SettingsContentView: View {
.padding()
}
.disabled(isExportingWidgets)
.accessibilityIdentifier(AccessibilityID.Settings.exportWidgetsButton)
.background(theme.currentTheme.secondaryBGColor)
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
@@ -522,6 +530,7 @@ struct SettingsContentView: View {
.padding()
}
.disabled(isExportingVotingLayouts)
.accessibilityIdentifier(AccessibilityID.Settings.exportVotingLayoutsButton)
.background(theme.currentTheme.secondaryBGColor)
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
@@ -574,6 +583,7 @@ struct SettingsContentView: View {
.padding()
}
.disabled(isExportingWatchViews)
.accessibilityIdentifier(AccessibilityID.Settings.exportWatchViewsButton)
.background(theme.currentTheme.secondaryBGColor)
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
@@ -632,6 +642,7 @@ struct SettingsContentView: View {
.padding()
}
.disabled(isExportingInsights)
.accessibilityIdentifier(AccessibilityID.Settings.exportInsightsButton)
.background(theme.currentTheme.secondaryBGColor)
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
@@ -691,6 +702,7 @@ struct SettingsContentView: View {
.padding()
}
.disabled(isGeneratingScreenshots)
.accessibilityIdentifier(AccessibilityID.Settings.generateScreenshotsButton)
.background(theme.currentTheme.secondaryBGColor)
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
@@ -741,6 +753,7 @@ struct SettingsContentView: View {
.padding()
}
.disabled(isDeletingHealthKitData)
.accessibilityIdentifier(AccessibilityID.Settings.deleteHealthKitButton)
.background(theme.currentTheme.secondaryBGColor)
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
@@ -852,11 +865,12 @@ struct SettingsContentView: View {
}
.padding()
}
.accessibilityIdentifier(AccessibilityID.Settings.addTestDataButton)
.background(theme.currentTheme.secondaryBGColor)
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
}
private var healthKitToggle: some View {
VStack(spacing: 0) {
HStack(spacing: 12) {
@@ -1048,7 +1062,9 @@ struct SettingsContentView: View {
UIApplication.shared.open(url)
}
}
.accessibilityIdentifier(AccessibilityID.Settings.locationAlertOpenSettingsButton)
Button(String(localized: "Cancel"), role: .cancel) {}
.accessibilityIdentifier(AccessibilityID.Settings.locationAlertCancelButton)
} message: {
Text("Reflect needs location access to show weather. You can enable it in Settings.")
}
@@ -1084,6 +1100,7 @@ struct SettingsContentView: View {
}
.padding()
})
.accessibilityIdentifier(AccessibilityID.Settings.exportDataButton)
.accessibilityLabel(String(localized: "Export Data"))
.accessibilityHint(String(localized: "Export your mood data as CSV or PDF"))
.background(theme.currentTheme.secondaryBGColor)
@@ -1382,6 +1399,7 @@ struct SettingsView: View {
Divider()
Text("Test builds only")
Toggle("Bypass Subscription", isOn: $iapManager.bypassSubscription)
.accessibilityIdentifier(AccessibilityID.Settings.bypassSubscriptionToggle)
addTestDataCell
clearDB
// fixWeekday
@@ -1745,7 +1763,9 @@ struct SettingsView: View {
UIApplication.shared.open(url)
}
}
.accessibilityIdentifier(AccessibilityID.Settings.locationAlertOpenSettingsButton)
Button(String(localized: "Cancel"), role: .cancel) {}
.accessibilityIdentifier(AccessibilityID.Settings.locationAlertCancelButton)
} message: {
Text("Reflect needs location access to show weather. You can enable it in Settings.")
}
@@ -1781,6 +1801,7 @@ struct SettingsView: View {
}
.padding()
})
.accessibilityIdentifier(AccessibilityID.Settings.exportDataButton)
.background(theme.currentTheme.secondaryBGColor)
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
@@ -1797,6 +1818,7 @@ struct SettingsView: View {
.font(.body)
.foregroundColor(Color(UIColor.systemBlue))
})
.accessibilityIdentifier(AccessibilityID.Settings.closeButton)
}
}
@@ -1811,17 +1833,20 @@ struct SettingsView: View {
Text(String(localized: "settings_view_special_thanks_to_title"))
.foregroundColor(textColor)
})
.accessibilityIdentifier(AccessibilityID.Settings.specialThanksButton)
.padding()
if showSpecialThanks {
Divider()
Link("Font Awesome", destination: URL(string: "https://fontawesome.com")!)
.accessibilityIdentifier(AccessibilityID.Settings.fontAwesomeLink)
.accentColor(textColor)
.padding(.bottom)
Divider()
Link("Charts", destination: URL(string: "https://github.com/danielgindi/Charts")!)
.accessibilityIdentifier(AccessibilityID.Settings.chartsLink)
.accentColor(textColor)
.padding(.bottom)
}
@@ -1838,6 +1863,7 @@ struct SettingsView: View {
Text("Add test data")
.foregroundColor(textColor)
})
.accessibilityIdentifier(AccessibilityID.Settings.addTestDataButton)
.padding()
.frame(maxWidth: .infinity)
.background(theme.currentTheme.secondaryBGColor)
@@ -1867,6 +1893,7 @@ struct SettingsView: View {
showTrialDatePicker = true
}
.font(.subheadline.weight(.medium))
.accessibilityIdentifier(AccessibilityID.Settings.changeTrialDateButton)
}
.padding()
.background(theme.currentTheme.secondaryBGColor)
@@ -1880,6 +1907,7 @@ struct SettingsView: View {
displayedComponents: .date
)
.datePickerStyle(.graphical)
.accessibilityIdentifier(AccessibilityID.Settings.trialDatePicker)
.padding()
.navigationTitle("Set Trial Start Date")
.navigationBarTitleDisplayMode(.inline)
@@ -1892,6 +1920,7 @@ struct SettingsView: View {
await iapManager.checkSubscriptionStatus()
}
}
.accessibilityIdentifier(AccessibilityID.Settings.trialDatePickerDoneButton)
}
}
}
@@ -1909,6 +1938,7 @@ struct SettingsView: View {
Text("Reset luanch date to current date")
.foregroundColor(textColor)
})
.accessibilityIdentifier(AccessibilityID.Settings.resetLaunchDateButton)
.padding()
.frame(maxWidth: .infinity)
.background(theme.currentTheme.secondaryBGColor)
@@ -1923,6 +1953,7 @@ struct SettingsView: View {
Text("Clear DB")
.foregroundColor(textColor)
})
.accessibilityIdentifier(AccessibilityID.Settings.clearDataButton)
.padding()
.frame(maxWidth: .infinity)
.background(theme.currentTheme.secondaryBGColor)
@@ -1937,6 +1968,7 @@ struct SettingsView: View {
Text("Fix Weekday")
.foregroundColor(textColor)
})
.accessibilityIdentifier(AccessibilityID.Settings.fixWeekdayButton)
.padding()
.frame(maxWidth: .infinity)
.background(theme.currentTheme.secondaryBGColor)
@@ -1954,6 +1986,7 @@ struct SettingsView: View {
Text(String(localized: "settings_view_why_bg_mode_title"))
.foregroundColor(textColor)
})
.accessibilityIdentifier(AccessibilityID.Settings.whyBackgroundModeButton)
.padding()
if showWhyBGMode {
Text(String(localized: "settings_view_why_bg_mode_body"))
@@ -2110,13 +2143,14 @@ struct SettingsView: View {
Text("Export")
.foregroundColor(textColor)
})
.accessibilityIdentifier(AccessibilityID.Settings.exportLegacyButton)
.padding()
.frame(maxWidth: .infinity)
.background(theme.currentTheme.secondaryBGColor)
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
}
private var importData: some View {
Button(action: {
showingImporter.toggle()
@@ -2125,13 +2159,14 @@ struct SettingsView: View {
Text("Import")
.foregroundColor(textColor)
})
.accessibilityIdentifier(AccessibilityID.Settings.importButton)
.padding()
.frame(maxWidth: .infinity)
.background(theme.currentTheme.secondaryBGColor)
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
}
private var randomIcons: some View {
Button(action: {
var iconViews = [UIImage]()
@@ -2255,6 +2290,7 @@ struct SettingsView: View {
Text("Create random icons")
.foregroundColor(textColor)
})
.accessibilityIdentifier(AccessibilityID.Settings.randomIconsButton)
.padding()
.frame(maxWidth: .infinity)
.background(theme.currentTheme.secondaryBGColor)

View File

@@ -154,10 +154,10 @@ struct SharingListView: View {
}, label: {
ZStack {
theme.currentTheme.secondaryBGColor
item.preview
.frame(height: 88)
VStack {
Spacer()
Text(item.description)
@@ -179,6 +179,7 @@ struct SharingListView: View {
.contentShape(Rectangle())
.padding([.leading, .trailing])
})
.accessibilityIdentifier(AccessibilityID.Sharing.templateButton(item.description))
}
}

View File

@@ -52,6 +52,7 @@ struct SharingStylePickerView: View {
.font(.headline)
.foregroundColor(.red)
}
.accessibilityIdentifier(AccessibilityID.Sharing.exitButton)
Spacer()
@@ -104,6 +105,7 @@ struct SharingStylePickerView: View {
.background(Color.green)
.cornerRadius(14)
}
.accessibilityIdentifier(AccessibilityID.Sharing.shareButton)
.padding(.horizontal, 24)
.padding(.top, 12)
.padding(.bottom, 24)
@@ -160,6 +162,7 @@ struct LongestStreakPickerView: View {
.font(.headline)
.foregroundColor(.red)
}
.accessibilityIdentifier(AccessibilityID.Sharing.exitButton)
Spacer()
@@ -169,6 +172,7 @@ struct LongestStreakPickerView: View {
selectedMood = mood
recomputeStreak()
}
.accessibilityIdentifier(AccessibilityID.Sharing.moodMenuButton(mood.strValue))
}
} label: {
HStack(spacing: 6) {
@@ -180,6 +184,7 @@ struct LongestStreakPickerView: View {
.foregroundColor(textColor.opacity(0.6))
}
}
.accessibilityIdentifier(AccessibilityID.Sharing.moodMenu)
Spacer()
@@ -225,6 +230,7 @@ struct LongestStreakPickerView: View {
.background(Color.green)
.cornerRadius(14)
}
.accessibilityIdentifier(AccessibilityID.Sharing.shareButton)
.padding(.horizontal, 24)
.padding(.top, 12)
.padding(.bottom, 24)

View File

@@ -176,12 +176,13 @@ struct AllMoodsTotalTemplate: View, SharingTemplate {
.foregroundColor(Color.white)
.padding(.top, 20)
})
.accessibilityIdentifier(AccessibilityID.SharingTemplate.shareButton)
.frame(maxWidth: .infinity, alignment: .center)
.background(
Color.green
)
.padding(.trailing, -5)
Button(action: {
presentationMode.wrappedValue.dismiss()
}, label: {
@@ -191,6 +192,7 @@ struct AllMoodsTotalTemplate: View, SharingTemplate {
.foregroundColor(Color.white)
.padding(.top, 20)
})
.accessibilityIdentifier(AccessibilityID.SharingTemplate.dismissButton)
.frame(maxWidth: .infinity, alignment: .center)
.background(
Color.red

View File

@@ -119,6 +119,7 @@ struct CurrentStreakTemplate: View, SharingTemplate {
.foregroundColor(Color.white)
.padding(.top, 20)
})
.accessibilityIdentifier(AccessibilityID.SharingTemplate.shareButton)
.sheet(isPresented: self.$shareImage.showSheet) {
if let uiImage = self.shareImage.selectedShareImage {
ShareSheet(photo: uiImage)
@@ -129,7 +130,7 @@ struct CurrentStreakTemplate: View, SharingTemplate {
Color.green
)
.padding(.trailing, -5)
Button(action: {
presentationMode.wrappedValue.dismiss()
}, label: {
@@ -139,6 +140,7 @@ struct CurrentStreakTemplate: View, SharingTemplate {
.foregroundColor(Color.white)
.padding(.top, 20)
})
.accessibilityIdentifier(AccessibilityID.SharingTemplate.dismissButton)
.frame(maxWidth: .infinity, alignment: .center)
.background(
Color.red

View File

@@ -167,6 +167,7 @@ struct LongestStreakTemplate: View, SharingTemplate {
selectedMood = mood
configureData(fakeData: self.fakeData, mood: self.selectedMood)
})
.accessibilityIdentifier(AccessibilityID.SharingTemplate.moodMenuButton(mood.strValue))
}
}, label: {
Text("Pick Mood")
@@ -174,6 +175,7 @@ struct LongestStreakTemplate: View, SharingTemplate {
.foregroundColor(textColor)
.padding()
})
.accessibilityIdentifier(AccessibilityID.SharingTemplate.moodMenu)
.frame(maxWidth: .infinity, alignment: .center)
.background(
theme.currentTheme.secondaryBGColor
@@ -194,6 +196,7 @@ struct LongestStreakTemplate: View, SharingTemplate {
.foregroundColor(Color.white)
.padding(.top, 20)
})
.accessibilityIdentifier(AccessibilityID.SharingTemplate.shareButton)
.sheet(isPresented: self.$shareImage.showSheet) {
if let uiImage = self.shareImage.selectedShareImage {
ShareSheet(photo: uiImage)
@@ -204,7 +207,7 @@ struct LongestStreakTemplate: View, SharingTemplate {
Color.green
)
.padding(.trailing, -5)
Button(action: {
presentationMode.wrappedValue.dismiss()
}, label: {
@@ -214,6 +217,7 @@ struct LongestStreakTemplate: View, SharingTemplate {
.foregroundColor(Color.white)
.padding(.top, 20)
})
.accessibilityIdentifier(AccessibilityID.SharingTemplate.dismissButton)
.frame(maxWidth: .infinity, alignment: .center)
.background(
Color.red

View File

@@ -159,6 +159,7 @@ struct MonthTotalTemplate: View, SharingTemplate {
.foregroundColor(Color.white)
.padding(.top, 20)
})
.accessibilityIdentifier(AccessibilityID.SharingTemplate.shareButton)
.sheet(isPresented: self.$shareImage.showSheet) {
if let uiImage = self.shareImage.selectedShareImage {
ShareSheet(photo: uiImage)
@@ -169,7 +170,7 @@ struct MonthTotalTemplate: View, SharingTemplate {
Color.green
)
.padding(.trailing, -5)
Button(action: {
presentationMode.wrappedValue.dismiss()
}, label: {
@@ -179,6 +180,7 @@ struct MonthTotalTemplate: View, SharingTemplate {
.foregroundColor(Color.white)
.padding(.top, 20)
})
.accessibilityIdentifier(AccessibilityID.SharingTemplate.dismissButton)
.frame(maxWidth: .infinity, alignment: .center)
.background(
Color.red

View File

@@ -93,6 +93,7 @@ struct SwitchableView: View {
theme.currentTheme.secondaryBGColor
)
.contentShape(Rectangle())
.accessibilityIdentifier(AccessibilityID.SwitchableView.headerToggle)
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
.padding(.bottom, 30)
.onTapGesture {

View File

@@ -140,6 +140,7 @@ struct TipModalView: View {
y: 6
)
}
.accessibilityIdentifier(AccessibilityID.TipModal.dismissButton)
.padding(.horizontal, 24)
.padding(.bottom, 24)
.opacity(appeared ? 1 : 0)
@@ -308,6 +309,7 @@ struct TipsPreviewView: View {
}
.padding(.vertical, 4)
}
.accessibilityIdentifier(AccessibilityID.TipModal.tipPreviewButton(index))
}
} header: {
Text("Tap to preview")
@@ -320,11 +322,13 @@ struct TipsPreviewView: View {
ReflectTipsManager.shared.resetAllTips()
}
.foregroundColor(.red)
.accessibilityIdentifier(AccessibilityID.TipModal.resetTipsButton)
Toggle("Tips Enabled", isOn: Binding(
get: { ReflectTipsManager.shared.tipsEnabled },
set: { ReflectTipsManager.shared.tipsEnabled = $0 }
))
.accessibilityIdentifier(AccessibilityID.TipModal.tipsEnabledToggle)
} header: {
Text("Settings")
}
@@ -346,6 +350,7 @@ struct TipsPreviewView: View {
Button("Done") {
dismiss()
}
.accessibilityIdentifier(AccessibilityID.TipModal.doneButton)
}
}
.sheet(item: Binding(

View File

@@ -308,6 +308,7 @@ struct YearView: View {
.preferredColorScheme(theme.preferredColorScheme)
#if DEBUG
// Triple-tap to toggle demo mode for video recording
.accessibilityIdentifier(AccessibilityID.YearView.debugDemoToggle)
.onTapGesture(count: 3) {
if demoManager.isDemoMode {
demoManager.stopDemoMode()