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" : {
"comment" : "A label displayed above the toggle for haptic feedback.",
"isCommentAutoGenerated" : true,

View File

@@ -193,12 +193,6 @@ struct EntryDetailView: View {
// Notes section
notesSection
// Weather section
if let weatherJSON = entry.weatherJSON,
let weatherData = WeatherData.decode(from: weatherJSON) {
weatherSection(weatherData)
}
// Photo section
photoSection
@@ -259,7 +253,8 @@ struct EntryDetailView: View {
}
private var dateHeader: some View {
VStack(spacing: 8) {
HStack {
VStack(alignment: .leading, spacing: 4) {
Text(entry.forDate, format: .dateTime.weekday(.wide))
.font(.title2)
.fontWeight(.semibold)
@@ -269,8 +264,29 @@ struct EntryDetailView: View {
.font(.subheadline)
.foregroundStyle(.secondary)
}
.frame(maxWidth: .infinity)
.padding(.vertical, 20)
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)
}
}
}
}
.padding(.horizontal, 20)
.padding(.vertical, 16)
.background(
RoundedRectangle(cornerRadius: 16)
.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 {
VStack(alignment: .leading, spacing: 12) {
HStack {