nvrsion: Add: Remove Home Header padding and fix archive button vertical alignment in SessionsView.
Nucleic-Promote: 1 Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -99,6 +99,11 @@ struct HomeView: View {
|
|||||||
QuickTodos()
|
QuickTodos()
|
||||||
}
|
}
|
||||||
.padding()
|
.padding()
|
||||||
|
// The greeting stands in for the page's large title (same 34pt bold font), so
|
||||||
|
// reserve the large-title band above it. Without the system `.navigationTitle`,
|
||||||
|
// the bar collapses and the greeting would otherwise ride ~52pt higher than the
|
||||||
|
// large titles on the other tabs (Sessions/Projects/Settings).
|
||||||
|
.padding(.top, 52)
|
||||||
// Cap + center the dashboard on a wide iPad so it reads like the Mac home rather
|
// Cap + center the dashboard on a wide iPad so it reads like the Mac home rather
|
||||||
// than a stretched phone; a no-op at phone width.
|
// than a stretched phone; a no-op at phone width.
|
||||||
.readableColumn()
|
.readableColumn()
|
||||||
|
|||||||
@@ -79,7 +79,12 @@ struct SessionsView: View {
|
|||||||
.compactTabBarInset()
|
.compactTabBarInset()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navigationTitle("Sessions")
|
// The title is rendered as content (`sessionsHeader`) rather than a system
|
||||||
|
// `.navigationTitle`, so the archive toggle can sit on the same row, centered with it
|
||||||
|
// (a system toolbar item can only ride in the compact bar, floating above a large
|
||||||
|
// title). The empty inline bar keeps the top band matching the Home dashboard.
|
||||||
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
|
.safeAreaInset(edge: .top, spacing: 0) { sessionsHeader }
|
||||||
.navigationDestination(for: SessionID.self) { id in
|
.navigationDestination(for: SessionID.self) { id in
|
||||||
SessionDetailView(sessionID: id)
|
SessionDetailView(sessionID: id)
|
||||||
}
|
}
|
||||||
@@ -102,16 +107,31 @@ struct SessionsView: View {
|
|||||||
.onChange(of: path) { _, newPath in
|
.onChange(of: path) { _, newPath in
|
||||||
store.compactDetailPresented = !newPath.isEmpty
|
store.compactDetailPresented = !newPath.isEmpty
|
||||||
}
|
}
|
||||||
.toolbar {
|
}
|
||||||
ToolbarItem(placement: .topBarTrailing) {
|
}
|
||||||
|
|
||||||
|
/// The page's large title as content, so the archive toggle can share its row (vertically
|
||||||
|
/// centered with the title) instead of floating in the compact bar above it. Mirrors the Home
|
||||||
|
/// dashboard's greeting header — same large-title font and top band — for a consistent look.
|
||||||
|
private var sessionsHeader: some View {
|
||||||
|
HStack {
|
||||||
|
Text("Sessions").font(.largeTitle.bold())
|
||||||
|
Spacer()
|
||||||
Button {
|
Button {
|
||||||
showArchived.toggle()
|
showArchived.toggle()
|
||||||
} label: {
|
} label: {
|
||||||
Image(systemName: showArchived ? "archivebox.fill" : "archivebox")
|
Image(systemName: showArchived ? "archivebox.fill" : "archivebox")
|
||||||
|
.font(.title3)
|
||||||
}
|
}
|
||||||
|
.foregroundStyle(Palette.accent)
|
||||||
|
.accessibilityLabel(showArchived ? "Hide archived sessions" : "Show archived sessions")
|
||||||
}
|
}
|
||||||
}
|
.padding(.horizontal)
|
||||||
}
|
.padding(.top, 52)
|
||||||
|
.padding(.bottom, 8)
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
// Cover the list rows that scroll up behind the pinned header.
|
||||||
|
.background(Color(.systemGroupedBackground))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Push the session a notification tap asked for, then clear the request.
|
/// Push the session a notification tap asked for, then clear the request.
|
||||||
|
|||||||
Reference in New Issue
Block a user