Move weather into entry detail date header

Display weather inline next to the date in a compact HStack layout
(icon | condition + temps) instead of a separate Weather section.
Removes the standalone weatherSection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-03-17 22:53:30 -05:00
parent 99314b8e6a
commit c7f05335c8
2 changed files with 44 additions and 26 deletions

View File

@@ -10571,6 +10571,18 @@
} }
} }
}, },
"H: %lld° L: %lld°" : {
"comment" : "A pair of high and low temperatures displayed in degrees Celsius.",
"isCommentAutoGenerated" : true,
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "H: %1$lld° L: %2$lld°"
}
}
}
},
"Haptic Feedback" : { "Haptic Feedback" : {
"comment" : "A label displayed above the toggle for haptic feedback.", "comment" : "A label displayed above the toggle for haptic feedback.",
"isCommentAutoGenerated" : true, "isCommentAutoGenerated" : true,

View File

@@ -193,12 +193,6 @@ struct EntryDetailView: View {
// Notes section // Notes section
notesSection notesSection
// Weather section
if let weatherJSON = entry.weatherJSON,
let weatherData = WeatherData.decode(from: weatherJSON) {
weatherSection(weatherData)
}
// Photo section // Photo section
photoSection photoSection
@@ -259,18 +253,40 @@ struct EntryDetailView: View {
} }
private var dateHeader: some View { private var dateHeader: some View {
VStack(spacing: 8) { HStack {
Text(entry.forDate, format: .dateTime.weekday(.wide)) VStack(alignment: .leading, spacing: 4) {
.font(.title2) Text(entry.forDate, format: .dateTime.weekday(.wide))
.fontWeight(.semibold) .font(.title2)
.foregroundColor(textColor) .fontWeight(.semibold)
.foregroundColor(textColor)
Text(entry.forDate, format: .dateTime.month(.wide).day().year()) Text(entry.forDate, format: .dateTime.month(.wide).day().year())
.font(.subheadline) .font(.subheadline)
.foregroundStyle(.secondary) .foregroundStyle(.secondary)
}
Spacer()
// Weather if available
if let weatherJSON = entry.weatherJSON,
let weather = WeatherData.decode(from: weatherJSON) {
HStack(spacing: 8) {
Image(systemName: weather.conditionSymbol)
.font(.title)
.foregroundStyle(.secondary)
VStack(alignment: .leading, spacing: 2) {
Text(weather.condition)
.font(.subheadline)
.foregroundStyle(.secondary)
Text("H: \(Int(round(weather.highTemperature)))° L: \(Int(round(weather.lowTemperature)))°")
.font(.caption)
.foregroundStyle(.tertiary)
}
}
}
} }
.frame(maxWidth: .infinity) .padding(.horizontal, 20)
.padding(.vertical, 20) .padding(.vertical, 16)
.background( .background(
RoundedRectangle(cornerRadius: 16) RoundedRectangle(cornerRadius: 16)
.fill(Color(.systemBackground)) .fill(Color(.systemBackground))
@@ -494,16 +510,6 @@ struct EntryDetailView: View {
} }
} }
private func weatherSection(_ weatherData: WeatherData) -> some View {
VStack(alignment: .leading, spacing: 12) {
Text("Weather")
.font(.headline)
.foregroundColor(textColor)
WeatherCardView(weatherData: weatherData)
}
}
private var photoSection: some View { private var photoSection: some View {
VStack(alignment: .leading, spacing: 12) { VStack(alignment: .leading, spacing: 12) {
HStack { HStack {