Align floating task sheets with the task pane header

This commit is contained in:
Ian Gulliver
2026-10-23 22:00:46 -07:00
parent 5d8e3bdea4
commit b02c9b3e3c
5 changed files with 40 additions and 22 deletions
+24
View File
@@ -544,6 +544,30 @@ struct DropdownMenu<Items: View>: View {
}
}
struct PaneRow: ViewModifier {
var tabs = false
func body(content: Content) -> some View {
Text("Ag")
.font(Fonts.font(13, weight: tabs ? 400 : 700))
.padding(.vertical, tabs ? 7 : 6)
.hidden()
.frame(maxWidth: .infinity)
.overlay { content.frame(maxWidth: .infinity, maxHeight: .infinity) }
}
}
struct PaneTabBar: ViewModifier {
func body(content: Content) -> some View {
content
.padding(.horizontal, 12)
.modifier(PaneRow(tabs: true))
.overlay(alignment: .bottom) {
Rectangle().fill(Palette.border).frame(height: 1)
}
}
}
struct HeaderBar: ViewModifier {
func body(content: Content) -> some View {
content
+1 -5
View File
@@ -576,12 +576,8 @@ struct PageTabs: View {
PageTabButton(page: page, active: page == shown.current)
}
}
.padding(.horizontal, 12)
}
.fixedSize(horizontal: false, vertical: true)
.overlay(alignment: .bottom) {
Rectangle().fill(Palette.border).frame(height: 1)
}
.modifier(PaneTabBar())
ZStack {
ForEach(shown.pages, id: \.self) { page in
if let view = store.pageView(page) {
+10 -12
View File
@@ -144,10 +144,10 @@ private struct LeftPane: View {
SettingsView()
}
}
.overlay {
if let sheet = store.sheet, sheet.owner != .lead {
SheetHost(sheet: sheet)
}
}
.overlay {
if let sheet = store.sheet, sheet.owner != .lead {
SheetHost(sheet: sheet)
}
}
}
@@ -185,10 +185,10 @@ private struct TaskPane: View {
}
}
}
.overlay {
if let sheet = store.sheet, sheet.owner == .lead {
SheetHost(sheet: sheet)
}
}
.overlay {
if let sheet = store.sheet, sheet.owner == .lead {
SheetHost(sheet: sheet)
}
}
.environment(\.paneAccent, accent)
@@ -338,6 +338,7 @@ struct TaskBar: View {
.frame(maxWidth: .infinity)
}
.padding(.horizontal, 12)
.modifier(PaneRow())
.background {
ZStack {
Palette.bg
@@ -409,10 +410,7 @@ struct TabStrip: View {
FoldingTabs(tabs: info.order.map { ($0, $0.label) }, active: info.tab) { t in
store.openTab(t)
}
.padding(.horizontal, 12)
.overlay(alignment: .bottom) {
Rectangle().fill(Palette.border).frame(height: 1)
}
.modifier(PaneTabBar())
}
}
+4 -4
View File
@@ -24,7 +24,7 @@ struct Sheet {
}
}
private let stripWidth: CGFloat = 56
private let stripWidth: CGFloat = 24
private let corner: CGFloat = 8
struct SheetHost: View {
@@ -108,17 +108,17 @@ private struct SheetPanel: View {
.help("Close (Esc)")
}
.padding(.horizontal, 12)
.padding(.vertical, 7)
.modifier(PaneRow())
.background(accent.opacity(0.12))
.overlay(alignment: .bottom) {
Rectangle().fill(accent).frame(height: 1)
Rectangle().fill(Palette.border).frame(height: 1)
}
SheetContent(view: sheet.view)
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
.background(Palette.bg)
.clipShape(clip)
.overlay(SheetEdge(openTrailing: overLeft).stroke(accent, lineWidth: 1.5))
.overlay(SheetEdge(openTrailing: overLeft).stroke(Palette.border, lineWidth: 1))
.shadow(color: Palette.overlayShadow, radius: 14, x: overLeft ? -6 : 6)
.environment(\.paneAccent, accent)
.environment(\.inTask, overLeft)
+1 -1
View File
@@ -68,7 +68,7 @@ struct TerminalTab: View {
.foregroundStyle(Palette.muted)
.lineLimit(1)
}
.modifier(HeaderBar())
.modifier(PaneTabBar())
Group {
if let taskId, task?.status == .active {
if let current {