Skip to content

Commit

Permalink
serve/advanced: Review UI for now
Browse files Browse the repository at this point in the history
We're going to iterate on the UI and possibly combine with the simple view. This view was still using messages, so removing it cleans up a lot of old code paths.

Signed-off-by: Tyler Smalley <tyler@tailscale.com>
  • Loading branch information
tylersmalley committed Jun 7, 2023
1 parent ddbe013 commit 7345c43
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 459 deletions.
15 changes: 0 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,6 @@
{
"command": "tailscale.openAdminConsole",
"group": "overflow"
},
{
"command": "tailscale.advancedServeView",
"group": "overflow",
"when": "tailscale.viewType == 'simple' && tailscale.env == 'development'"
},
{
"command": "tailscale.simpleServeView",
"group": "overflow",
"when": "tailscale.viewType == 'advanced'"
}
]
},
Expand Down Expand Up @@ -164,11 +154,6 @@
"category": "tsdev",
"title": "Reload Serve Panel"
},
{
"command": "tailscale.advancedServeView",
"title": "Advanced View",
"category": "tsdev"
},
{
"command": "tailscale.simpleServeView",
"title": "Simple View",
Expand Down
14 changes: 0 additions & 14 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,6 @@ export async function activate(context: vscode.ExtensionContext) {
})
);

context.subscriptions.push(
vscode.commands.registerCommand('tailscale.advancedServeView', () => {
Logger.info('called tailscale.advancedServeView', 'command');
servePanelProvider.showAdvancedView();
})
);

context.subscriptions.push(
vscode.commands.registerCommand('tailscale.simpleServeView', () => {
Logger.info('called tailscale.simpleServeView', 'command');
servePanelProvider.showSimpleView();
})
);

context.subscriptions.push(
vscode.commands.registerCommand('tailscale.openFunnelPanel', () => {
vscode.commands.executeCommand('tailscale-serve-view.focus');
Expand Down
18 changes: 0 additions & 18 deletions src/serve-panel-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,6 @@ export class ServePanelProvider implements vscode.WebviewViewProvider {
});
}

public async showAdvancedView() {
this.postMessage({
type: 'showAdvancedView',
});
}

public async showSimpleView() {
this.postMessage({
type: 'showSimpleView',
});
}

resolveWebviewView(webviewView: vscode.WebviewView) {
this._view = webviewView;
webviewView.webview.html = this._getHtmlForWebview(webviewView.webview);
Expand Down Expand Up @@ -72,12 +60,6 @@ export class ServePanelProvider implements vscode.WebviewViewProvider {
break;
}

case 'setViewType': {
Logger.info('Called setViewType', 'serve-panel');
vscode.commands.executeCommand('setContext', 'tailscale.viewType', m.params.type);
break;
}

case 'setFunnel': {
Logger.info('Called setFunnel', 'serve-panel');
try {
Expand Down
25 changes: 1 addition & 24 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,6 @@ interface SetFunnel {
};
}

interface SetViewType {
type: 'setViewType';
params: {
type: 'simple' | 'advanced';
};
}

interface WriteToClipboard {
type: 'writeToClipboard';
params: {
Expand All @@ -124,7 +117,6 @@ export type Message =
| AddServe
| ResetServe
| SetFunnel
| SetViewType
| WriteToClipboard
| OpenLink;

Expand Down Expand Up @@ -153,22 +145,7 @@ interface WebpackStillOk {
type: 'webpackStillOk';
}

interface ShowAdvancedView {
type: 'showAdvancedView';
}

interface ShowSimpleView {
type: 'showSimpleView';
}

export type WebviewData =
| UpdateState
| RefreshState
| ShowAdvancedView
| ShowSimpleView
| WebpackOk
| WebpackInvalid
| WebpackStillOk;
export type WebviewData = UpdateState | RefreshState | WebpackOk | WebpackInvalid | WebpackStillOk;
export type WebviewEvent = Event & { data: WebviewData };

export interface NewPortNotification {
Expand Down
Loading

0 comments on commit 7345c43

Please sign in to comment.