Browse Source

Renames "tab" references to "Editor"

main
Eric Amodio 2 years ago
parent
commit
ead9dbe374
4 changed files with 15 additions and 15 deletions
  1. +3
    -3
      src/plus/webviews/timeline/timelineWebview.ts
  2. +1
    -1
      src/webviews/apps/plus/timeline/timeline.scss
  3. +1
    -1
      src/webviews/rebase/rebaseEditor.ts
  4. +10
    -10
      src/webviews/webviewController.ts

+ 3
- 3
src/plus/webviews/timeline/timelineWebview.ts View File

@ -55,7 +55,7 @@ export class TimelineWebviewProvider implements WebviewProvider {
this._context = { ...this._context, ...this._pendingContext };
this._pendingContext = undefined;
if (this.host.isTab()) {
if (this.host.isEditor()) {
this._disposable = Disposable.from(
this.container.subscription.onDidChange(this.onSubscriptionChanged, this),
this.container.git.onDidChangeRepository(this.onRepositoryChanged, this),
@ -107,7 +107,7 @@ export class TimelineWebviewProvider implements WebviewProvider {
}
registerCommands(): Disposable[] {
if (this.host.isTab()) {
if (this.host.isEditor()) {
return [registerCommand(Commands.RefreshTimelinePage, () => this.host.refresh(true))];
}
@ -265,7 +265,7 @@ export class TimelineWebviewProvider implements WebviewProvider {
}
const title = gitUri.relativePath;
if (this.host.isTab()) {
if (this.host.isEditor()) {
this.host.title = `${this.host.originalTitle}: ${gitUri.fileName}`;
} else {
this.host.description = gitUri.fileName;

+ 1
- 1
src/webviews/apps/plus/timeline/timeline.scss View File

@ -21,7 +21,7 @@ body {
overflow-x: scroll;
}
body[data-placement='tab'] {
body[data-placement='editor'] {
background-color: var(--color-background);
}

+ 1
- 1
src/webviews/rebase/rebaseEditor.ts View File

@ -602,7 +602,7 @@ export class RebaseEditorProvider implements CustomTextEditorProvider, Disposabl
getNonce(),
context.panel.webview.asWebviewUri(this.container.context.extensionUri).toString(),
context.panel.webview.asWebviewUri(webRootUri).toString(),
'tab',
'editor',
bootstrap,
);
return html;

+ 10
- 10
src/webviews/webviewController.ts View File

@ -153,8 +153,8 @@ export class WebviewController<
this.id = descriptor.id;
this.webview = parent.webview;
const isInTab = 'onDidChangeViewState' in parent;
this._isTab = isInTab;
const isInEditor = 'onDidChangeViewState' in parent;
this._isEditor = isInEditor;
this._originalTitle = descriptor.title;
parent.title = descriptor.title;
@ -163,7 +163,7 @@ export class WebviewController<
this.disposables.push(
window.onDidChangeWindowState(this.onWindowStateChanged, this),
parent.webview.onDidReceiveMessage(this.onMessageReceivedCore, this),
isInTab
isInEditor
? parent.onDidChangeViewState(this.onParentViewStateChanged, this)
: parent.onDidChangeVisibility(() => this.onParentVisibilityChanged(this.visible), this),
parent.onDidDispose(this.onParentDisposed, this),
@ -193,12 +193,12 @@ export class WebviewController<
this._initializing = undefined;
}
private _isTab: boolean;
isTab(): this is WebviewPanelController<State, SerializedState> {
return this._isTab;
private _isEditor: boolean;
isEditor(): this is WebviewPanelController<State, SerializedState> {
return this._isEditor;
}
isView(): this is WebviewViewController<State, SerializedState> {
return !this._isTab;
return !this._isEditor;
}
private _description: string | undefined;
@ -236,7 +236,7 @@ export class WebviewController<
options = {};
}
if (this.isTab()) {
if (this.isEditor()) {
const result = await this.provider.canShowWebviewPanel?.(firstTime, options, ...args);
if (result === false) return;
@ -422,7 +422,7 @@ export class WebviewController<
this._cspNonce,
this.asWebviewUri(this.getRootUri()).toString(),
this.getWebRoot(),
this.isTab() ? 'tab' : 'view',
this.isEditor() ? 'editor' : 'view',
bootstrap,
head,
body,
@ -471,7 +471,7 @@ export function replaceWebviewHtmlTokens(
cspNonce: string,
root: string,
webRoot: string,
placement: 'tab' | 'view',
placement: 'editor' | 'view',
bootstrap?: SerializedState,
head?: string,
body?: string,

||||||
x
 
000:0
Loading…
Cancel
Save