-
Notifications
You must be signed in to change notification settings - Fork 94
feat: add document actions to data browsing - edit, copy, clone, delete VSCODE-729 #1239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| `Are you sure you want to run this code generated by the MongoDB participant against ${name}?`, | ||
| { | ||
| modal: true, | ||
| detail: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a drive-by I updated all these to put the extra text as detail so it is not just a narrow sea of text. I went looking for a way to make these modals wider because an object id typically does not fit in the width by 1 character. And this is all I found. Still makes these look a little bit better, though.
9c2e8b8 to
2a0a599
Compare
| const documentLabel = document._id | ||
| ? JSON.stringify(document._id) | ||
| : `Document ${documentIndexInTree + 1}`; | ||
| : `"Document ${documentIndexInTree + 1}"`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a drive-by I removed the double "" around the text that's usually JSON.stringified and therefore already has "" around it, but then in this case I had to add it back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds “document actions” (edit/copy/clone/delete) to data browsing cards in the webview and wires them through to existing extension behaviors (editor open, playground clone, delete + refresh).
Changes:
- Added new webview ↔ extension message types and handlers for edit/clone/delete.
- Implemented an action bar UI in the Monaco document card (with clipboard copy).
- Updated/added tests around the new messaging and controller handlers.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/views/dataBrowsingController.ts | Handles new webview commands for edit/clone/delete and triggers explorer/webview refresh on delete |
| src/views/data-browsing-app/vscode-api.ts | Adds new helper functions to post edit/clone/delete commands to the extension |
| src/views/data-browsing-app/store/messageHandler.ts | Refreshes documents when DOCUMENT_DELETED is received |
| src/views/data-browsing-app/monaco-viewer.tsx | Adds hover action bar buttons (edit/copy/clone/delete) to document cards |
| src/views/data-browsing-app/extension-app-message-constants.ts | Defines new message constants and typings for the new commands |
| src/mdbExtensionController.ts | Injects additional controllers into DataBrowsingController |
| src/explorer/documentTreeItem.ts | Tweaks document label and confirmation dialog text/details |
| src/editors/playgroundController.ts | Moves confirmation “can be disabled” text into modal detail |
| src/documentSource.ts | Adds databrowser as a document source |
| src/test/suite/views/dataBrowsingController.test.ts | Adds tests for edit/clone/delete handlers |
| src/test/suite/views/data-browsing-app/vscode-api.test.tsx | Adds tests for new vscode-api message senders |
| src/test/suite/views/data-browsing-app/monaco-viewer.test.tsx | Adds tests for the new action bar UI and interactions |
| src/test/suite/views/data-browsing-app/messageHandler.test.tsx | Adds test ensuring refresh is requested on DOCUMENT_DELETED |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
VSCODE-729
This adds document actions to data browsing when hovering over the cards - edit, copy, clone, delete. They just do the same thing as the corresponding tree view actions from without the feature flag.

