Feature: expand tooltips to cluster, database, and collection levels#588
Merged
Feature: expand tooltips to cluster, database, and collection levels#588
Conversation
…nnection models and tooltips
Contributor
There was a problem hiding this comment.
Pull request overview
Improves Connections View tooltips by enriching DocumentDBClusterItem with additional connection metadata (host/auth/user/emulator security) sourced from storage-backed connection models.
Changes:
- Extend
ConnectionClusterModelwithselectedAuthMethodandconnectionUserfor tooltip display. - Populate those fields when building connection tree models (root, folders, local emulators).
- Replace the previous tooltip logic with a dedicated markdown tooltip builder (host/auth/user/security).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/tree/connections-view/models/ConnectionClusterModel.ts |
Adds optional auth/username fields to the connections-view cluster model for tooltip display. |
src/tree/connections-view/LocalEmulators/LocalEmulatorsItem.ts |
Passes stored selectedAuthMethod and nativeAuthConfig.connectionUser into the emulator connection cluster model. |
src/tree/connections-view/FolderItem.ts |
Passes stored selectedAuthMethod and nativeAuthConfig.connectionUser into folder child connection cluster models. |
src/tree/connections-view/DocumentDBClusterItem.ts |
Implements a new markdown tooltip builder (host/auth/user/security) and introduces markdown escaping helper. |
src/tree/connections-view/ConnectionsBranchDataProvider.ts |
Passes stored selectedAuthMethod and nativeAuthConfig.connectionUser into root connection cluster models. |
Show the database size on disk in both the tree item description and a markdown tooltip. Size data comes from listDatabases() which already populates DatabaseItemModel.sizeOnDisk at no extra cost.
Show the collection type (collection/view/timeseries) as a badge and document count in a markdown tooltip. Also display the parent database name for context. All data is already available from listCollections() and the async document count loader.
DocumentDB returns sizeOnDisk as 0, so remove it from the database tooltip and description. Add a 'Database' badge to the database tooltip for consistency. Capitalize the collection type badge (Collection, View, Timeseries).
Escape each host and the auth-method label through escapeMarkdown() before appending them as markdown, preventing user-controlled values from rendering unexpected formatting or links.
Guard the AuthMethodId.NativeAuth comparison with isSupportedAuthMethod() to satisfy the @typescript-eslint/no-unsafe-enum-comparison rule.
sajeetharan
approved these changes
Apr 16, 2026
Merged
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.
Goal
Expanding on the initial tooltip work from #579 (cluster-level tooltips), this PR adds rich markdown tooltips to database and collection tree items in the Connections view.
All data shown is "cheap" — it comes from data already fetched during tree expansion (
listDatabases,listCollections,estimateDocumentCount), so no additional API calls are needed.Changes
Cluster tooltip (cherry-picked from
rel/release_0.8.0)Database tooltip (new)
Databasebadge for type identificationCollection tooltip (new)
Collection,View, orTimeseriesDesign decisions
isTrusted = falseon all tooltips to prevent arbitrary markdown executionescapeMarkdown()to prevent markdown injectiontypecomes fromlistCollections(),documentCountis already loaded async for the tree item descriptionCloses #579