feat(datasources): only auto-expand search matches in the data sources tree#9955
Merged
Conversation
…s tree Previously, typing any text in the data sources search box expanded every database and every schema unconditionally, flooding the tree open even for branches with no matching tables. Now a database/schema row auto-expands during search only when its already-loaded subtree contains a table whose name matches the query. Deferred (not-yet-fetched) tables and child schemas are treated as non-matching, so search never triggers a lazy catalog fetch on large or remote connections. Expansion is re-evaluated on each keystroke. Adds `schemaSubtreeMatchesSearch` / `shouldExpandDatabaseForSearch` helpers with unit tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
1 issue found across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Auto-expansion was keyed only to search-text changes, so a matching table arriving via lazily-resolved schemas/tables under an unchanged query left the branch collapsed. Also track the computed expansion decision and re-sync when it flips, so newly resolved matches expand without requiring the query to change. Manual collapse/expand under a stable decision is preserved. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Light2Dark
marked this pull request as ready for review
June 23, 2026 04:44
Contributor
There was a problem hiding this comment.
2 issues found across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
mscolnick
approved these changes
Jun 23, 2026
Contributor
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.11-dev18 |
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
Follow-up to #9845 (which superseded the closed #9874). No API or wire-protocol change — purely a frontend UX improvement on the existing
Database.schemasmodel.Previously, typing any text into the data sources search box ran
setIsExpanded(hasSearch)on every database and schema, expanding the entire tree open regardless of whether a branch had any matching tables.Now a database/schema row auto-expands during search only when its already-loaded subtree contains a table whose name matches the query. Crucially, deferred (not-yet-fetched) tables and child schemas are treated as non-matching, so searching never triggers a lazy catalog fetch — important for large/remote connections (Iceberg, etc.) where unconditional expansion would cause a fetch storm. Expansion is re-evaluated on each keystroke.
This is a reimplementation, against the merged
Database.schemasmodel, of the matched-subtree search behavior from the closed #9874.Changes
datasources/utils.ts:schemaSubtreeMatchesSearch(schema, query)— recurses over resolved tables/child schemas only.shouldExpandDatabaseForSearch(database, query)— false when the schema list is deferred.datasources.tsx:DatabaseItemandSchemaNodenow drive auto-expansion via these helpers, trackingprevSearchValueso expansion follows the query. Removes the now-unusedhasSearchplumbing through the tree.Screen.Recording.2026-06-23.at.12.43.14.PM.mov
Testing
pnpm test src/components/datasources/— 55 tests pass.Pre-Review Checklist
Merge Checklist