Skip to content

fix(vscode): show every namespace as selected when the selection is empty - #3521

Merged
rocketstack-matt merged 3 commits into
finos:mainfrom
tnalbant:fix/namespace-selection-empty-means-all
Oct 27, 2026
Merged

rocketstack-matt merged 3 commits into
finos:mainfrom
tnalbant:fix/namespace-selection-empty-means-all

Conversation

@tnalbant

@tnalbant tnalbant commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

With calm.hub.selectedNamespaces empty or unset, the canvas palette shows every namespace, but the status bar tooltip reported Namespaces (0 selected / 2 available) and marked each namespace with ○.

The "empty selection means all namespaces" rule was written inline in CanvasPanel.sendAssets() and never reached HubStatusBar. It now lives in one function that both call:

resolveSelectedNamespaces(available, selection) // [] / undefined / null -> all of `available`
  • CanvasPanel.sendAssets() keeps its behaviour and loses the inline conditional.
  • HubStatusBar uses the resolved list for the tooltip's count and the ✓ / ○ marks.
  • The status bar text is deliberately unchanged: with an empty selection it still shows (N), as the issue notes it was already correct.

extension.ts reads the same setting in the namespace quick pick, but that is the write path (it stores the user's choice), not the render-time rule, so it is untouched.

Closes #3493

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🎨 Code style/formatting changes
  • ♻️ Refactoring (no functional changes)
  • ⚡ Performance improvements
  • ✅ Test additions or updates
  • 🔧 Chore (maintenance, dependencies, CI, etc.)

Affected Components

  • VS Code Extension (calm-plugins/vscode/)
  • everything else

Commit Message Format ✅

fix(vscode): show every namespace as selected when the selection is empty

Testing

The new status bar test fails on the unpatched code with exactly the reported symptom:

$ npx vitest run src/extension/services/hub-status-bar.test.ts
 × marks every namespace as selected when the selection is empty
AssertionError: expected 'Namespaces (0 selected / 2 available)…'
                to contain 'Namespaces (2 selected / 2 available)'

With the change:

$ npx vitest run src/extension/services/hub-status-bar.test.ts \
                 src/extension/services/namespace-selection.test.ts
 Test Files  2 passed (2)
      Tests  17 passed (17)

$ npx vitest run            # whole plugin
 Test Files  55 passed (55)
      Tests  625 passed | 1 todo (626)

$ npx eslint <the five touched files>   # exit 0, no problems

The function tests cover the empty/undefined/null cases, a subset selection, names the hub no longer lists, and an empty hub list.

npx tsc -p tsconfig.extension.json --noEmit reports the same two errors as main (hub-client.ts:108, generic-svg-parser.ts:1 — the second is a missing @types package in my filtered install), so this diff adds no type errors.

  • I have tested my changes locally
  • I have added/updated unit tests
  • All existing tests pass (625 passed, 1 todo)

…mpty

Hovering the CALM Hub status bar item with `calm.hub.selectedNamespaces`
empty or unset reported "0 selected" and marked every namespace with ○,
even though an empty selection means "all namespaces" everywhere else.

That rule was written inline in CanvasPanel.sendAssets(). It now lives in
resolveSelectedNamespaces(), which the canvas panel and the status bar both
call, so the two cannot drift apart again. The status bar text is unchanged:
an empty selection still shows (N).

Fixes finos#3493
@tnalbant
tnalbant requested a review from a team as a code owner October 27, 2026 07:12

@rocketstack-matt rocketstack-matt left a comment

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.

Thank you for your first contribution to CALM.

The osv-scanner failure is not caused by this PR. It comes from a new advisory against block-buffer in the calm-studio Cargo.lock. I will fix it separately.

Comment thread calm-plugins/vscode/src/extension/services/namespace-selection.ts
rocketstack-matt and others added 2 commits October 27, 2026 08:52
Review feedback on finos#3521: CALM Hub has no namespace selection of its own — the
filter is the plugin's `calm.hub.selectedNamespaces` setting — and listing the
callers in a docstring goes stale. The comment now names the setting instead.

Refs finos#3493
@tnalbant

Copy link
Copy Markdown
Contributor Author

Updated at c63ae3fd10.

The docstring now names the calm.hub.selectedNamespaces setting and says CALM Hub has no namespace selection of its own; the caller list is gone, since it would go out of date.

npx vitest run src/extension/services/namespace-selection.test.ts \
                 src/extension/services/hub-status-bar.test.ts
 Test Files  2 passed (2)
      Tests  17 passed (17)

@rocketstack-matt
rocketstack-matt merged commit d204dbe into finos:main Oct 27, 2026
22 checks passed
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.

VS Code plugin: the Hub status bar says "0 selected" when all namespaces show

2 participants