From 852e46fcf8aa4d535251910141160d923cb3d116 Mon Sep 17 00:00:00 2001 From: Scarriffle Date: Mon, 1 Jun 2026 08:50:32 +0200 Subject: [PATCH] fix: month title disappears in Liquid Glass mode on month change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The glass variant rendered the month title in a `.principal` ToolbarItem, which SwiftUI drops when the state it reads (visibleMonth) changes while on screen — it only reappeared on an unrelated rebuild (opening/closing the menu) and vanished again on the next month change. Switched to `.navigationTitle`, which the system updates reliably. Co-Authored-By: Claude Opus 4.8 --- Calendarr iOS/Views/Calendar/CalendarHostView.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Calendarr iOS/Views/Calendar/CalendarHostView.swift b/Calendarr iOS/Views/Calendar/CalendarHostView.swift index 78c4164..6e9e99f 100644 --- a/Calendarr iOS/Views/Calendar/CalendarHostView.swift +++ b/Calendarr iOS/Views/Calendar/CalendarHostView.swift @@ -112,6 +112,12 @@ struct CalendarHostView: View { .overlay(alignment: .top) { if let err = store.lastError { errorBannerView(err).padding(.top, 8) } } + // The month title uses `.navigationTitle` rather than a + // `.principal` ToolbarItem: a principal item disappears when the + // state it reads (visibleMonth) changes while on screen (month + // change / scroll), reappearing only on an unrelated rebuild. + // navigationTitle is updated reliably by the system. + .navigationTitle(titleString) .navigationBarTitleDisplayMode(.inline) .toolbar { ToolbarItem(placement: .navigationBarLeading) { @@ -121,12 +127,6 @@ struct CalendarHostView: View { Button(L10n.t("nav.today", appLang)) { store.moveToToday() }.font(.callout) } } - ToolbarItem(placement: .principal) { - Text(titleString) - .font(.headline) - .lineLimit(1) - .minimumScaleFactor(0.7) - } ToolbarItem(placement: .navigationBarTrailing) { HStack(spacing: 8) { if !groups.isEmpty { groupMenu }