fix(sidebar): remove blank space at top of sidebar when switching tables#1779
Merged
datlechin merged 2 commits intoJun 28, 2026
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
94f61a9 to
de25145
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Switching between tables in the sidebar no longer leaves a blank band at the top of the table tree. The first row now stays flush to the top across repeated selections.
Why this matters
Reported in #1675 (screen recording attached there): with a database open, clicking from one table to another inserts an empty gap above the first row that grows and persists on each switch. Both sidebar lists render
List(selection:)with pinnedSection { } header: { }headers, so when the selection changes the List re-applies its default top content/safe-area inset and the pinned header height, which shows up as leading whitespace.The fix normalizes that inset and header height at the two list call sites so a re-layout on selection does not add space:
TablePro/Views/Sidebar/SidebarTreeView.swift(thetreeListlist)TablePro/Views/Sidebar/SidebarView.swift(thetableListlist)Each gets
.safeAreaPadding(.top, 0)and.environment(\.defaultMinListHeaderHeight, 0).Testing
The two modifiers typecheck against the macOS 14 SDK (
swiftc -typecheck -target arm64-apple-macosx14.0).swiftlint lint --strictreports 0 violations on both changed files. The change is presentation-only and does not touch selection or navigation logic, so the existingSidebarNavigationResultTestsdecision-logic suite is unaffected. The visual gap is a layout glitch that is not deterministically unit-testable, so no flaky UI assertion was added; please verify by clicking through several tables in the sidebar.Fixes #1675