Enrich test data, fix multi-page PDF export, and polish UI
- Populate debug test data with random notes, guided reflections, and weather - Fix PDF export to use UIPrintPageRenderer for proper multi-page pagination - Add journal/reflection indicator icons to day list entry cells - Fix weather card icon contrast by using secondarySystemBackground - Align Generate Report and Export PDF button widths in ReportsView Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -49,7 +49,7 @@ struct WeatherCardView: View {
|
||||
.padding()
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 16)
|
||||
.fill(Color(.systemBackground))
|
||||
.fill(Color(.secondarySystemBackground))
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,18 @@ struct EntryListView: View {
|
||||
entry.moodValue == Mood.missing.rawValue
|
||||
}
|
||||
|
||||
private var hasNotes: Bool {
|
||||
if let notes = entry.notes, !notes.isEmpty { return true }
|
||||
return false
|
||||
}
|
||||
|
||||
private var hasReflection: Bool {
|
||||
if let json = entry.reflectionJSON,
|
||||
let reflection = GuidedReflection.decode(from: json),
|
||||
reflection.answeredCount > 0 { return true }
|
||||
return false
|
||||
}
|
||||
|
||||
// MARK: - Cached Date Strings (avoids repeated ICU/Calendar operations)
|
||||
private var dateCache: DateFormattingCache { DateFormattingCache.shared }
|
||||
private var cachedDay: String { dateCache.string(for: entry.forDate, format: .day) }
|
||||
@@ -92,6 +104,23 @@ struct EntryListView: View {
|
||||
orbitStyle
|
||||
}
|
||||
}
|
||||
.overlay(alignment: .bottomTrailing) {
|
||||
if !isMissing && (hasNotes || hasReflection) {
|
||||
HStack(spacing: 4) {
|
||||
if hasNotes {
|
||||
Image(systemName: "note.text")
|
||||
.font(.caption2)
|
||||
}
|
||||
if hasReflection {
|
||||
Image(systemName: "sparkles")
|
||||
.font(.caption2)
|
||||
}
|
||||
}
|
||||
.foregroundStyle(.secondary)
|
||||
.padding(.trailing, 12)
|
||||
.padding(.bottom, 6)
|
||||
}
|
||||
}
|
||||
.accessibilityElement(children: .combine)
|
||||
.accessibilityIdentifier(AccessibilityID.DayView.entryRow(dateString: cachedYearMonthDayDigits))
|
||||
.accessibilityLabel(accessibilityDescription)
|
||||
|
||||
@@ -254,6 +254,12 @@ struct ReportsView: View {
|
||||
|
||||
Spacer()
|
||||
}
|
||||
.padding()
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 14)
|
||||
.fill(colorScheme == .dark ? Color(.systemGray6) : .white)
|
||||
)
|
||||
.padding(.horizontal)
|
||||
|
||||
Button {
|
||||
viewModel.showPrivacyConfirmation = true
|
||||
@@ -269,14 +275,9 @@ struct ReportsView: View {
|
||||
.foregroundColor(.white)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 14))
|
||||
}
|
||||
.padding(.horizontal)
|
||||
.accessibilityIdentifier(AccessibilityID.Reports.exportButton)
|
||||
}
|
||||
.padding()
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 14)
|
||||
.fill(colorScheme == .dark ? Color(.systemGray6) : .white)
|
||||
)
|
||||
.padding(.horizontal)
|
||||
}
|
||||
|
||||
// MARK: - Error Card
|
||||
|
||||
Reference in New Issue
Block a user