fix(apple/iOS): stock header + edge-aligned host grid — drop the custom title mode
ci / rust (push) Has been cancelled
ci / rust (push) Has been cancelled
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 <noreply@anthropic.com>
This commit is contained in:
@@ -90,24 +90,16 @@ struct ContentView: View {
|
|||||||
emptyState
|
emptyState
|
||||||
} else {
|
} else {
|
||||||
ScrollView {
|
ScrollView {
|
||||||
LazyVGrid(
|
LazyVGrid(columns: gridColumns, spacing: 16) {
|
||||||
columns: [GridItem(.adaptive(minimum: 180, maximum: 240), spacing: 16)],
|
|
||||||
spacing: 16
|
|
||||||
) {
|
|
||||||
ForEach(store.hosts) { host in
|
ForEach(store.hosts) { host in
|
||||||
hostCard(host)
|
hostCard(host)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(20)
|
.padding()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navigationTitle("punktfunk")
|
.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 {
|
.toolbar {
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
// Adjacent trailing items share one glass pill (the system default).
|
// 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 {
|
private var addHostButton: some View {
|
||||||
Button {
|
Button {
|
||||||
showAddHost = true
|
showAddHost = true
|
||||||
|
|||||||
Reference in New Issue
Block a user