Files
Reflect/Shared/Views/EmptyView.swift
Trey t 44b46f88e2 Fix 23 failing UI tests: accessibility hierarchy, test mode, and interaction issues
App fixes:
- Remove empty_state identifier from EmptyHomeView VStack (was overriding mood_header)
- Fix resetAppState to set needsOnboarding=true (fresh state) instead of false
- Set bypassSubscription explicitly based on launch arg presence (was defaulting to true in DEBUG)

Test fixes:
- TabBarScreen: use coordinate tap to avoid iOS 26 Liquid Glass hittability issues
- SettingsScreen: use coordinate tap for segments, handle Settings label ambiguity with tab bar
- EntryDetailScreen: use mood_button_ identifiers instead of label matching (was matching entry rows)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 16:14:16 -06:00

57 lines
1.8 KiB
Swift

//
// EmptyView.swift
// Feels (iOS)
//
// Created by Trey Tartt on 2/10/22.
//
import SwiftUI
struct EmptyHomeView: View {
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
private var textColor: Color { theme.currentTheme.labelColor }
let showVote: Bool
let viewModel: DayViewViewModel?
var body: some View {
ZStack {
theme.currentTheme.secondaryBGColor
VStack {
if showVote {
AddMoodHeaderView(addItemHeaderClosure: { (mood, date) in
withAnimation {
viewModel?.add(mood: mood, forDate: date, entryType: .header)
}
})
} else {
VStack {
Spacer()
Text(String(localized: "view_no_data"))
.font(.title)
.padding()
.fixedSize(horizontal: false, vertical: true)
.foregroundColor(textColor)
.accessibilityIdentifier(AccessibilityID.DayView.emptyStateNoData)
Spacer()
}
}
}
}
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
}
}
struct EmptyHomeView_Previews: PreviewProvider {
static var previews: some View {
Group {
EmptyHomeView(showVote: true, viewModel: DayViewViewModel(addMonthStartWeekdayPadding: false))
EmptyHomeView(showVote: false, viewModel: nil)
}
}
}