Skip to content

feat: add interactive YAML ↔ JSON converter webview#448

Draft
hilleer wants to merge 5 commits intomainfrom
feat/interactive-converter-webview
Draft

feat: add interactive YAML ↔ JSON converter webview#448
hilleer wants to merge 5 commits intomainfrom
feat/interactive-converter-webview

Conversation

@hilleer
Copy link
Copy Markdown
Owner

@hilleer hilleer commented Mar 2, 2026

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

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
@hilleer hilleer requested a review from Copilot March 2, 2026 10:55
Copy link
Copy Markdown
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 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.interactiveConverter command 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 when clause. If the intent is to scope it to text editors (and/or YAML/JSON), add an appropriate when condition (e.g., editorTextFocus and/or resourceLangId == '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.

Comment thread src/onInteractiveConverter.ts Outdated
Comment thread src/onInteractiveConverter.ts Outdated
Comment thread src/onInteractiveConverter.ts Outdated
Comment thread src/onInteractiveConverter.ts Outdated
hilleer added 2 commits March 2, 2026 11:58
- 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
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.

2 participants