Skip to content

Feature/#840 integrate new file functionality#844

Merged
manudous merged 4 commits into
devfrom
feature/#840-integrate-new-file-functionality
May 12, 2026
Merged

Feature/#840 integrate new file functionality#844
manudous merged 4 commits into
devfrom
feature/#840-integrate-new-file-functionality

Conversation

@Ivanruii

Copy link
Copy Markdown
Collaborator

Closes #840

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements the “New File” workflow for the QuickMock VS Code extension by making the toolbar New button trigger a command that creates a real .qm file on disk, then opens it in the custom editor (closing #840).

Changes:

  • Added a new qm:new-file bridge message and wired the web toolbar New button to send it when running inside VS Code.
  • Implemented quickmock.newWireframe to prompt for a save location, write an initial .qm template, and open it via vscode.openWith.
  • Added a shared template helper for generating the initial QuickMock file content.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/vscode-extension/src/editor/template.ts Adds initial .qm file content template + constants.
packages/vscode-extension/src/editor/index.ts Re-exports the new template module.
packages/vscode-extension/src/editor/handlers.ts Handles NEW_FILE app message by executing the VS Code command.
packages/vscode-extension/src/commands/new-wireframe/new-wireframe.id.ts Defines the command ID constant.
packages/vscode-extension/src/commands/new-wireframe/new-wireframe.handler.ts Implements the “Create QuickMock File” workflow (save dialog → write → open).
packages/vscode-extension/src/commands/new-wireframe/new-wireframe.command.ts Registers the new wireframe command.
packages/vscode-extension/src/commands/new-wireframe/index.ts Barrel exports for the new-wireframe command module.
packages/vscode-extension/src/commands/new-wireframe.ts Removes the old placeholder implementation.
packages/bridge-protocol/src/model.ts Extends AppMessage union to include NEW_FILE.
packages/bridge-protocol/src/constant.ts Adds APP_MESSAGE_TYPE.NEW_FILE.
apps/web/src/pods/toolbar/components/new-button/new-button.tsx Sends NEW_FILE to the extension when in VS Code; otherwise clears the canvas.
.changeset/wise-hornets-post.md Documents the behavior change for the VS Code extension workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +9 to +13
{
version: TEMPLATE_VERSION,
pages: [{ id: 'page-1', name: 'Page 1', shapes: [] }],
customColors: [],
size: DEFAULT_CANVAS_SIZE,
Comment on lines +26 to +33
export const handleNewWireframe = async (): Promise<void> => {
const target = await pickSaveTarget();
if (!target) return;

try {
await writeFile(target, createEmptyQuickMockContent());
} catch (error) {
const message = error instanceof Error ? error.message : 'Unknown error';
@manudous manudous self-requested a review May 12, 2026 07:44
@manudous manudous merged commit 937f09a into dev May 12, 2026
3 checks passed
@manudous manudous deleted the feature/#840-integrate-new-file-functionality branch May 12, 2026 07:54
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.

[VSCode Extension] Integrate new file functionality

3 participants