Browse Source

shows graph button always in commit details

main
Keith Daulton 2 years ago
parent
commit
1e2f6b46d0
2 changed files with 11 additions and 7 deletions
  1. +7
    -1
      src/plus/webviews/graph/graphWebview.ts
  2. +4
    -6
      src/webviews/apps/commitDetails/commitDetails.ts

+ 7
- 1
src/plus/webviews/graph/graphWebview.ts View File

@ -1346,10 +1346,13 @@ export class GraphWebview extends WebviewBase {
// If we have a set of data refresh to the same set
const limit = Math.max(defaultItemLimit, this._graph?.ids.size ?? defaultItemLimit);
const ref =
this._selectedId == null || this._selectedId === GitRevision.uncommitted ? 'HEAD' : this._selectedId;
const dataPromise = this.container.git.getCommitsForGraph(
this.repository.path,
this._panel!.webview.asWebviewUri.bind(this._panel!.webview),
{ limit: limit, ref: this._selectedId ?? 'HEAD' },
{ limit: limit, ref: ref },
);
// Check for GitLens+ access and working tree stats
@ -1448,6 +1451,9 @@ export class GraphWebview extends WebviewBase {
if (this._selectedId === id) return;
this._selectedId = id;
if (id === GitRevision.uncommitted) {
id = GitGraphRowType.Working;
}
this._selectedRows = id != null ? { [id]: true } : undefined;
}

+ 4
- 6
src/webviews/apps/commitDetails/commitDetails.ts View File

@ -268,15 +268,13 @@ export class CommitDetailsApp extends App> {
}
renderActions(state: CommitState) {
const isHiddenForUncommitted = state.selected?.sha === uncommittedSha ? 'true' : 'false';
for (const $el of document.querySelectorAll('[data-action-type="graph"],[data-action-type="more"]')) {
const isUncommitted = state.selected?.sha === uncommittedSha;
const isHiddenForUncommitted = isUncommitted.toString();
for (const $el of document.querySelectorAll('[data-action-type="sha"],[data-action-type="more"]')) {
$el.setAttribute('aria-hidden', isHiddenForUncommitted);
}
const isHiddenForCommitted = state.selected?.sha !== uncommittedSha ? 'true' : 'false';
for (const $el of document.querySelectorAll('[data-action-type="scm"]')) {
$el.setAttribute('aria-hidden', isHiddenForCommitted);
}
document.querySelector('[data-action-type="scm"]')?.setAttribute('aria-hidden', (!isUncommitted).toString());
}
renderPin(state: CommitState) {

Loading…
Cancel
Save