diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d871bd8e..983388baa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Switching between sidebar tables no longer leaves extra blank space above the list. (#1675) - SSH tunnels no longer pin a CPU core after the connection drops. A dropped tunnel is now detected and torn down instead of spinning in its relay loop. (#1769) ## [0.53.0] - 2026-06-25 diff --git a/TablePro/Views/Sidebar/FavoritesTabView.swift b/TablePro/Views/Sidebar/FavoritesTabView.swift index 5d2901eb3..af587e7e1 100644 --- a/TablePro/Views/Sidebar/FavoritesTabView.swift +++ b/TablePro/Views/Sidebar/FavoritesTabView.swift @@ -183,8 +183,7 @@ internal struct FavoritesTabView: View { } } } - .listStyle(.sidebar) - .scrollContentBackground(.hidden) + .sidebarListLayout() .onDeleteCommand { deleteSelectedNode() } diff --git a/TablePro/Views/Sidebar/SidebarListLayout.swift b/TablePro/Views/Sidebar/SidebarListLayout.swift new file mode 100644 index 000000000..87eedf818 --- /dev/null +++ b/TablePro/Views/Sidebar/SidebarListLayout.swift @@ -0,0 +1,17 @@ +import SwiftUI + +private struct SidebarListLayout: ViewModifier { + func body(content: Content) -> some View { + content + .listStyle(.sidebar) + .scrollContentBackground(.hidden) + .safeAreaPadding(.top, 0) + .environment(\.defaultMinListHeaderHeight, 0) + } +} + +extension View { + func sidebarListLayout() -> some View { + modifier(SidebarListLayout()) + } +} diff --git a/TablePro/Views/Sidebar/SidebarTreeView.swift b/TablePro/Views/Sidebar/SidebarTreeView.swift index b786365ef..8655bacf3 100644 --- a/TablePro/Views/Sidebar/SidebarTreeView.swift +++ b/TablePro/Views/Sidebar/SidebarTreeView.swift @@ -63,8 +63,7 @@ struct SidebarTreeView: View { } } } - .listStyle(.sidebar) - .scrollContentBackground(.hidden) + .sidebarListLayout() .contextMenu(forSelectionType: TableInfo.self) { _ in EmptyView() } primaryAction: { selection in diff --git a/TablePro/Views/Sidebar/SidebarView.swift b/TablePro/Views/Sidebar/SidebarView.swift index a85359039..fd2aaf99d 100644 --- a/TablePro/Views/Sidebar/SidebarView.swift +++ b/TablePro/Views/Sidebar/SidebarView.swift @@ -376,8 +376,7 @@ struct SidebarView: View { } } } - .listStyle(.sidebar) - .scrollContentBackground(.hidden) + .sidebarListLayout() .contextMenu(forSelectionType: TableInfo.self) { selection in SidebarContextMenu( clickedTable: selection.first,