fix: improve hidden index tree item visibility and menu actions#674
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 richer context and UI cues for DocumentDB index tree items so the Hide/Unhide Index commands only appear when appropriate (e.g., not for default _id_ indexes, and toggling based on hidden state).
Changes:
- Add
index_hidden/index_defaultcontext values and show a “hidden” description for hidden indexes in the tree. - Update command
whenclauses to hide/show Hide/Unhide actions based on those context values.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/tree/documentdb/IndexItem.ts | Adds contextValue tokens for default/hidden indexes and displays “hidden” in the tree item description. |
| package.json | Refines command visibility logic for Hide/Unhide Index using the new contextValue tokens. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Aligns with the single-axis-prefix naming convention used elsewhere in the tree (treeItem_*, experience_*). The state_* prefix scopes these as state modifiers rather than a node-kind axis, avoiding future collisions if other element types gain similar state flags.
Wrap the 'hidden' tree item description in vscode.l10n.t() so it is translatable. Regenerates l10n/bundle.l10n.json via npm run l10n.
|
Thanks for the contribution! I pushed two small follow-ups directly to your branch:
Reviewing the rest now. |
…rtual sub-tree item Replace showCreatingChild() with runWithTemporaryDescription() in the hide/unhide index commands. The previous approach inserted a phantom child node under the index while the operation was in flight, which was confusing. A temporary description on the index itself is clearer.
|
One more follow-up:
|
The parentheses are punctuation/formatting, not translatable content. Only the word itself goes through vscode.l10n.t().
|
Thanks @lte-z for another solid contribution! This is your second PR to the project I'm merging, and the quality is consistently good. The fix is well scoped and the when clause logic is correct. I pushed a few small follow-ups directly to your branch, all noted in the comments above. Once CI passes I'll approve and merge. Keep them coming! |
|
Thank you so much for merging this and for the detailed follow-up commits! The changes around Thanks again for the review and guidance! |
Fixes #656
Changes
This PR improves hidden index visibility and context menu behavior in the tree view.
Tree item updates
IndexItemcontext valueshiddendescription for hidden indexes in the tree viewContext menu updates
Updated menu
whenclauses so only valid actions are shown:_id_indexes show neither actionBehavior
Hidden indexes
hiddennext to the index name in the treeRegular indexes
_id_indexScreenshots
idindexRegular and hidden indexes
Notes
createContextValue()to compose index state context segments