Skip to content

Commit 65afa4d

Browse files
committed
Fixes view refresh when grouped
Fixes missing welcome views when grouped
1 parent efe0ab8 commit 65afa4d

File tree

3 files changed

+64
-2
lines changed

3 files changed

+64
-2
lines changed

package.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18761,54 +18761,109 @@
1876118761
"view": "gitlens.views.worktrees",
1876218762
"contents": "[Worktrees](https://help.gitkraken.com/gitlens/side-bar/#worktrees-view-pro) ᴾᴿᴼ — minimize context switching by allowing you to work on multiple branches simultaneously."
1876318763
},
18764+
{
18765+
"view": "gitlens.views.grouped",
18766+
"contents": "[Worktrees](https://help.gitkraken.com/gitlens/side-bar/#worktrees-view-pro) ᴾᴿᴼ — minimize context switching by allowing you to work on multiple branches simultaneously.",
18767+
"when": "!gitlens:hasVirtualFolders && gitlens:views:grouped:view == worktrees"
18768+
},
1876418769
{
1876518770
"view": "gitlens.views.worktrees",
1876618771
"contents": "[Create Worktree...](command:gitlens.views.createWorktree)",
1876718772
"when": "!gitlens:plus:required"
1876818773
},
18774+
{
18775+
"view": "gitlens.views.grouped",
18776+
"contents": "[Create Worktree...](command:gitlens.views.createWorktree)",
18777+
"when": "!gitlens:plus:required && gitlens:views:grouped:view == worktrees"
18778+
},
1876918779
{
1877018780
"view": "gitlens.views.worktrees",
1877118781
"contents": "[Resend Verification Email](command:gitlens.plus.resendVerification?%7B%22source%22%3A%22worktrees%22%7D)\n\nYou must verify your email before you can continue or [recheck Status](command:gitlens.plus.validate?%7B%22source%22%3A%22worktrees%22%7D).",
1877218782
"when": "gitlens:plus:state == -1"
1877318783
},
18784+
{
18785+
"view": "gitlens.views.grouped",
18786+
"contents": "[Resend Verification Email](command:gitlens.plus.resendVerification?%7B%22source%22%3A%22worktrees%22%7D)\n\nYou must verify your email before you can continue or [recheck Status](command:gitlens.plus.validate?%7B%22source%22%3A%22worktrees%22%7D).",
18787+
"when": "gitlens:plus:state == -1 && gitlens:views:grouped:view == worktrees"
18788+
},
1877418789
{
1877518790
"view": "gitlens.views.worktrees",
1877618791
"contents": "[Continue](command:gitlens.plus.startPreviewTrial?%7B%22source%22%3A%22worktrees%22%7D)\n\nContinuing gives you 3 days to preview Worktrees and other local Pro features for 3 days. [Start 7-day Pro trial](command:gitlens.plus.signUp?%7B%22source%22%3A%22worktrees%22%7D) or [sign in](command:gitlens.plus.login?%7B%22source%22%3A%22worktrees%22%7D) for full access to Pro features.",
1877718792
"when": "gitlens:plus:required && gitlens:plus:state == 0"
1877818793
},
18794+
{
18795+
"view": "gitlens.views.grouped",
18796+
"contents": "[Continue](command:gitlens.plus.startPreviewTrial?%7B%22source%22%3A%22worktrees%22%7D)\n\nContinuing gives you 3 days to preview Worktrees and other local Pro features for 3 days. [Start 7-day Pro trial](command:gitlens.plus.signUp?%7B%22source%22%3A%22worktrees%22%7D) or [sign in](command:gitlens.plus.login?%7B%22source%22%3A%22worktrees%22%7D) for full access to Pro features.",
18797+
"when": "gitlens:plus:required && gitlens:plus:state == 0 && gitlens:views:grouped:view == worktrees"
18798+
},
1877918799
{
1878018800
"view": "gitlens.views.worktrees",
1878118801
"contents": "[Start Pro Trial](command:gitlens.plus.signUp?%7B%22source%22%3A%22worktrees%22%7D)\n\nStart your free 7-day Pro trial to try Worktrees and other Pro features, or [sign in](command:gitlens.plus.login?%7B%22source%22%3A%22worktrees%22%7D).",
1878218802
"when": "gitlens:plus:required && gitlens:plus:state == 2"
1878318803
},
18804+
{
18805+
"view": "gitlens.views.grouped",
18806+
"contents": "[Start Pro Trial](command:gitlens.plus.signUp?%7B%22source%22%3A%22worktrees%22%7D)\n\nStart your free 7-day Pro trial to try Worktrees and other Pro features, or [sign in](command:gitlens.plus.login?%7B%22source%22%3A%22worktrees%22%7D).",
18807+
"when": "gitlens:plus:required && gitlens:plus:state == 2 && gitlens:views:grouped:view == worktrees"
18808+
},
1878418809
{
1878518810
"view": "gitlens.views.worktrees",
1878618811
"contents": "[Upgrade to Pro](command:gitlens.plus.upgrade?%7B%22source%22%3A%22worktrees%22%7D)",
1878718812
"when": "gitlens:plus:required && gitlens:plus:state == 4"
1878818813
},
18814+
{
18815+
"view": "gitlens.views.grouped",
18816+
"contents": "[Upgrade to Pro](command:gitlens.plus.upgrade?%7B%22source%22%3A%22worktrees%22%7D)",
18817+
"when": "gitlens:plus:required && gitlens:plus:state == 4 && gitlens:views:grouped:view == worktrees"
18818+
},
1878918819
{
1879018820
"view": "gitlens.views.worktrees",
1879118821
"contents": "Limited-time sale: Save 33% or more on your 1st seat of Pro.",
1879218822
"when": "gitlens:plus:required && gitlens:plus:state == 4 && (gitlens:promo == pro50 || !gitlens:promo)"
1879318823
},
18824+
{
18825+
"view": "gitlens.views.grouped",
18826+
"contents": "Limited-time sale: Save 33% or more on your 1st seat of Pro.",
18827+
"when": "gitlens:plus:required && gitlens:plus:state == 4 && (gitlens:promo == pro50 || !gitlens:promo) && gitlens:views:grouped:view == worktrees"
18828+
},
1879418829
{
1879518830
"view": "gitlens.views.worktrees",
1879618831
"contents": "Limited-time sale: Save up to 80% on GitLens Pro",
1879718832
"when": "gitlens:plus:required && gitlens:plus:state == 4 && gitlens:promo == devexdays"
1879818833
},
18834+
{
18835+
"view": "gitlens.views.grouped",
18836+
"contents": "Limited-time sale: Save up to 80% on GitLens Pro",
18837+
"when": "gitlens:plus:required && gitlens:plus:state == 4 && gitlens:promo == devexdays && gitlens:views:grouped:view == worktrees"
18838+
},
1879918839
{
1880018840
"view": "gitlens.views.worktrees",
1880118841
"contents": "Your Pro trial has ended. Please upgrade for full access to Worktrees and other Pro features.",
1880218842
"when": "gitlens:plus:required && gitlens:plus:state == 4"
1880318843
},
18844+
{
18845+
"view": "gitlens.views.grouped",
18846+
"contents": "Your Pro trial has ended. Please upgrade for full access to Worktrees and other Pro features.",
18847+
"when": "gitlens:plus:required && gitlens:plus:state == 4 && gitlens:views:grouped:view == worktrees"
18848+
},
1880418849
{
1880518850
"view": "gitlens.views.worktrees",
1880618851
"contents": "[Continue](command:gitlens.plus.reactivateProTrial?%7B%22source%22%3A%22worktrees%22%7D)\n\nReactivate your Pro trial and experience Worktrees and all the new Pro features — free for another 7 days!",
1880718852
"when": "gitlens:plus:required && gitlens:plus:state == 5"
1880818853
},
18854+
{
18855+
"view": "gitlens.views.grouped",
18856+
"contents": "[Continue](command:gitlens.plus.reactivateProTrial?%7B%22source%22%3A%22worktrees%22%7D)\n\nReactivate your Pro trial and experience Worktrees and all the new Pro features — free for another 7 days!",
18857+
"when": "gitlens:plus:required && gitlens:plus:state == 5 && gitlens:views:grouped:view == worktrees"
18858+
},
1880918859
{
1881018860
"view": "gitlens.views.worktrees",
1881118861
"contents": "Pro feature — requires a paid plan for use on privately-hosted repos."
18862+
},
18863+
{
18864+
"view": "gitlens.views.grouped",
18865+
"contents": "Pro feature — requires a paid plan for use on privately-hosted repos.",
18866+
"when": "gitlens:views:grouped:view == worktrees"
1881218867
}
1881318868
],
1881418869
"views": {

src/views/groupedView.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { Disposable } from 'vscode';
2+
import type { Commands } from '../constants.commands';
23
import type { GroupableTreeViewTypes } from '../constants.views';
34
import type { Container } from '../container';
4-
import { registerCommand } from '../system/vscode/command';
5+
import { executeCommand, registerCommand } from '../system/vscode/command';
56
import { setContext } from '../system/vscode/context';
67
import { BranchesView } from './branchesView';
78
import { CommitsView } from './commitsView';
@@ -33,7 +34,11 @@ export class GroupedView implements Disposable {
3334
private readonly included: GroupableTreeViewTypes[],
3435
) {
3536
this._disposable = Disposable.from(
36-
registerCommand('gitlens.views.grouped.refresh', () => this._view?.refresh()),
37+
registerCommand('gitlens.views.grouped.refresh', () => {
38+
if (this._view == null) return;
39+
40+
executeCommand(`gitlens.views.${this._view.type}.refresh` as Commands);
41+
}),
3742
registerCommand('gitlens.views.grouped.branches', () => this.setView('branches')),
3843
registerCommand('gitlens.views.grouped.commits', () => this.setView('commits')),
3944
registerCommand('gitlens.views.grouped.contributors', () => this.setView('contributors')),

src/views/viewBase.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ export abstract class ViewBase<
270270
dispose() {
271271
this._nodeState?.dispose();
272272
this._nodeState = undefined;
273+
this.root?.dispose();
273274
Disposable.from(...this.disposables).dispose();
274275
}
275276

@@ -402,6 +403,7 @@ export abstract class ViewBase<
402403

403404
protected ensureRoot(force: boolean = false) {
404405
if (this.root == null || force) {
406+
this.root?.dispose();
405407
this.root = this.getRoot();
406408
}
407409

0 commit comments

Comments
 (0)