Skip to content

feat(compass-connections-navigation): add configurable hidden namespaces display COMPASS-10954 - #8329

Open
nbbeeken wants to merge 1 commit into
mainfrom
COMPASS-10954
Open

feat(compass-connections-navigation): add configurable hidden namespaces display COMPASS-10954#8329
nbbeeken wants to merge 1 commit into
mainfrom
COMPASS-10954

Conversation

@nbbeeken

@nbbeeken nbbeeken commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Description

Make hiding namespaces a setting in Compass

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • If this change could impact the load on the MongoDB cluster, please describe the expected and worst case impact
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@github-actions github-actions Bot added the feat label Aug 7, 2026
Copilot AI lite review requested due to automatic review settings August 13, 2026 01:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new user preference to control whether “hidden” MongoDB namespaces (internal/system/admin-local-config) are shown in the connections navigation sidebar, and shifts namespace hiding logic into the navigation layer.

Changes:

  • Adds a showHiddenNamespaces preference and exposes it in General settings.
  • Updates the connections navigation tree to optionally filter hidden databases/collections and visually distinguish hidden items when shown.
  • Removes internal/system namespace filtering from the database/collection model fetch layers.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/database-model/test/index.test.js Updates database-model fetch test expectations around internal DBs
packages/database-model/package.json Removes mongodb-ns dependency from database-model
packages/database-model/lib/model.js Stops filtering internal DBs at the model layer
packages/compass-settings/src/components/settings/general.tsx Adds showHiddenNamespaces to General settings fields
packages/compass-preferences-model/src/preferences-schema.tsx Defines and documents the showHiddenNamespaces preference
packages/compass-connections-navigation/src/tree-data.ts Adds hidden-namespace classification + visibility selector for sidebar tree data
packages/compass-connections-navigation/src/styled-navigation-item.tsx Applies distinct styling to hidden namespaces when displayed
packages/compass-connections-navigation/src/navigation-item-icon.tsx Adds hidden-namespace tooltip/icon behavior for some item types
packages/compass-connections-navigation/src/connections-navigation-tree.tsx Wires showHiddenNamespaces into tree rendering via selector
packages/compass-connections-navigation/src/base-navigation-item.tsx Adds CSS variable support for italic styling of hidden items
packages/compass-connections-navigation/package.json Adds mongodb-ns dependency
packages/collection-model/test/index.test.js Updates collection-model fetch test expectations around system collections
packages/collection-model/lib/model.js Stops filtering system collections at the model layer
package-lock.json Lockfile updates for dependency changes
Suppressed comments (2)

packages/compass-connections-navigation/src/tree-data.ts:450

  • selectVisibleDatabase() currently filters out all system.* collections. This will also hide system.profile, which historically is treated as a visible collection (and is explicitly excluded from system filtering elsewhere in the codebase).
  const collections: Collection[] = [];
  for (const collection of database.collections) {
    if (!toNS(collection._id).system) {
      collections.push(collection);
    }
  }

packages/compass-connections-navigation/src/navigation-item-icon.tsx:64

  • The hidden-namespace tooltip/icon treatment was added for database and collection, but view and timeseries items can also be hidden via isHiddenTreeItem(). Currently those item types won't show the warning tooltip even when they are hidden, leading to inconsistent UI feedback.
  if (item.type === 'collection') {
    if (isHiddenTreeItem(item)) {
      return (
        <IconWithTooltip text={HIDDEN_NAMESPACE_TEXT} glyph="EmptyFolder" />
      );
    }
    if (item.inferredFromPrivileges) {
      return (
        <IconWithTooltip

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/compass-connections-navigation/src/tree-data.ts
Comment thread packages/database-model/test/index.test.js
Comment thread packages/database-model/lib/model.js Outdated
Comment thread packages/collection-model/lib/model.js Outdated
Comment thread packages/compass-connections-navigation/src/navigation-item-icon.tsx Outdated
@nbbeeken
nbbeeken force-pushed the COMPASS-10954 branch 2 times, most recently from 9f6bacc to 315a04d Compare August 13, 2026 01:59
@nbbeeken
nbbeeken requested a review from gribnoysup August 13, 2026 02:07
@nbbeeken
nbbeeken marked this pull request as ready for review August 13, 2026 13:30
@nbbeeken
nbbeeken requested a review from a team as a code owner August 13, 2026 13:30
@nbbeeken
nbbeeken requested a review from a team as a code owner August 13, 2026 13:30
@nbbeeken

Copy link
Copy Markdown
Collaborator Author
image

got rid of the styling, I'm doing too much design, the point is here is to get back the lost functionality

Comment thread packages/compass-connections-navigation/src/tree-data.ts Outdated
Comment thread packages/database-model/lib/model.js Outdated
_id,
name,
inferred_from_privileges,
}))

@Anemy Anemy Aug 13, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I like this change but it comes at the risk of us adding a new feature and forgetting to follow the showHiddenNamespaces setting. It's additional context for working with collections that folks have to now consider (I think they'll forget it lol).

I'm not sure if it will end up costing us more than the benefit of removing this logic from here. To ensure folks can get these collections and also have the showHiddenNamespaces setting applied everywhere, and abstracted from the consumer, so they only get the collections they need I feel having it on the model does make sense in the end.
With shouldFetchDbAndCollStats in instance model there are more patterns of preferences applied at that level that then cause the model to change and push it's updated out.

Some of the other places besides connections-navigation-tree that we would have to do the same filtering if we went with this approach:

(Also left this comment on the first pr) Where mongodb-ns sets internal we could add this atlas one https://github.com/mongodb-js/devtools-shared/blob/3663d65ab1e49bd53557dba41fcb7c1298878b52/packages/mongodb-ns/src/index.ts#L53-L54

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm walking a thin line between having the model own their "type" (as-in, the collection model now owns isSpecialish or db models own isInternal) and going as far as to tell the UI straight up "shouldHide". Telling the UI parts of the code from the model code how to display rather than providing the information and letting it decide how to display seems like the right call but with the setting being another thing to consult it does get convoluted and can lead to inconsistencies across the app.

I can do better here though, I have an idea of how I can consolidate and simplify the logic further and then it will be easier to apply in places that don't yet filter at all

Base automatically changed from COMPASS-10948 to main August 13, 2026 20:38
@nbbeeken
nbbeeken force-pushed the COMPASS-10954 branch 7 times, most recently from 44f7213 to 6ef317b Compare August 15, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants