Skip to content

fix(sidebar): let the object selection follow the database being browsed again - #2560

Merged
datlechin merged 1 commit into
mainfrom
fix/sidebar-selection-follows-browsed-database
Aug 27, 2026
Merged

fix(sidebar): let the object selection follow the database being browsed again#2560
datlechin merged 1 commit into
mainfrom
fix/sidebar-selection-follows-browsed-database

Conversation

@datlechin

Copy link
Copy Markdown
Member

main is red. The three failing cases in DatabaseTreeObjectGroupHierarchyTests came in with #2556 and are failing on every run since, including 33057688123 on main's own head:

Expectation failed: await selectionSettles(in: outlineView, on: activeView)
Expectation failed: (selected.count → 1) == 2
Expectation failed: selected.contains { $0 === shopReport }

Cause

Sidebar selection adoption matched in two steps: by table object, then scoped to the database on screen. #2556 moved WindowSidebarState.selectedTables to carry DatabaseTreeTableRef so the staged Truncate and Drop queue could stop keying on a bare name, and the first step became a whole-reference comparison. A reference pins the database it was picked in, so browsing elsewhere left the tree with nothing selected, and a multi-selection stopped adopting the active database's rows.

Fix

Match on the object, keep the database scope that already sits on the next line. selectedTables still carries full references, which is what the queue needs; only the adoption comparison changes.

Both behaviours are already pinned by the suite that has been failing: "Selection adoption distinguishes identical objects across databases" and "A multi-selection adopts only rows in the active database".

Verified

verify.sh test DatabaseTreeObjectGroupHierarchyTests SidebarOutlineScaffoldTests SidebarHostingCellTests: 15 executed, 15 passed.

The three UI test jobs fail on main as well, on the tab-drag reorder and "The sample database never finished opening". Those are not this.

The same commit is on #2559, which is where the fix was written; this PR carries it alone so main does not have to wait for that feature.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@datlechin
datlechin merged commit 75e848a into main Aug 27, 2026
8 checks passed
@datlechin
datlechin deleted the fix/sidebar-selection-follows-browsed-database branch August 27, 2026 11:03
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