Skip to content

Feature: expand tooltips to cluster, database, and collection levels#588

Merged
tnaum-ms merged 10 commits intonextfrom
dev/tnaum/tooltips
Apr 16, 2026
Merged

Feature: expand tooltips to cluster, database, and collection levels#588
tnaum-ms merged 10 commits intonextfrom
dev/tnaum/tooltips

Conversation

@tnaum-ms
Copy link
Copy Markdown
Collaborator

@tnaum-ms tnaum-ms commented Apr 16, 2026

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)

  • Name — cluster display name (heading)
  • Host — server hostname(s) parsed from the connection string
  • Auth — authentication method (e.g. Username and Password, Entra ID)
  • User — connection username, shown only for SCRAM / native auth
  • Security — TLS/SSL status, shown only for local emulator connections

Database tooltip (new)

  • Name — database name (heading)
  • Database badge for type identification

Collection tooltip (new)

  • Name — collection name (heading)
  • Type badge — Collection, View, or Timeseries
  • Database — parent database name for context
  • Documents — formatted document count (loaded asynchronously, updates on refresh)

Design decisions

  • Uses isTrusted = false on all tooltips to prevent arbitrary markdown execution
  • User-provided text (names) is escaped via escapeMarkdown() to prevent markdown injection
  • Follows the same formatting pattern as the existing index tooltips (badges + properties)
  • No new API calls: type comes from listCollections(), documentCount is already loaded async for the tree item description

Closes #579

@tnaum-ms tnaum-ms added this to the 0.7.4 milestone Apr 16, 2026
@tnaum-ms tnaum-ms requested a review from a team as a code owner April 16, 2026 12:43
Copilot AI review requested due to automatic review settings April 16, 2026 12:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ConnectionClusterModel with selectedAuthMethod and connectionUser for 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.

Comment thread src/tree/connections-view/DocumentDBClusterItem.ts
Comment thread src/tree/connections-view/DocumentDBClusterItem.ts Outdated
Comment thread src/tree/connections-view/DocumentDBClusterItem.ts
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.
@tnaum-ms tnaum-ms changed the title Feature: improve tooltips in the connection view Feature: expand tooltips to cluster, database, and collection levels Apr 16, 2026
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.
@tnaum-ms tnaum-ms merged commit cca994d into next Apr 16, 2026
16 of 20 checks passed
@tnaum-ms tnaum-ms deleted the dev/tnaum/tooltips branch April 16, 2026 16:32
@tnaum-ms tnaum-ms mentioned this pull request Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Connections view: add markdown tooltip to connection tree items

3 participants