Skip to content

Commit eff9a4d

Browse files
committed
feat(vscode-extension): add new wireframe button to status bar
1 parent cfee516 commit eff9a4d

5 files changed

Lines changed: 37 additions & 0 deletions

File tree

packages/vscode-extension/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { registerCommands } from '#commands';
22
import { onAppUrlChange, syncAppUrlFile } from '#core';
33
import { QuickMockEditorProvider } from '#editor';
44
import { setupMcp } from '#mcp';
5+
import { registerStatusBarItems } from '#status-bar';
56
import * as vscode from 'vscode';
67

78
export const activate = (context: vscode.ExtensionContext) => {
@@ -10,6 +11,7 @@ export const activate = (context: vscode.ExtensionContext) => {
1011
context.subscriptions.push(QuickMockEditorProvider.register(context));
1112
setupMcp(context);
1213
registerCommands(context);
14+
registerStatusBarItems(context);
1315
};
1416

1517
export const deactivate = () => {};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './new-wireframe';
2+
export * from './register';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './new-wireframe.status-bar';
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { QUICKMOCK_NEW_WIREFRAME_COMMAND_ID } from '#commands';
2+
import * as vscode from 'vscode';
3+
4+
const STATUS_BAR_PRIORITY = 100;
5+
6+
export const registerNewWireframeStatusBarItem = (
7+
context: vscode.ExtensionContext
8+
): void => {
9+
const item = vscode.window.createStatusBarItem(
10+
vscode.StatusBarAlignment.Left,
11+
STATUS_BAR_PRIORITY
12+
);
13+
item.text = '$(lightbulb) Quickmock';
14+
item.tooltip = 'Create new Quickmock wireframe';
15+
item.color = '#309a8a';
16+
item.command = QUICKMOCK_NEW_WIREFRAME_COMMAND_ID;
17+
item.show();
18+
19+
context.subscriptions.push(item);
20+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import * as vscode from 'vscode';
2+
import { registerNewWireframeStatusBarItem } from './new-wireframe';
3+
4+
/**
5+
* Registers all VS Code status bar items exposed by the extension.
6+
* @param context The VS Code extension context.
7+
*/
8+
export const registerStatusBarItems = (
9+
context: vscode.ExtensionContext
10+
): void => {
11+
registerNewWireframeStatusBarItem(context);
12+
};

0 commit comments

Comments
 (0)