feat: add interactive YAML ↔ JSON converter webview#448
Draft
feat: add interactive YAML ↔ JSON converter webview#448
Conversation
Opens a persistent split-pane webview panel for converting arbitrary YAML/JSON content without needing a file on disk. Features include: - Pre-population from the active editor (JSON/YAML files) - Real-time debounced conversion (300ms) - Swap, Clear, Copy, and Save As buttons - Inline error display using VS Code CSS variables - Singleton panel that re-populates from the active editor on re-invoke - Editor title bar button (arrow-swap icon) and command palette entry
…feat/interactive-converter-webview
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a persistent, interactive YAML ↔ JSON converter webview panel to the extension, with editor pre-population and common utility actions.
Changes:
- Introduces a singleton split-pane webview for real-time YAML/JSON conversion (debounced), with Swap/Clear/Copy/Save As actions.
- Registers a new
extension.interactiveConvertercommand and exposes it via the command palette and editor title bar. - Updates README with usage/docs and new demo media for the interactive converter.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/onInteractiveConverter.ts | Implements the interactive converter webview panel, message handling, and Save As / clipboard integration. |
| src/extension.ts | Registers the new interactive converter command. |
| package.json | Contributes the new command to the command palette and editor title bar menu. |
| README.md | Documents the new interactive converter and adds demo assets/sections. |
Comments suppressed due to low confidence (1)
package.json:147
- This editor title button will appear broadly in editor contexts because there is no
whenclause. If the intent is to scope it to text editors (and/or YAML/JSON), add an appropriatewhencondition (e.g.,editorTextFocusand/orresourceLangId == 'yaml' || resourceLangId == 'json' || resourceLangId == 'jsonc') to reduce UI clutter.
"editor/title": [
{
"command": "extension.interactiveConverter",
"group": "navigation"
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Resolve README.md merge conflict: keep interactive converter bullet, use main's overview gif placement and comment preservation wording - detectDirection: use JSON.parse try/catch instead of startsWith check - saveAs: omit defaultUri when no workspace folder instead of Uri.file() - writeFile: use TextEncoder instead of Buffer.from for portability - error display: use textContent instead of innerHTML + escapeHtml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opens a persistent split-pane webview panel for converting arbitrary YAML/JSON content without needing a file on disk. Features include: