Skip to content

Conversation

@lerouxb
Copy link
Contributor

@lerouxb lerouxb commented Feb 10, 2026

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.
Screenshot 2026-02-10 at 13 00 44
Screenshot 2026-02-10 at 13 00 06

`Are you sure you want to run this code generated by the MongoDB participant against ${name}?`,
{
modal: true,
detail:
Copy link
Contributor Author

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.

@lerouxb lerouxb force-pushed the document-card-crud-operations branch from 9c2e8b8 to 2a0a599 Compare February 10, 2026 12:57
const documentLabel = document._id
? JSON.stringify(document._id)
: `Document ${documentIndexInTree + 1}`;
: `"Document ${documentIndexInTree + 1}"`;
Copy link
Contributor Author

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.

@lerouxb lerouxb marked this pull request as ready for review February 10, 2026 15:55
@lerouxb lerouxb requested a review from a team as a code owner February 10, 2026 15:55
Copilot AI review requested due to automatic review settings February 10, 2026 15:55
Copy link
Contributor

Copilot AI left a 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.

lerouxb and others added 5 commits February 10, 2026 16:01
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>
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.

1 participant