提交 79be22a9 编写于 作者: T t-amqi

Remove task panel experiment

上级 ce9eea1d
......@@ -86,87 +86,3 @@
.hc-black .monaco-workbench .quick-open-task-configure {
background-image: url('configure-inverse.svg');
}
/*
* Task Panel styles
*/
.task-panel-feedback-button {
width: 50px;
height: 50px;
display: inline-block;
vertical-align: middle;
}
.task-panel-no-telemetry.light {
background-image: url('thumbs-down.svg');
}
.task-panel-no-telemetry.dark {
background-image: url('thumbs-down-inverse.svg');
}
.task-panel-yes-telemetry.light {
background-image: url('thumbs-up.svg');
}
.task-panel-yes-telemetry.dark {
background-image: url('thumbs-up-inverse.svg');
}
.task-panel {
padding-left: 10px;
padding-right: 10px;
overflow-y: scroll;
}
.task-panel-container {
outline: grey dotted thin;
padding: 1px 17px;
margin: 10px auto 0px;
max-width: 800px;
}
.task-panel-example-item {
outline: grey solid thin;
padding-left: 5px;
padding-right: 5px;
padding: 1px;
margin-bottom: 10px;
}
.task-panel-mockup-button {
display: inline-block;
padding: 2px;
margin-right: 2px;
margin-left: 2px;
}
.task-panel-oneliner {
text-align: left;
margin: 10px;
}
.task-panel-right-aligned {
float: right;
/* cancel out 2px button padding */
margin-top: -2px;
}
.task-panel-centered {
text-align: center;
margin-top: 10px;
}
.task-panel-header-item {
font-size: 19px;
}
.task-panel-feedback {
font-size: smaller;
}
.task-panel-hidden {
display: none;
}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><style>.icon-canvas-transparent{opacity:0;fill:#2d2d30}.icon-vs-out{fill:#2d2d30}.icon-vs-bg{fill:#c5c5c5}.icon-vs-fg{fill:#2b282e}</style><path class="icon-canvas-transparent" d="M16 16H0V0h16v16z" id="canvas"/><path class="icon-vs-bg" d="M1.102 9.075c.068.16.163.298.284.417a1.338 1.338 0 0 0 .926.383h3.035c-.023.219-.067.43-.13.632a4.955 4.955 0 0 1-.232.598c-.159.328-.28.66-.362.995a4.427 4.427 0 0 0-.123 1.056c0 .15.028.292.086.424.057.132.135.248.235.349.101.1.217.179.349.236.132.057.273.085.424.085a.84.84 0 0 0 .417-.096c.114-.064.228-.153.342-.267l4.252-4.245c.21-.209.445-.369.708-.479.261-.108.54-.163.836-.163H15V2.875h-3.063c-.356 0-.698-.034-1.029-.103s-.66-.169-.988-.301A6.088 6.088 0 0 0 7.563 2h-3.5a1.28 1.28 0 0 0-.407.064 1.283 1.283 0 0 0-.646.465 1.412 1.412 0 0 0-.192.367l-1.75 5.25A1.284 1.284 0 0 0 1 8.563c0 .182.034.353.102.512zm.915-.613l1.75-5.25a.38.38 0 0 1 .051-.093c.087-.079.117-.094.157-.106L4.063 3h3.5a5.11 5.11 0 0 1 1.975.396c.394.158.784.276 1.169.356.395.082.81.123 1.231.123H14V8h-1.851a3.152 3.152 0 0 0-2.252.935s-4.047 4.435-4.36 4.338c-.153-.048-.005-.68.057-.936.065-.264.162-.531.29-.796.117-.252.211-.492.287-.736.084-.269.142-.547.171-.829l.113-1.102H2.313a.323.323 0 0 1-.291-.192A.294.294 0 0 1 2 8.563l.017-.101z" id="iconBg"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><style>.icon-canvas-transparent{opacity:0;fill:#f6f6f6}.icon-vs-out{fill:#f6f6f6}.icon-vs-bg{fill:#424242}.icon-vs-fg{fill:#f0eff1}</style><path class="icon-canvas-transparent" d="M16 16H0V0h16v16z" id="canvas"/><path class="icon-vs-bg" d="M1.102 9.075c.068.16.163.298.284.417a1.338 1.338 0 0 0 .926.383h3.035c-.023.219-.067.43-.13.632a4.955 4.955 0 0 1-.232.598c-.159.328-.28.66-.362.995a4.427 4.427 0 0 0-.123 1.056c0 .15.028.292.086.424.057.132.135.248.235.349.101.1.217.179.349.236.132.057.273.085.424.085a.84.84 0 0 0 .417-.096c.114-.064.228-.153.342-.267l4.252-4.245c.21-.209.445-.369.708-.479.261-.108.54-.163.836-.163H15V2.875h-3.063c-.356 0-.698-.034-1.029-.103s-.66-.169-.988-.301A6.088 6.088 0 0 0 7.563 2h-3.5a1.28 1.28 0 0 0-.407.064 1.283 1.283 0 0 0-.646.465 1.412 1.412 0 0 0-.192.367l-1.75 5.25A1.284 1.284 0 0 0 1 8.563c0 .182.034.353.102.512zm.915-.613l1.75-5.25a.38.38 0 0 1 .051-.093c.087-.079.117-.094.157-.106L4.063 3h3.5a5.11 5.11 0 0 1 1.975.396c.394.158.784.276 1.169.356.395.082.81.123 1.231.123H14V8h-1.851a3.152 3.152 0 0 0-2.252.935s-4.047 4.435-4.36 4.338c-.153-.048-.005-.68.057-.936.065-.264.162-.531.29-.796.117-.252.211-.492.287-.736.084-.269.142-.547.171-.829l.113-1.102H2.313a.323.323 0 0 1-.291-.192A.294.294 0 0 1 2 8.563l.017-.101z" id="iconBg"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><style>.icon-canvas-transparent{opacity:0;fill:#2d2d30}.icon-vs-out{fill:#2d2d30}.icon-vs-bg{fill:#c5c5c5}.icon-vs-fg{fill:#2b282e}</style><path class="icon-canvas-transparent" d="M16 16H0V0h16v16z" id="canvas"/><path class="icon-vs-bg" d="M14.898 6.925a1.281 1.281 0 0 0-.284-.417 1.338 1.338 0 0 0-.926-.383h-3.035c.023-.219.066-.43.13-.632.064-.203.142-.402.232-.598.159-.328.28-.66.362-.995.082-.335.123-.687.123-1.056 0-.15-.028-.292-.086-.424a1.112 1.112 0 0 0-.584-.585 1.06 1.06 0 0 0-.424-.085.84.84 0 0 0-.417.096 1.646 1.646 0 0 0-.342.266L5.396 6.357c-.21.21-.446.37-.708.479A2.157 2.157 0 0 1 3.851 7H1v6.125h3.063c.355 0 .698.034 1.029.102.331.068.66.169.988.301A6.072 6.072 0 0 0 8.438 14h3.5c.142 0 .277-.021.406-.064a1.283 1.283 0 0 0 .646-.465c.082-.112.146-.234.191-.366l1.75-5.25c.046-.133.069-.272.069-.417a1.29 1.29 0 0 0-.102-.513zm-.915.613l-1.75 5.25a.398.398 0 0 1-.051.093c-.088.079-.118.094-.157.106l-.087.013h-3.5a5.11 5.11 0 0 1-1.975-.396 6.953 6.953 0 0 0-1.169-.356 6.083 6.083 0 0 0-1.231-.123H2V8h1.851a3.152 3.152 0 0 0 2.252-.936s4.047-4.435 4.36-4.338c.153.048.005.68-.057.936a4.01 4.01 0 0 1-.29.796 5.7 5.7 0 0 0-.288.736 4.297 4.297 0 0 0-.171.829l-.113 1.102h4.144c.042 0 .077.007.111.021.045.02.082.043.111.073a.292.292 0 0 1 .09.219l-.017.1z" id="iconBg"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><style>.icon-canvas-transparent{opacity:0;fill:#f6f6f6}.icon-vs-out{fill:#f6f6f6}.icon-vs-bg{fill:#424242}.icon-vs-fg{fill:#f0eff1}</style><path class="icon-canvas-transparent" d="M16 16H0V0h16v16z" id="canvas"/><path class="icon-vs-bg" d="M14.898 6.925a1.281 1.281 0 0 0-.284-.417 1.338 1.338 0 0 0-.926-.383h-3.035c.023-.219.066-.43.13-.632.064-.203.142-.402.232-.598.159-.328.28-.66.362-.995.082-.335.123-.687.123-1.056 0-.15-.028-.292-.086-.424a1.112 1.112 0 0 0-.584-.585 1.06 1.06 0 0 0-.424-.085.84.84 0 0 0-.417.096 1.646 1.646 0 0 0-.342.266L5.396 6.357c-.21.21-.446.37-.708.479A2.157 2.157 0 0 1 3.851 7H1v6.125h3.063c.355 0 .698.034 1.029.102.331.068.66.169.988.301A6.072 6.072 0 0 0 8.438 14h3.5c.142 0 .277-.021.406-.064a1.283 1.283 0 0 0 .646-.465c.082-.112.146-.234.191-.366l1.75-5.25c.046-.133.069-.272.069-.417a1.29 1.29 0 0 0-.102-.513zm-.915.613l-1.75 5.25a.398.398 0 0 1-.051.093c-.088.079-.118.094-.157.106l-.087.013h-3.5a5.11 5.11 0 0 1-1.975-.396 6.953 6.953 0 0 0-1.169-.356 6.083 6.083 0 0 0-1.231-.123H2V8h1.851a3.152 3.152 0 0 0 2.252-.936s4.047-4.435 4.36-4.338c.153.048.005.68-.057.936a4.01 4.01 0 0 1-.29.796 5.7 5.7 0 0 0-.288.736 4.297 4.297 0 0 0-.171.829l-.113 1.102h4.144c.042 0 .077.007.111.021.045.02.082.043.111.073a.292.292 0 0 1 .09.219l-.017.1z" id="iconBg"/></svg>
\ No newline at end of file
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vs/nls';
import dom = require('vs/base/browser/dom');
import URI from 'vs/base/common/uri';
import { Builder, Dimension } from 'vs/base/browser/builder';
import { Panel, PanelRegistry, PanelDescriptor, Extensions } from 'vs/workbench/browser/panel';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IThemeService, ITheme, DARK, HIGH_CONTRAST, LIGHT } from 'vs/platform/theme/common/themeService';
import { ITaskService } from 'vs/workbench/parts/tasks/common/taskService';
import { Registry } from 'vs/platform/registry/common/platform';
import { TPromise } from 'vs/base/common/winjs.base';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { buttonBackground, buttonForeground, textLinkForeground, selectBackground } from 'vs/platform/theme/common/colorRegistry';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { IOpenerService } from 'vs/platform/opener/common/opener';
const TASK_PANEL_ID = 'workbench.panel.task';
export class TaskPanel extends Panel {
private taskExperimentPart5 = 'workbench.tasks.feedbackAnswered';
private _builder: Builder;
constructor(
@ITelemetryService telemetryService: ITelemetryService,
@IThemeService protected themeService: IThemeService,
@ITaskService private taskService: ITaskService,
@IInstantiationService private _instantiationService: IInstantiationService,
@ICommandService private commandService: ICommandService,
@IStorageService private storageService: IStorageService,
@IOpenerService private openerService: IOpenerService,
) {
super(TASK_PANEL_ID, telemetryService, themeService);
}
public create(parent: Builder): TPromise<any> {
super.create(parent);
dom.addClass(parent.getHTMLElement(), 'task-panel');
this._builder = parent.innerHtml(getHtml());
const yesButton = this._builder.select('.task-panel-yes-telemetry');
const noButton = this._builder.select('.task-panel-no-telemetry');
const githubLink = this._builder.select('.task-panel-linkstyle');
const clickFeedback = this._builder.select('.task-panel-header-item');
const thanks = this._builder.select('.task-panel-thanks');
if (this.storageService.get(this.taskExperimentPart5)) {
clickFeedback.addClass('task-panel-hidden');
thanks.removeClass('task-panel-hidden');
}
yesButton.on('click', e => {
if (!this.storageService.get(this.taskExperimentPart5)) {
this.telemetryService.publicLog('taskPanel.yes');
this.storageService.store(this.taskExperimentPart5, true, StorageScope.GLOBAL);
}
clickFeedback.addClass('task-panel-hidden');
thanks.removeClass('task-panel-hidden');
});
noButton.on('click', e => {
if (!this.storageService.get(this.taskExperimentPart5)) {
this.telemetryService.publicLog('taskPanel.no');
this.storageService.store(this.taskExperimentPart5, true, StorageScope.GLOBAL);
}
clickFeedback.addClass('task-panel-hidden');
thanks.removeClass('task-panel-hidden');
});
githubLink.on('click', e => {
const node = event.target as HTMLAnchorElement;
if (node.href) {
this.openerService.open(URI.parse(node.href));
}
});
this._register(this.themeService.onThemeChange(theme => this._updateTheme(theme)));
this._updateTheme();
return TPromise.as(void 0);
}
public layout(dimension?: Dimension): void { }
private _updateTheme(theme?: ITheme): void {
const githubLink = this._builder.select('.task-panel-linkstyle');
const buttons = this._builder.select('.task-panel-mockup-button');
const taskItems = this._builder.select('.task-panel-example-item');
const thumbButtons = this._builder.select('.task-panel-feedback-button');
if (!theme) {
theme = this.themeService.getTheme();
}
if (theme.getColor(buttonBackground)) {
buttons.style('background-color', theme.getColor(buttonBackground).toString());
} else {
buttons.style('background-color', null);
}
buttons.style('color', theme.getColor(buttonForeground).toString());
githubLink.style('color', theme.getColor(textLinkForeground).toString());
taskItems.style('background-color', theme.getColor(selectBackground).toString());
if ((theme.type === DARK || theme.type === HIGH_CONTRAST) && thumbButtons.hasClass('light')) {
thumbButtons.removeClass('light');
thumbButtons.addClass('dark');
} else if (theme.type === LIGHT && thumbButtons.hasClass('dark')) {
thumbButtons.removeClass('dark');
thumbButtons.addClass('light');
}
}
}
(<PanelRegistry>Registry.as(Extensions.Panels)).registerPanel(new PanelDescriptor(
'vs/workbench/parts/tasks/electron-browser/taskPanel',
'TaskPanel',
TASK_PANEL_ID,
nls.localize('tasks', "Tasks"),
'task',
50
));
function getHtml() {
return `
<div class="task-panel-container">
<p> We're thinking of adding a task panel in this space. If you would like to learn more about how to use tasks, click <a class="task-panel-linkstyle" href="https://code.visualstudio.com/docs/editor/tasks">here</a>.</p>
<p> Some things you might be able to do here: </br>
<ul>
<li> See a list of autodetected and manually configured tasks </li>
<li> Run/Restart/Stop tasks with a click of a button</li>
<li> Show a summary of each completed task (ie: execution time, exit code, foldable output)</li>
<li> Configure a task without touching the json file </li>
</ul></p>
<p> Here's a rough idea of what a task item might look like. By no means is this the final layout so please do not judge the look.</p>
<div class="task-panel-example-item">
<p class="task-panel-oneliner"> Task1: tsc -watch <span class="task-panel-right-aligned"> Running (0 Errors)&nbsp;
<span class="task-panel-mockup-button">Show Output</span><span class="task-panel-mockup-button">Stop</span><span class="task-panel-mockup-button">Restart</span></span>
</p>
</div>
<p class="task-panel-feedback"> If you are interested in further discussion or have feedback of your own, please see the github issue
<a class="task-panel-linkstyle" href="https://github.com/Microsoft/vscode/issues/28235"> here</a>.
</p>
</div>
<div class="task-panel-text">
<div class="task-panel-header-item task-panel-centered">Do you like the idea of a task panel?
<span class="task-panel-feedback-button task-panel-yes-telemetry light"></span>
<span class="task-panel-feedback-button task-panel-no-telemetry light"></span>
</div>
<div class="task-panel-header-item task-panel-centered task-panel-thanks task-panel-hidden"> Thanks for the feedback! <3 </div>
</div>
`;
};
\ No newline at end of file
......@@ -79,7 +79,6 @@ import 'vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.c
import 'vs/workbench/parts/relauncher/electron-browser/relauncher.contribution';
import 'vs/workbench/parts/tasks/electron-browser/task.contribution';
import 'vs/workbench/parts/tasks/electron-browser/taskPanel'; // can be packaged separately
import 'vs/workbench/parts/emmet/browser/emmet.browser.contribution';
import 'vs/workbench/parts/emmet/electron-browser/emmet.contribution';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册