Repository navigation
fix(sidebar): list only the object sections that hold something - #3592
Merged
Merged
Conversation
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.
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.
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
Verified
DatabaseTreeFlatRootTestsbuilds the flat sidebar over a mocked PostgreSQL schema. It fails onmain, where Procedures, Triggers and Types are listed. These tests pinned the old rule and are updated here:SidebarObjectKindTests(emptyTablesSectionIsFlatOnly,noContents,declaredKindShowsEmptySection),DatabaseTreeNodeTests.proceduresOnlySchemaGetsAGroupandDatabaseTreeFilterTests.declaredTypesKindIsVisible. Checked in a Debug build against PostgreSQL.Screenshots
Not in this PR