Skip to content

fix(sidebar): list only the object sections that hold something - #3592

Merged
datlechin merged 2 commits into
mainfrom
fix/sidebar-hide-empty-sections
Oct 19, 2026
Merged

datlechin merged 2 commits into
mainfrom
fix/sidebar-hide-empty-sections

Conversation

@datlechin

Copy link
Copy Markdown
Member

Why

The sidebar listed a section for every object kind the engine supports, even when the schema held none. A PostgreSQL schema with no procedures, triggers or types showed a Procedures and a Triggers section reading "No items" and a Types section with nothing under it. The flat sidebar also always kept an empty Tables section.

Change

  • A kind gets a section only when the schema holds objects of that kind, in both the flat and tree layouts. A search that matches nothing in a kind no longer leaves a bare header.
  • A kind whose list the server refused keeps its section and shows the error there.
  • A Tables section whose tables are all in folders stays, since dragging a table onto it takes it out of its folder.
  • A schema that holds nothing shows one "No items" row, or "Loading…" while its lists arrive.

Verified

DatabaseTreeFlatRootTests builds the flat sidebar over a mocked PostgreSQL schema. It fails on main, where Procedures, Triggers and Types are listed. These tests pinned the old rule and are updated here: SidebarObjectKindTests (emptyTablesSectionIsFlatOnly, noContents, declaredKindShowsEmptySection), DatabaseTreeNodeTests.proceduresOnlySchemaGetsAGroup and DatabaseTreeFilterTests.declaredTypesKindIsVisible. Checked in a Debug build against PostgreSQL.

Screenshots

Dark Light
Before Before, dark Before, light
After After, dark After, light

Not in this PR

  • Redis: a sidebar search that matches only keys shows "No Results" instead of the Keys section.

The sidebar listed a section for every kind the engine declares, and the flat
root always listed Tables, so a schema with no procedures, triggers or types
showed those sections empty. A kind now gets a section only for its objects,
for tables filed in folders, or for a fetch that failed. A schema holding
nothing says so in one row.
@datlechin
datlechin merged commit 6467a90 into main Oct 19, 2026
17 checks passed
@datlechin
datlechin deleted the fix/sidebar-hide-empty-sections branch October 19, 2026 16:15
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.

1 participant