Skip to content

fix(sidebar): remove blank space at top of sidebar when switching tables#1779

Merged
datlechin merged 2 commits into
TableProApp:mainfrom
mvanhorn:fix/1675-fix-remove-blank-space-at-top-of-sidebar
Jun 28, 2026
Merged

fix(sidebar): remove blank space at top of sidebar when switching tables#1779
datlechin merged 2 commits into
TableProApp:mainfrom
mvanhorn:fix/1675-fix-remove-blank-space-at-top-of-sidebar

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

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 pinned Section { } 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 (the treeList list)
  • TablePro/Views/Sidebar/SidebarView.swift (the tableList list)

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 --strict reports 0 violations on both changed files. The change is presentation-only and does not touch selection or navigation logic, so the existing SidebarNavigationResultTests decision-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

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@datlechin datlechin force-pushed the fix/1675-fix-remove-blank-space-at-top-of-sidebar branch from 94f61a9 to de25145 Compare June 28, 2026 11:52
@datlechin datlechin merged commit ea484d3 into TableProApp:main Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The sidebar has a UI bug when clicking on the tables.

2 participants