Skip to content

Commit 0c4ce0f

Browse files
committed
Add mechanism for setting custom titles while fetching
Use it to display "Fetching <branch name>"
1 parent beb1f6f commit 0c4ce0f

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

app/src/lib/stores/app-store.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,8 @@ export class AppStore extends TypedBaseStore<IAppState> {
775775

776776
private showChangesFilter: boolean = false
777777

778+
private overrideProgressTitle: string | null = null
779+
778780
private selectedCopilotModels: CopilotModelSelections = {}
779781
private copilotModels: ReadonlyArray<ModelInfo> | null = null
780782
private byokProviders: ReadonlyArray<IBYOKProvider> = []
@@ -5757,6 +5759,13 @@ export class AppStore extends TypedBaseStore<IAppState> {
57575759
repository: Repository,
57585760
pushPullFetchProgress: Progress | null
57595761
) {
5762+
if (pushPullFetchProgress && this.overrideProgressTitle) {
5763+
pushPullFetchProgress = {
5764+
...pushPullFetchProgress,
5765+
title: this.overrideProgressTitle,
5766+
}
5767+
}
5768+
57605769
this.repositoryStateCache.update(repository, () => ({
57615770
pushPullFetchProgress,
57625771
}))
@@ -6618,6 +6627,7 @@ export class AppStore extends TypedBaseStore<IAppState> {
66186627
if (branch.upstream === null || branch.isGone) {
66196628
throw new Error(`The branch '${branch.name}' has not been published yet.`)
66206629
}
6630+
this.overrideProgressTitle = `Fetching ${branch.name}`
66216631
await this._fetch(repository, FetchType.UserInitiatedTask)
66226632
const stillDifferingBranches = await getBranchesDifferingFromUpstream(
66236633
repository
@@ -6708,6 +6718,7 @@ export class AppStore extends TypedBaseStore<IAppState> {
67086718

67096719
await this._refreshRepository(repository)
67106720
} finally {
6721+
this.overrideProgressTitle = null
67116722
this.updatePushPullFetchProgress(repository, null)
67126723

67136724
if (fetchType === FetchType.UserInitiatedTask) {

0 commit comments

Comments
 (0)