|
@ -28,6 +28,7 @@ import type { |
|
|
} from '../../../commands'; |
|
|
} from '../../../commands'; |
|
|
import { parseCommandContext } from '../../../commands/base'; |
|
|
import { parseCommandContext } from '../../../commands/base'; |
|
|
import { GitActions } from '../../../commands/gitCommands.actions'; |
|
|
import { GitActions } from '../../../commands/gitCommands.actions'; |
|
|
|
|
|
import type { Config } from '../../../configuration'; |
|
|
import { configuration } from '../../../configuration'; |
|
|
import { configuration } from '../../../configuration'; |
|
|
import { Commands, ContextKeys, CoreGitCommands } from '../../../constants'; |
|
|
import { Commands, ContextKeys, CoreGitCommands } from '../../../constants'; |
|
|
import type { Container } from '../../../container'; |
|
|
import type { Container } from '../../../container'; |
|
@ -185,6 +186,7 @@ export class GraphWebview extends WebviewBase { |
|
|
|
|
|
|
|
|
private _etagSubscription?: number; |
|
|
private _etagSubscription?: number; |
|
|
private _etagRepository?: number; |
|
|
private _etagRepository?: number; |
|
|
|
|
|
private _firstSelection = true; |
|
|
private _graph?: GitGraph; |
|
|
private _graph?: GitGraph; |
|
|
private _pendingIpcNotifications = new Map<IpcNotificationType, IpcMessage | (() => Promise<boolean>)>(); |
|
|
private _pendingIpcNotifications = new Map<IpcNotificationType, IpcMessage | (() => Promise<boolean>)>(); |
|
|
private _refsMetadata: Map<string, GraphRefMetadata | null> | null | undefined; |
|
|
private _refsMetadata: Map<string, GraphRefMetadata | null> | null | undefined; |
|
@ -192,10 +194,10 @@ export class GraphWebview extends WebviewBase { |
|
|
private _searchCancellation: CancellationTokenSource | undefined; |
|
|
private _searchCancellation: CancellationTokenSource | undefined; |
|
|
private _selectedId?: string; |
|
|
private _selectedId?: string; |
|
|
private _selectedRows: GraphSelectedRows | undefined; |
|
|
private _selectedRows: GraphSelectedRows | undefined; |
|
|
private _repositoryEventsDisposable: Disposable | undefined; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private _showDetailsView: Config['graph']['showDetailsView']; |
|
|
private _statusBarItem: StatusBarItem | undefined; |
|
|
private _statusBarItem: StatusBarItem | undefined; |
|
|
private _theme: ColorTheme | undefined; |
|
|
private _theme: ColorTheme | undefined; |
|
|
|
|
|
private _repositoryEventsDisposable: Disposable | undefined; |
|
|
|
|
|
|
|
|
private previewBanner?: boolean; |
|
|
private previewBanner?: boolean; |
|
|
private trialBanner?: boolean; |
|
|
private trialBanner?: boolean; |
|
@ -210,6 +212,9 @@ export class GraphWebview extends WebviewBase { |
|
|
'graphWebview', |
|
|
'graphWebview', |
|
|
Commands.ShowGraphPage, |
|
|
Commands.ShowGraphPage, |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
this._showDetailsView = configuration.get('graph.showDetailsView'); |
|
|
|
|
|
|
|
|
this.disposables.push( |
|
|
this.disposables.push( |
|
|
configuration.onDidChange(this.onConfigurationChanged, this), |
|
|
configuration.onDidChange(this.onConfigurationChanged, this), |
|
|
once(container.onReady)(() => queueMicrotask(() => this.updateStatusBar())), |
|
|
once(container.onReady)(() => queueMicrotask(() => this.updateStatusBar())), |
|
@ -260,6 +265,7 @@ export class GraphWebview extends WebviewBase { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
override async show(options?: { column?: ViewColumn; preserveFocus?: boolean }, ...args: unknown[]): Promise<void> { |
|
|
override async show(options?: { column?: ViewColumn; preserveFocus?: boolean }, ...args: unknown[]): Promise<void> { |
|
|
|
|
|
this._firstSelection = true; |
|
|
if (!(await ensurePlusFeaturesEnabled())) return; |
|
|
if (!(await ensurePlusFeaturesEnabled())) return; |
|
|
|
|
|
|
|
|
if (this.container.git.repositoryCount > 1) { |
|
|
if (this.container.git.repositoryCount > 1) { |
|
@ -412,7 +418,11 @@ export class GraphWebview extends WebviewBase { |
|
|
setTimeout(() => void setContext(ContextKeys.GraphPageFocused, focused), 0); |
|
|
setTimeout(() => void setContext(ContextKeys.GraphPageFocused, focused), 0); |
|
|
|
|
|
|
|
|
if (this.selection != null) { |
|
|
if (this.selection != null) { |
|
|
void GitActions.Commit.showDetailsView(this.selection[0], { pin: true, preserveFocus: true }); |
|
|
|
|
|
|
|
|
void GitActions.Commit.showDetailsView(this.selection[0], { |
|
|
|
|
|
pin: true, |
|
|
|
|
|
preserveFocus: true, |
|
|
|
|
|
preserveVisibility: this._showDetailsView === false, |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return; |
|
|
return; |
|
@ -433,6 +443,10 @@ export class GraphWebview extends WebviewBase { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private onConfigurationChanged(e: ConfigurationChangeEvent) { |
|
|
private onConfigurationChanged(e: ConfigurationChangeEvent) { |
|
|
|
|
|
if (configuration.changed(e, 'graph.showDetailsView')) { |
|
|
|
|
|
this._showDetailsView = configuration.get('graph.showDetailsView'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (configuration.changed(e, 'graph.statusBar.enabled') || configuration.changed(e, 'plusFeatures.enabled')) { |
|
|
if (configuration.changed(e, 'graph.statusBar.enabled') || configuration.changed(e, 'plusFeatures.enabled')) { |
|
|
this.updateStatusBar(); |
|
|
this.updateStatusBar(); |
|
|
} |
|
|
} |
|
@ -812,7 +826,14 @@ export class GraphWebview extends WebviewBase { |
|
|
|
|
|
|
|
|
if (commits == null) return; |
|
|
if (commits == null) return; |
|
|
|
|
|
|
|
|
void GitActions.Commit.showDetailsView(commits[0], { pin: true, preserveFocus: true }); |
|
|
|
|
|
|
|
|
void GitActions.Commit.showDetailsView(commits[0], { |
|
|
|
|
|
pin: true, |
|
|
|
|
|
preserveFocus: true, |
|
|
|
|
|
preserveVisibility: this._firstSelection |
|
|
|
|
|
? this._showDetailsView === false |
|
|
|
|
|
: this._showDetailsView !== 'selection', |
|
|
|
|
|
}); |
|
|
|
|
|
this._firstSelection = false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private _notifyDidChangeStateDebounced: Deferrable<GraphWebview['notifyDidChangeState']> | undefined = undefined; |
|
|
private _notifyDidChangeStateDebounced: Deferrable<GraphWebview['notifyDidChangeState']> | undefined = undefined; |
|
|