fix(tree): hide single-item context menu commands when multiple items selected#693
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds an asynchronously loaded index count to the “Indexes” tree node (shown in the description), and updates context menu enablement to avoid showing single-item actions during multi-selection.
Changes:
- Add background fetching + caching of index counts for a collection’s Indexes node and refresh the tree item when loaded.
- Kick off index count loading when a Collection is expanded (fire-and-forget).
- Update many view/item context menu “when” clauses to disable commands when
listMultiSelectionis active, and add related l10n strings.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 10 comments.
| File | Description |
|---|---|
| src/tree/documentdb/IndexesItem.ts | Adds async index count loading, caching, and tree refresh + shows count in tree item description. |
| src/tree/documentdb/CollectionItem.ts | Starts the background count load when creating the IndexesItem. |
| package.json | Disables various context menu commands during multi-selection via !listMultiSelection. |
| l10n/bundle.l10n.json | Adds localized strings for singular/plural index count display. |
ad176d5 to
47414fa
Compare
|
Maintainer note (triage) During triage this branch was rebased onto main and the index-count feature was pruned out, because that functionality already landed separately in PR #714. As a result, the earlier Copilot review comments referencing IndexesItem.ts / CollectionItem.ts / index-count localization strings no longer apply and have been acknowledged inline. The PR now contains only the intended fix for #668: adding Note for reviewers: a quick manual UI check (select multiple tree items, confirm single-item actions disappear) is recommended before merge. |
Summary
Add
&& !listMultiSelectionto thewhenclause of 36 context menu commands in the Connections tree view. When multiple items are selected, single-item commands are now hidden, preventing silent failures (commands acting on only the first item) or unexpected behavior.Issue
Fixes #668
Approach
Followed the issue audit table exactly:
!listMultiSelectiontowhenclauseremoveConnection,moveItems)canSelectMany: true)Verification
npm run build-- TypeScript compilation passesnpm run lint-- ESLint passesnpm run prettier-fix-- formatting confirmed