Преглед на файлове

Fixes changes column default visibility

- Updates commit graph header context menu options to use default column settings when a column doesn't exist in storage

- Updates graph state (to load in changes) when unhiding the Changes column
main
Ramin Tadayon преди 1 година
родител
ревизия
d876911363
No known key found for this signature in database GPG ключ ID: 5B90E918AEBCE7A7
променени са 1 файла, в които са добавени 15 реда и са изтрити 10 реда
  1. +15
    -10
      src/plus/webviews/graph/graphWebview.ts

+ 15
- 10
src/plus/webviews/graph/graphWebview.ts Целия файл

@ -1225,9 +1225,10 @@ export class GraphWebview extends WebviewBase {
}
const columns = this.getColumns();
const columnSettings = this.getColumnSettings(columns);
return this.notify(DidChangeColumnsNotificationType, {
columns: this.getColumnSettings(columns),
context: this.getColumnHeaderContext(columns),
columns: columnSettings,
context: this.getColumnHeaderContext(columnSettings),
});
}
@ -1631,13 +1632,11 @@ export class GraphWebview extends WebviewBase {
return columnsSettings;
}
private getColumnHeaderContext(columns: Record<GraphColumnName, GraphColumnConfig> | undefined): string {
private getColumnHeaderContext(columnSettings: GraphColumnsSettings): string {
const hidden: string[] = [];
if (columns != null) {
for (const [name, cfg] of Object.entries(columns)) {
if (cfg.isHidden) {
hidden.push(name);
}
for (const [name, settings] of Object.entries(columnSettings)) {
if (settings.isHidden) {
hidden.push(name);
}
}
return serializeWebviewItemContext<GraphItemContext>({
@ -1784,7 +1783,9 @@ export class GraphWebview extends WebviewBase {
this.repository.path,
this._panel!.webview.asWebviewUri.bind(this._panel!.webview),
{
include: { stats: configuration.get('graph.experimental.minimap.enabled') || !columnSettings.changes.isHidden },
include: {
stats: configuration.get('graph.experimental.minimap.enabled') || !columnSettings.changes.isHidden,
},
limit: limit,
ref: ref,
},
@ -1841,7 +1842,7 @@ export class GraphWebview extends WebviewBase {
columns: columnSettings,
config: this.getComponentConfig(),
context: {
header: this.getColumnHeaderContext(columns),
header: this.getColumnHeaderContext(columnSettings),
},
excludeRefs: data != null ? this.getExcludedRefs(data) ?? {} : {},
excludeTypes: this.getExcludedTypes(data) ?? {},
@ -2502,6 +2503,10 @@ export class GraphWebview extends WebviewBase {
await this.container.storage.storeWorkspace('graph:columns', columns);
void this.notifyDidChangeColumns();
if (name === 'changes' && !column.isHidden && !this._graph?.includes?.stats) {
this.updateState();
}
}
private getGraphItemRef(item?: GraphItemContext | unknown | undefined): GitReference | undefined;

Зареждане…
Отказ
Запис