Skip to content

Commit 6e5fd71

Browse files
committed
Removes workspaces code
1 parent 452a2d9 commit 6e5fd71

File tree

21 files changed

+44
-822
lines changed

21 files changed

+44
-822
lines changed

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"onWebviewPanel:gitlens.welcome",
6868
"onWebviewPanel:gitlens.settings",
6969
"onWebviewPanel:gitlens.graph",
70-
"onWebviewPanel:gitlens.workspaces",
70+
"onWebviewPanel:gitlens.focus",
7171
"onCommand:gitlens.plus.learn",
7272
"onCommand:gitlens.plus.loginOrSignUp",
7373
"onCommand:gitlens.plus.logout",
@@ -76,7 +76,7 @@
7676
"onCommand:gitlens.plus.purchase",
7777
"onCommand:gitlens.getStarted",
7878
"onCommand:gitlens.showGraphPage",
79-
"onCommand:gitlens.showWorkspacesPage",
79+
"onCommand:gitlens.showFocusPage",
8080
"onCommand:gitlens.showSettingsPage",
8181
"onCommand:gitlens.showSettingsPage#views",
8282
"onCommand:gitlens.showSettingsPage#autolinks",
@@ -4487,7 +4487,7 @@
44874487
"icon": "$(gitlens-graph)"
44884488
},
44894489
{
4490-
"command": "gitlens.showWorkspacesPage",
4490+
"command": "gitlens.showFocusPage",
44914491
"title": "Show Focus View",
44924492
"category": "GitLens+",
44934493
"icon": "$(layers)"
@@ -6864,7 +6864,7 @@
68646864
"icon": "$(copy)"
68656865
},
68666866
{
6867-
"command": "gitlens.workspaces.refresh",
6867+
"command": "gitlens.focus.refresh",
68686868
"title": "Refresh",
68696869
"category": "GitLens",
68706870
"icon": "$(refresh)"
@@ -7424,7 +7424,7 @@
74247424
"when": "false"
74257425
},
74267426
{
7427-
"command": "gitlens.showWorkspacesPage",
7427+
"command": "gitlens.showFocusPage",
74287428
"when": "gitlens:enabled"
74297429
},
74307430
{
@@ -9036,7 +9036,7 @@
90369036
"when": "false"
90379037
},
90389038
{
9039-
"command": "gitlens.workspaces.refresh",
9039+
"command": "gitlens.focus.refresh",
90409040
"when": "false"
90419041
},
90429042
{
@@ -9470,8 +9470,8 @@
94709470
"group": "navigation@-98"
94719471
},
94729472
{
9473-
"command": "gitlens.workspaces.refresh",
9474-
"when": "gitlens:workspaces:focused",
9473+
"command": "gitlens.focus.refresh",
9474+
"when": "gitlens:focus:focused",
94759475
"group": "navigation@-98"
94769476
}
94779477
],

src/constants.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export const enum Commands {
184184
PlusValidate = 'gitlens.plus.validate',
185185
QuickOpenFileHistory = 'gitlens.quickOpenFileHistory',
186186
RefreshGraph = 'gitlens.graph.refresh',
187-
RefreshWorkspaces = 'gitlens.workspaces.refresh',
187+
RefreshFocus = 'gitlens.focus.refresh',
188188
RefreshHover = 'gitlens.refreshHover',
189189
RefreshTimelinePage = 'gitlens.refreshTimelinePage',
190190
ResetAvatarCache = 'gitlens.resetAvatarCache',
@@ -241,7 +241,7 @@ export const enum Commands {
241241
ShowTimelineView = 'gitlens.showTimelineView',
242242
ShowGraphPage = 'gitlens.showGraphPage',
243243
ShowWelcomePage = 'gitlens.showWelcomePage',
244-
ShowWorkspacesPage = 'gitlens.showWorkspacesPage',
244+
ShowFocusPage = 'gitlens.showFocusPage',
245245
StashApply = 'gitlens.stashApply',
246246
StashSave = 'gitlens.stashSave',
247247
StashSaveFiles = 'gitlens.stashSaveFiles',
@@ -285,7 +285,7 @@ export const enum ContextKeys {
285285
DisabledToggleCodeLens = 'gitlens:disabledToggleCodeLens',
286286
Disabled = 'gitlens:disabled',
287287
Enabled = 'gitlens:enabled',
288-
WorkspacesFocused = 'gitlens:workspaces:focused',
288+
FocusFocused = 'gitlens:focus:focused',
289289
HasConnectedRemotes = 'gitlens:hasConnectedRemotes',
290290
HasRemotes = 'gitlens:hasRemotes',
291291
HasRichRemotes = 'gitlens:hasRichRemotes',

src/container.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ import { IntegrationAuthenticationService } from './plus/integrationAuthenticati
2323
import { SubscriptionAuthenticationProvider } from './plus/subscription/authenticationProvider';
2424
import { ServerConnection } from './plus/subscription/serverConnection';
2525
import { SubscriptionService } from './plus/subscription/subscriptionService';
26+
import { FocusWebview } from './plus/webviews/focus/focusWebview';
2627
import { GraphWebview } from './plus/webviews/graph/graphWebview';
2728
import { TimelineWebview } from './plus/webviews/timeline/timelineWebview';
2829
import { TimelineWebviewView } from './plus/webviews/timeline/timelineWebviewView';
29-
import { WorkspacesWebview } from './plus/webviews/workspaces/workspacesWebview';
30-
import { WorkspacesApi } from './plus/workspaces/workspaces';
3130
import { StatusBarController } from './statusbar/statusBarController';
3231
import type { Storage } from './storage';
3332
import { executeCommand } from './system/command';
@@ -176,7 +175,6 @@ export class Container {
176175
(this._subscriptionAuthentication = new SubscriptionAuthenticationProvider(this, server)),
177176
);
178177
context.subscriptions.push((this._subscription = new SubscriptionService(this, previousVersion)));
179-
context.subscriptions.push((this._workspaces = new WorkspacesApi(this, server)));
180178

181179
context.subscriptions.push((this._git = new GitProviderService(this)));
182180
context.subscriptions.push(new GitFileSystemProvider(this));
@@ -203,7 +201,7 @@ export class Container {
203201
context.subscriptions.push((this._welcomeWebview = new WelcomeWebview(this)));
204202
context.subscriptions.push((this._rebaseEditor = new RebaseEditorProvider(this)));
205203
context.subscriptions.push((this._graphWebview = new GraphWebview(this)));
206-
context.subscriptions.push((this._workspacesWebview = new WorkspacesWebview(this)));
204+
context.subscriptions.push((this._focusWebview = new FocusWebview(this)));
207205

208206
context.subscriptions.push(new ViewFileDecorationProvider());
209207

@@ -532,11 +530,6 @@ export class Container {
532530
return this._searchAndCompareView;
533531
}
534532

535-
private _workspaces: WorkspacesApi;
536-
get workspaces() {
537-
return this._workspaces;
538-
}
539-
540533
private _subscription: SubscriptionService;
541534
get subscription() {
542535
return this._subscription;
@@ -557,9 +550,9 @@ export class Container {
557550
return this._graphWebview;
558551
}
559552

560-
private _workspacesWebview: WorkspacesWebview;
561-
get workspacesWebview() {
562-
return this._workspacesWebview;
553+
private _focusWebview: FocusWebview;
554+
get focusWebview() {
555+
return this._focusWebview;
563556
}
564557

565558
private _stashesView: StashesView | undefined;

src/git/remotes/richRemoteProvider.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ export abstract class RichRemoteProvider extends RemoteProvider {
7979
}
8080

8181
protected _session: AuthenticationSession | null | undefined;
82-
// TODO: exposing this is rough approach for workspaces
83-
session() {
82+
protected session() {
8483
if (this._session === undefined) {
8584
return this.ensureSession(false);
8685
}

src/plus/webviews/workspaces/workspacesWebview.ts renamed to src/plus/webviews/focus/focusWebview.ts

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ interface RepoWithRichRemote {
3131
isGitHub: boolean;
3232
}
3333

34-
export class WorkspacesWebview extends WebviewBase<State> {
34+
export class FocusWebview extends WebviewBase<State> {
3535
private _bootstrapping = true;
3636
private _pullRequests: SearchedPullRequest[] = [];
3737
private _issues: SearchedIssue[] = [];
@@ -42,32 +42,32 @@ export class WorkspacesWebview extends WebviewBase<State> {
4242
constructor(container: Container) {
4343
super(
4444
container,
45-
'gitlens.workspaces',
46-
'workspaces.html',
45+
'gitlens.focus',
46+
'focus.html',
4747
'images/gitlens-icon.png',
4848
'Focus View',
49-
`${ContextKeys.WebviewPrefix}workspaces`,
50-
'workspacesWebview',
51-
Commands.ShowWorkspacesPage,
49+
`${ContextKeys.WebviewPrefix}focus`,
50+
'focusWebview',
51+
Commands.ShowFocusPage,
5252
);
5353

5454
this.disposables.push(this.container.subscription.onDidChange(this.onSubscriptionChanged, this));
5555
this.disposables.push(this.container.git.onDidChangeRepositories(() => void this.refresh(true)));
5656
}
5757

5858
protected override registerCommands(): Disposable[] {
59-
return [registerCommand(Commands.RefreshWorkspaces, () => this.refresh(true))];
59+
return [registerCommand(Commands.RefreshFocus, () => this.refresh(true))];
6060
}
6161

6262
protected override onFocusChanged(focused: boolean): void {
6363
if (focused) {
6464
// If we are becoming focused, delay it a bit to give the UI time to update
65-
setTimeout(() => void setContext(ContextKeys.WorkspacesFocused, focused), 0);
65+
setTimeout(() => void setContext(ContextKeys.FocusFocused, focused), 0);
6666

6767
return;
6868
}
6969

70-
void setContext(ContextKeys.WorkspacesFocused, focused);
70+
void setContext(ContextKeys.FocusFocused, focused);
7171
}
7272

7373
private async onSubscriptionChanged(e: SubscriptionChangeEvent) {
@@ -86,17 +86,6 @@ export class WorkspacesWebview extends WebviewBase<State> {
8686
});
8787
}
8888

89-
private async getWorkspaces() {
90-
try {
91-
const rsp = await this.container.workspaces.getWorkspacesWithPullRequests();
92-
console.log(rsp);
93-
} catch (ex) {
94-
console.log(ex);
95-
}
96-
97-
return {};
98-
}
99-
10089
private async getSubscription(subscription?: Subscription) {
10190
const currentSubscription = subscription ?? (await this.container.subscription.getSubscription(true));
10291
const isPlus = ![
File renamed without changes.

0 commit comments

Comments
 (0)