diff --git a/src/views/nodes/fileHistoryNode.ts b/src/views/nodes/fileHistoryNode.ts index 9745279..56a5aaa 100644 --- a/src/views/nodes/fileHistoryNode.ts +++ b/src/views/nodes/fileHistoryNode.ts @@ -77,6 +77,14 @@ export class FileHistoryNode extends SubscribeableViewNode implements PageableVi } } + this.view.titleContext = `${this.uri.fileName}${ + this.uri.sha + ? ` ${this.uri.sha === GitRevision.deletedOrMissing ? this.uri.shortSha : `(${this.uri.shortSha})`}` + : '' + }`; + + void this.ensureSubscription(); + if (children.length === 0) return [new MessageNode(this.view, this, 'No file history could be found.')]; return children; } @@ -96,6 +104,12 @@ export class FileHistoryNode extends SubscribeableViewNode implements PageableVi this.uri.sha == null ? '' : `\n\n${this.uri.sha}` }`; + this.view.titleContext = `${this.uri.fileName}${ + this.uri.sha + ? ` ${this.uri.sha === GitRevision.deletedOrMissing ? this.uri.shortSha : `(${this.uri.shortSha})`}` + : '' + }`; + void this.ensureSubscription(); return item; @@ -122,7 +136,7 @@ export class FileHistoryNode extends SubscribeableViewNode implements PageableVi Logger.log(`FileHistoryNode.onRepoChanged(${e.changes.join()}); triggering node refresh`); - void this.triggerChange(); + void (this.parent ?? this).triggerChange(true); } private onRepoFileSystemChanged(e: RepositoryFileSystemChangeEvent) { @@ -132,7 +146,7 @@ export class FileHistoryNode extends SubscribeableViewNode implements PageableVi `FileHistoryNode${this.id}.onRepoFileSystemChanged(${this.uri.toString(true)}); triggering node refresh`, ); - void this.triggerChange(); + void (this.parent ?? this).triggerChange(true); } @gate() @@ -169,6 +183,9 @@ export class FileHistoryNode extends SubscribeableViewNode implements PageableVi this._log = log; this.limit = log?.count; - void this.triggerChange(false); + void (this.parent ?? this).triggerChange(false); + if (this.parent) { + this.view.triggerNodeChange(this.parent); + } } } diff --git a/src/views/nodes/fileHistoryTrackerNode.ts b/src/views/nodes/fileHistoryTrackerNode.ts index 3443b5d..ed30249 100644 --- a/src/views/nodes/fileHistoryTrackerNode.ts +++ b/src/views/nodes/fileHistoryTrackerNode.ts @@ -35,7 +35,7 @@ export class FileHistoryTrackerNode extends SubscribeableViewNode { if (this._child == null) { if (this._fileUri == null && this.uri === unknownGitUri) { return [ @@ -53,7 +53,7 @@ export class FileHistoryTrackerNode extends SubscribeableViewNode { if (this._child == null) { if (this.uri === unknownGitUri) { return [ @@ -59,7 +59,7 @@ export class LineHistoryTrackerNode extends SubscribeableViewNode