From 3faec8415a4a2fcd7d9802d981e86ea7ca6a80f8 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Thu, 11 Jun 2026 11:58:54 +0200 Subject: [PATCH] =?UTF-8?q?fix(apple/iOS):=20stock=20header=20+=20edge-ali?= =?UTF-8?q?gned=20host=20grid=20=E2=80=94=20drop=20the=20custom=20title=20?= =?UTF-8?q?mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "title looks off" report traced to the GRID, not the title: the Mac-tuned adaptive(180–240) columns yielded a single max-width card, centered, so nothing aligned with the leading large title. The header is now entirely stock primitives — default .navigationTitle large-title behavior (the inlineLarge experiment is gone), default .padding() so content sits on the system 16 pt margins — and the grid columns are platform-tuned: iOS drops the max so columns FILL the width and the cards stay edge-aligned with the title; macOS keeps the 180–240 cap (huge windows shouldn't grow huge cards). Verified in the iPhone 17 simulator with seeded hosts: pill top-right, large title at system metrics, two full-width-filling cards flush with the title's leading edge. Co-Authored-By: Claude Fable 5 --- .../Sources/PunktfunkClient/ContentView.swift | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/clients/apple/Sources/PunktfunkClient/ContentView.swift b/clients/apple/Sources/PunktfunkClient/ContentView.swift index e504a1f..6af0146 100644 --- a/clients/apple/Sources/PunktfunkClient/ContentView.swift +++ b/clients/apple/Sources/PunktfunkClient/ContentView.swift @@ -90,24 +90,16 @@ struct ContentView: View { emptyState } else { ScrollView { - LazyVGrid( - columns: [GridItem(.adaptive(minimum: 180, maximum: 240), spacing: 16)], - spacing: 16 - ) { + LazyVGrid(columns: gridColumns, spacing: 16) { ForEach(store.hosts) { host in hostCard(host) } } - .padding(20) + .padding() } } } .navigationTitle("punktfunk") - #if os(iOS) - // Liquid-glass header: the large title shares the bar row with the action - // circles instead of stacking under them. - .toolbarTitleDisplayMode(.inlineLarge) - #endif .toolbar { #if os(iOS) // Adjacent trailing items share one glass pill (the system default). @@ -157,6 +149,16 @@ struct ContentView: View { } } + /// macOS caps card width (a huge window shouldn't yield huge cards); on iOS the + /// columns FILL the width so the cards stay edge-aligned with the title and bars. + private var gridColumns: [GridItem] { + #if os(macOS) + [GridItem(.adaptive(minimum: 180, maximum: 240), spacing: 16)] + #else + [GridItem(.adaptive(minimum: 160), spacing: 16)] + #endif + } + private var addHostButton: some View { Button { showAddHost = true