Browse Source

Fixes broken context menu for Graph in a view

Refs #2537
main
Eric Amodio 1 year ago
parent
commit
2aace4b572
2 changed files with 8 additions and 4 deletions
  1. +4
    -2
      src/plus/webviews/graph/graphWebview.ts
  2. +4
    -2
      src/system/webview.ts

+ 4
- 2
src/plus/webviews/graph/graphWebview.ts View File

@ -2541,13 +2541,15 @@ function formatRepositories(repositories: Repository[]): GraphRepository[] {
function isGraphItemContext(item: unknown): item is GraphItemContext {
if (item == null) return false;
return isWebviewItemContext(item) && item.webview === 'gitlens.graph';
return isWebviewItemContext(item) && (item.webview === 'gitlens.graph' || item.webview === 'gitlens.views.graph');
}
function isGraphItemGroupContext(item: unknown): item is GraphItemGroupContext {
if (item == null) return false;
return isWebviewItemGroupContext(item) && item.webview === 'gitlens.graph';
return (
isWebviewItemGroupContext(item) && (item.webview === 'gitlens.graph' || item.webview === 'gitlens.views.graph')
);
}
function isGraphItemTypedContext(

+ 4
- 2
src/system/webview.ts View File

@ -1,5 +1,7 @@
import type { WebviewIds, WebviewViewIds } from '../constants';
export interface WebviewItemContext<TValue = unknown> {
webview?: string;
webview?: `gitlens.${WebviewIds}` | `gitlens.views.${WebviewViewIds}`;
webviewItem: string;
webviewItemValue: TValue;
}
@ -13,7 +15,7 @@ export function isWebviewItemContext(
}
export interface WebviewItemGroupContext<TValue = unknown> {
webview?: string;
webview?: `gitlens.${WebviewIds}` | `gitlens.views.${WebviewViewIds}`;
webviewItemGroup: string;
webviewItemGroupValue: TValue;
}

Loading…
Cancel
Save