Bläddra i källkod

Removes workspaces code

main
Keith Daulton 1 år sedan
committed by Keith Daulton
förälder
incheckning
6e5fd719d1
33 ändrade filer med 2096 tillägg och 2874 borttagningar
  1. +8
    -8
      package.json
  2. +3
    -3
      src/constants.ts
  3. +5
    -12
      src/container.ts
  4. +1
    -2
      src/git/remotes/richRemoteProvider.ts
  5. +9
    -20
      src/plus/webviews/focus/focusWebview.ts
  6. +0
    -0
      src/plus/webviews/focus/protocol.ts
  7. +0
    -267
      src/plus/workspaces/models.ts
  8. +0
    -385
      src/plus/workspaces/workspaces.ts
  9. +1
    -1
      src/usageTracker.ts
  10. +0
    -0
      src/webviews/apps/plus/focus/components/git-avatars.ts
  11. +0
    -0
      src/webviews/apps/plus/focus/components/helpers.ts
  12. +0
    -0
      src/webviews/apps/plus/focus/components/issue-row.ts
  13. +0
    -0
      src/webviews/apps/plus/focus/components/plus-content.ts
  14. +0
    -0
      src/webviews/apps/plus/focus/components/pull-request-row.ts
  15. +0
    -0
      src/webviews/apps/plus/focus/components/workspace-item.ts
  16. +0
    -0
      src/webviews/apps/plus/focus/components/workspace-list.ts
  17. +6
    -109
      src/webviews/apps/plus/focus/focus.html
  18. +2
    -2
      src/webviews/apps/plus/focus/focus.scss
  19. +6
    -10
      src/webviews/apps/plus/focus/focus.ts
  20. +1
    -1
      src/webviews/webviewBase.ts
  21. +2
    -2
      webpack.config.js

+ 8
- 8
package.json Visa fil

@ -67,7 +67,7 @@
"onWebviewPanel:gitlens.welcome",
"onWebviewPanel:gitlens.settings",
"onWebviewPanel:gitlens.graph",
"onWebviewPanel:gitlens.workspaces",
"onWebviewPanel:gitlens.focus",
"onCommand:gitlens.plus.learn",
"onCommand:gitlens.plus.loginOrSignUp",
"onCommand:gitlens.plus.logout",
@ -76,7 +76,7 @@
"onCommand:gitlens.plus.purchase",
"onCommand:gitlens.getStarted",
"onCommand:gitlens.showGraphPage",
"onCommand:gitlens.showWorkspacesPage",
"onCommand:gitlens.showFocusPage",
"onCommand:gitlens.showSettingsPage",
"onCommand:gitlens.showSettingsPage#views",
"onCommand:gitlens.showSettingsPage#autolinks",
@ -4487,7 +4487,7 @@
"icon": "$(gitlens-graph)"
},
{
"command": "gitlens.showWorkspacesPage",
"command": "gitlens.showFocusPage",
"title": "Show Focus View",
"category": "GitLens+",
"icon": "$(layers)"
@ -6864,7 +6864,7 @@
"icon": "$(copy)"
},
{
"command": "gitlens.workspaces.refresh",
"command": "gitlens.focus.refresh",
"title": "Refresh",
"category": "GitLens",
"icon": "$(refresh)"
@ -7424,7 +7424,7 @@
"when": "false"
},
{
"command": "gitlens.showWorkspacesPage",
"command": "gitlens.showFocusPage",
"when": "gitlens:enabled"
},
{
@ -9036,7 +9036,7 @@
"when": "false"
},
{
"command": "gitlens.workspaces.refresh",
"command": "gitlens.focus.refresh",
"when": "false"
},
{
@ -9470,8 +9470,8 @@
"group": "navigation@-98"
},
{
"command": "gitlens.workspaces.refresh",
"when": "gitlens:workspaces:focused",
"command": "gitlens.focus.refresh",
"when": "gitlens:focus:focused",
"group": "navigation@-98"
}
],

+ 3
- 3
src/constants.ts Visa fil

@ -184,7 +184,7 @@ export const enum Commands {
PlusValidate = 'gitlens.plus.validate',
QuickOpenFileHistory = 'gitlens.quickOpenFileHistory',
RefreshGraph = 'gitlens.graph.refresh',
RefreshWorkspaces = 'gitlens.workspaces.refresh',
RefreshFocus = 'gitlens.focus.refresh',
RefreshHover = 'gitlens.refreshHover',
RefreshTimelinePage = 'gitlens.refreshTimelinePage',
ResetAvatarCache = 'gitlens.resetAvatarCache',
@ -241,7 +241,7 @@ export const enum Commands {
ShowTimelineView = 'gitlens.showTimelineView',
ShowGraphPage = 'gitlens.showGraphPage',
ShowWelcomePage = 'gitlens.showWelcomePage',
ShowWorkspacesPage = 'gitlens.showWorkspacesPage',
ShowFocusPage = 'gitlens.showFocusPage',
StashApply = 'gitlens.stashApply',
StashSave = 'gitlens.stashSave',
StashSaveFiles = 'gitlens.stashSaveFiles',
@ -285,7 +285,7 @@ export const enum ContextKeys {
DisabledToggleCodeLens = 'gitlens:disabledToggleCodeLens',
Disabled = 'gitlens:disabled',
Enabled = 'gitlens:enabled',
WorkspacesFocused = 'gitlens:workspaces:focused',
FocusFocused = 'gitlens:focus:focused',
HasConnectedRemotes = 'gitlens:hasConnectedRemotes',
HasRemotes = 'gitlens:hasRemotes',
HasRichRemotes = 'gitlens:hasRichRemotes',

+ 5
- 12
src/container.ts Visa fil

@ -23,11 +23,10 @@ import { IntegrationAuthenticationService } from './plus/integrationAuthenticati
import { SubscriptionAuthenticationProvider } from './plus/subscription/authenticationProvider';
import { ServerConnection } from './plus/subscription/serverConnection';
import { SubscriptionService } from './plus/subscription/subscriptionService';
import { FocusWebview } from './plus/webviews/focus/focusWebview';
import { GraphWebview } from './plus/webviews/graph/graphWebview';
import { TimelineWebview } from './plus/webviews/timeline/timelineWebview';
import { TimelineWebviewView } from './plus/webviews/timeline/timelineWebviewView';
import { WorkspacesWebview } from './plus/webviews/workspaces/workspacesWebview';
import { WorkspacesApi } from './plus/workspaces/workspaces';
import { StatusBarController } from './statusbar/statusBarController';
import type { Storage } from './storage';
import { executeCommand } from './system/command';
@ -176,7 +175,6 @@ export class Container {
(this._subscriptionAuthentication = new SubscriptionAuthenticationProvider(this, server)),
);
context.subscriptions.push((this._subscription = new SubscriptionService(this, previousVersion)));
context.subscriptions.push((this._workspaces = new WorkspacesApi(this, server)));
context.subscriptions.push((this._git = new GitProviderService(this)));
context.subscriptions.push(new GitFileSystemProvider(this));
@ -203,7 +201,7 @@ export class Container {
context.subscriptions.push((this._welcomeWebview = new WelcomeWebview(this)));
context.subscriptions.push((this._rebaseEditor = new RebaseEditorProvider(this)));
context.subscriptions.push((this._graphWebview = new GraphWebview(this)));
context.subscriptions.push((this._workspacesWebview = new WorkspacesWebview(this)));
context.subscriptions.push((this._focusWebview = new FocusWebview(this)));
context.subscriptions.push(new ViewFileDecorationProvider());
@ -532,11 +530,6 @@ export class Container {
return this._searchAndCompareView;
}
private _workspaces: WorkspacesApi;
get workspaces() {
return this._workspaces;
}
private _subscription: SubscriptionService;
get subscription() {
return this._subscription;
@ -557,9 +550,9 @@ export class Container {
return this._graphWebview;
}
private _workspacesWebview: WorkspacesWebview;
get workspacesWebview() {
return this._workspacesWebview;
private _focusWebview: FocusWebview;
get focusWebview() {
return this._focusWebview;
}
private _stashesView: StashesView | undefined;

+ 1
- 2
src/git/remotes/richRemoteProvider.ts Visa fil

@ -79,8 +79,7 @@ export abstract class RichRemoteProvider extends RemoteProvider {
}
protected _session: AuthenticationSession | null | undefined;
// TODO: exposing this is rough approach for workspaces
session() {
protected session() {
if (this._session === undefined) {
return this.ensureSession(false);
}

src/plus/webviews/workspaces/workspacesWebview.ts → src/plus/webviews/focus/focusWebview.ts Visa fil

@ -31,7 +31,7 @@ interface RepoWithRichRemote {
isGitHub: boolean;
}
export class WorkspacesWebview extends WebviewBase<State> {
export class FocusWebview extends WebviewBase<State> {
private _bootstrapping = true;
private _pullRequests: SearchedPullRequest[] = [];
private _issues: SearchedIssue[] = [];
@ -42,13 +42,13 @@ export class WorkspacesWebview extends WebviewBase {
constructor(container: Container) {
super(
container,
'gitlens.workspaces',
'workspaces.html',
'gitlens.focus',
'focus.html',
'images/gitlens-icon.png',
'Focus View',
`${ContextKeys.WebviewPrefix}workspaces`,
'workspacesWebview',
Commands.ShowWorkspacesPage,
`${ContextKeys.WebviewPrefix}focus`,
'focusWebview',
Commands.ShowFocusPage,
);
this.disposables.push(this.container.subscription.onDidChange(this.onSubscriptionChanged, this));
@ -56,18 +56,18 @@ export class WorkspacesWebview extends WebviewBase {
}
protected override registerCommands(): Disposable[] {
return [registerCommand(Commands.RefreshWorkspaces, () => this.refresh(true))];
return [registerCommand(Commands.RefreshFocus, () => this.refresh(true))];
}
protected override onFocusChanged(focused: boolean): void {
if (focused) {
// If we are becoming focused, delay it a bit to give the UI time to update
setTimeout(() => void setContext(ContextKeys.WorkspacesFocused, focused), 0);
setTimeout(() => void setContext(ContextKeys.FocusFocused, focused), 0);
return;
}
void setContext(ContextKeys.WorkspacesFocused, focused);
void setContext(ContextKeys.FocusFocused, focused);
}
private async onSubscriptionChanged(e: SubscriptionChangeEvent) {
@ -86,17 +86,6 @@ export class WorkspacesWebview extends WebviewBase {
});
}
private async getWorkspaces() {
try {
const rsp = await this.container.workspaces.getWorkspacesWithPullRequests();
console.log(rsp);
} catch (ex) {
console.log(ex);
}
return {};
}
private async getSubscription(subscription?: Subscription) {
const currentSubscription = subscription ?? (await this.container.subscription.getSubscription(true));
const isPlus = ![

src/plus/webviews/workspaces/protocol.ts → src/plus/webviews/focus/protocol.ts Visa fil


+ 0
- 267
src/plus/workspaces/models.ts Visa fil

@ -1,267 +0,0 @@
export type WorkspaceProvider =
| 'GITHUB'
| 'GITHUB_ENTERPRISE'
| 'GITLAB'
| 'GITLAB_SELF_HOSTED'
| 'BITBUCKET'
| 'AZURE';
export interface Workspace {
id: string;
name: string;
description: string;
type: WorkspaceType;
icon_url: string;
host_url: string;
status: string;
provider: string;
azure_organization_id: string;
azure_project: string;
created_date: Date;
updated_date: Date;
created_by: string;
updated_by: string;
members: WorkspaceMember[];
organization: WorkspaceOrganization;
issue_tracker: WorkspaceIssueTracker;
settings: WorkspaceSettings;
current_user: UserWorkspaceSettings;
errors: string[];
provider_data: ProviderWorkspaceData;
}
export type WorkspaceType = 'GK_PROJECT' | 'GK_ORG_VELOCITY' | 'GK_CLI';
export interface WorkspaceMember {
id: string;
role: string;
name: string;
username: string;
avatar_url: string;
}
interface WorkspaceOrganization {
id: string;
team_ids: string[];
}
interface WorkspaceIssueTracker {
provider: string;
settings: WorkspaceIssueTrackerSettings;
}
interface WorkspaceIssueTrackerSettings {
resource_id: string;
}
interface WorkspaceSettings {
gkOrgVelocity: GKOrgVelocitySettings;
goals: ProjectGoalsSettings;
}
type GKOrgVelocitySettings = Record<string, unknown>;
type ProjectGoalsSettings = Record<string, unknown>;
interface UserWorkspaceSettings {
project_id: string;
user_id: string;
tab_settings: UserWorkspaceTabSettings;
}
interface UserWorkspaceTabSettings {
issue_tracker: WorkspaceIssueTracker;
}
export interface ProviderWorkspaceData {
id: string;
provider_organization_id: string;
repository: Repository;
repositories: Repository[];
pull_requests: PullRequest[];
issues: Issue[];
repository_members: RepositoryMember[];
milestones: Milestone[];
labels: Label[];
issue_types: IssueType[];
provider_identity: ProviderIdentity;
metrics: Metrics;
}
type Metrics = Record<string, unknown>;
interface ProviderIdentity {
avatar_url: string;
id: string;
name: string;
username: string;
pat_organization: string;
is_using_pat: boolean;
scopes: string;
}
export interface Branch {
id: string;
node_id: string;
name: string;
commit: BranchCommit;
}
interface BranchCommit {
id: string;
url: string;
build_status: {
context: string;
state: string;
description: string;
};
}
export interface Repository {
id: string;
name: string;
description: string;
repository_id: string;
provider: string;
provider_organization_id: string;
provider_organization_name: string;
url: string;
default_branch: string;
branches: Branch[];
pull_requests: PullRequest[];
issues: Issue[];
members: RepositoryMember[];
milestones: Milestone[];
labels: Label[];
issue_types: IssueType[];
possibly_deleted: boolean;
has_webhook: boolean;
}
interface RepositoryMember {
avatar_url: string;
name: string;
node_id: string;
username: string;
}
type Milestone = Record<string, unknown>;
type Label = Record<string, unknown>;
type IssueType = Record<string, unknown>;
export interface PullRequest {
id: string;
node_id: string;
number: string;
title: string;
description: string;
url: string;
milestone_id: string;
labels: Label[];
author_id: string;
author_username: string;
created_date: Date;
updated_date: Date;
closed_date: Date;
merged_date: Date;
first_commit_date: Date;
first_response_date: Date;
comment_count: number;
repository: Repository;
head_commit: {
id: string;
url: string;
build_status: {
context: string;
state: string;
description: string;
};
};
lifecycle_stages: {
stage: string;
start_date: Date;
end_date: Date;
}[];
reviews: PullRequestReviews[];
head: {
name: string;
};
}
interface PullRequestReviews {
user_id: string;
avatar_url: string;
state: string;
}
export interface Issue {
id: string;
node_id: string;
title: string;
author_id: string;
assignee_ids: string[];
milestone_id: string;
label_ids: string[];
issue_type: string;
url: string;
created_date: Date;
updated_date: Date;
comment_count: number;
repository: Repository;
}
interface Connection<i> {
total_count: number;
page_info: {
start_cursor: string;
end_cursor: string;
has_next_page: boolean;
};
nodes: i[];
}
interface FetchedConnection<i> extends Connection<i> {
is_fetching: boolean;
}
export interface WorkspacesResponse {
data: {
projects: Connection<Workspace>;
};
}
export interface PullRequestsResponse {
data: {
project: {
provider_data: {
pull_requests: FetchedConnection<PullRequest>;
};
};
};
}
export interface WorkspacesWithPullRequestsResponse {
data: {
projects: {
nodes: {
provider_data: {
pull_requests: FetchedConnection<PullRequest>;
};
}[];
};
};
errors?: {
message: string;
path: unknown[];
statusCode: number;
}[];
}
export interface IssuesResponse {
data: {
project: {
provider_data: {
issues: FetchedConnection<Issue>;
};
};
};
}

+ 0
- 385
src/plus/workspaces/workspaces.ts Visa fil

@ -1,385 +0,0 @@
import type { AuthenticationSession, Disposable } from 'vscode';
import type { RequestInit } from '@env/fetch';
import type { Container } from '../../container';
import type { GitRemote } from '../../git/models/remote';
import type { RichRemoteProvider } from '../../git/remotes/richRemoteProvider';
import { Logger } from '../../logger';
import type { ServerConnection } from '../subscription/serverConnection';
import type {
IssuesResponse,
PullRequestsResponse,
Workspace,
WorkspaceProvider,
WorkspacesResponse,
WorkspacesWithPullRequestsResponse,
} from './models';
export class WorkspacesApi implements Disposable {
// private _disposable: Disposable;
constructor(private readonly container: Container, private readonly server: ServerConnection) {}
dispose(): void {
// this._disposable?.dispose();
}
private async getAccessToken() {
// TODO: should probably get scopes from somewhere
const sessions = await this.container.subscriptionAuthentication.getSessions(['gitlens']);
if (!sessions.length) {
return;
}
const session = sessions[0];
return session.accessToken;
}
private async getRichProviders(): Promise<GitRemote<RichRemoteProvider>[]> {
const remotes: GitRemote<RichRemoteProvider>[] = [];
for (const repo of this.container.git.openRepositories) {
const richRemote = await repo.getRichRemote(true);
if (richRemote == null || remotes.includes(richRemote)) {
continue;
}
remotes.push(richRemote);
}
return remotes;
}
private async getRichProvider(): Promise<GitRemote<RichRemoteProvider> | undefined> {
const remotes = await this.getRichProviders();
if (remotes.length === 0) {
return undefined;
}
return remotes[0];
}
private async getRichProviderSession(): Promise<AuthenticationSession | undefined> {
const remote = await this.getRichProvider();
let session = remote?.provider.session();
if (session == null) {
return undefined;
}
if ((session as Promise<AuthenticationSession | undefined>).then != null) {
session = await session;
}
return session;
}
private async getProviderCredentials(_type: WorkspaceProvider) {
const session = await this.getRichProviderSession();
if (session == null) return undefined;
// TODO: get tokens from Providers
// let token;
// switch (type) {
// case 'GITHUB':
// token = { access_token: session.accessToken, is_pat: false };
// break;
// }
const token = { github: { access_token: session.accessToken, is_pat: false } };
return Promise.resolve(token);
}
async getWorkspaces(): Promise<WorkspacesResponse | undefined> {
const accessToken = await this.getAccessToken();
if (accessToken == null) {
return;
}
const rsp = await this.server.fetchGraphql(
{
query: `
query getWorkspaces {
projects(first: 100) {
total_count
page_info {
start_cursor
has_next_page
end_cursor
}
nodes {
id
name
provider
}
}
}
`,
},
accessToken,
);
if (!rsp.ok) {
Logger.error(undefined, `Getting workspaces failed: (${rsp.status}) ${rsp.statusText}`);
throw new Error(rsp.statusText);
}
const json: WorkspacesResponse | undefined = await rsp.json();
return json;
}
async getPullRequests(workspace: Workspace): Promise<PullRequestsResponse | undefined> {
const accessToken = await this.getAccessToken();
if (accessToken == null) {
return;
}
const query = `
query getPullRequestsForWorkspace(
$workspaceId: String
) {
project(id: $workspaceId) {
provider
provider_data {
pull_requests(first: 100) {
nodes {
id
title
number
author_username
comment_count
created_date
repository {
id
name
provider_organization_id
}
head_commit {
build_status {
context
state
description
}
}
head {
name
}
url
}
is_fetching
page_info {
end_cursor
has_next_page
}
}
}
}
}
`;
const init: RequestInit = {};
const externalTokens = await this.getProviderCredentials(workspace.provider.toUpperCase() as WorkspaceProvider);
if (externalTokens != null) {
init.headers = {
'External-Tokens': JSON.stringify(externalTokens),
};
}
const rsp = await this.server.fetchGraphql(
{
query: query,
variables: {
workspaceId: workspace.id,
},
},
accessToken,
init,
);
if (!rsp.ok) {
Logger.error(undefined, `Getting pull requests failed: (${rsp.status}) ${rsp.statusText}`);
throw new Error(rsp.statusText);
}
let json: PullRequestsResponse | undefined = await rsp.json();
if (json?.data.project.provider_data.pull_requests.is_fetching === true) {
await new Promise(resolve => setTimeout(resolve, 200));
json = await this.getPullRequests(workspace);
}
return json;
}
async getIssues(workspace: Workspace): Promise<IssuesResponse | undefined> {
const accessToken = await this.getAccessToken();
if (accessToken == null) {
return;
}
const query = `
query getIssuesForWorkspace($projectId: String) {
project(id: $projectId) {
provider
provider_data {
issues(first: 100) {
nodes {
id
title
assignee_ids
author_id
comment_count
created_date
issue_type
label_ids
node_id
repository {
id
name
provider_organization_id
}
updated_date
milestone_id
url
}
is_fetching
page_info {
end_cursor
has_next_page
}
}
}
}
}
`;
const init: RequestInit = {};
const externalTokens = await this.getProviderCredentials(workspace.provider.toUpperCase() as WorkspaceProvider);
if (externalTokens != null) {
init.headers = {
'External-Tokens': JSON.stringify(externalTokens),
};
}
const rsp = await this.server.fetchGraphql(
{
query: query,
variables: {
workspaceId: workspace.id,
},
},
accessToken,
init,
);
if (!rsp.ok) {
Logger.error(undefined, `Getting pull requests failed: (${rsp.status}) ${rsp.statusText}`);
throw new Error(rsp.statusText);
}
let json: IssuesResponse | undefined = await rsp.json();
if (json?.data.project.provider_data.issues.is_fetching === true) {
await new Promise(resolve => setTimeout(resolve, 200));
json = await this.getIssues(workspace);
}
return json;
}
async getWorkspacesWithPullRequests(): Promise<WorkspacesWithPullRequestsResponse | undefined> {
const accessToken = await this.getAccessToken();
if (accessToken == null) {
return;
}
const query = `
query getPullRequestsForAllWorkspaces {
projects(first: 100) {
total_count
page_info {
start_cursor
has_next_page
end_cursor
}
nodes {
id
name
provider
provider_data {
pull_requests(first: 100) {
nodes {
id
title
number
author_username
comment_count
created_date
repository {
id
name
provider_organization_id
}
head_commit {
build_status {
context
state
description
}
}
head {
name
}
url
}
is_fetching
page_info {
end_cursor
has_next_page
}
total_count
}
}
}
}
}
`;
const init: RequestInit = {};
const externalTokens = await this.getProviderCredentials('github' as WorkspaceProvider);
if (externalTokens != null) {
init.headers = {
'External-Tokens': JSON.stringify(externalTokens),
};
}
const rsp = await this.server.fetchGraphql(
{
query: query,
},
accessToken,
init,
);
if (!rsp.ok) {
Logger.error(undefined, `Getting pull requests failed: (${rsp.status}) ${rsp.statusText}`);
throw new Error(rsp.statusText);
}
let json: WorkspacesWithPullRequestsResponse | undefined = await rsp.json();
if (json?.errors != null && json.errors.length > 0) {
const error = json.errors[0];
Logger.error(undefined, `Getting pull requests failed: (${error.statusCode}) ${error.message}`);
throw new Error(error.message);
}
if (json?.data.projects.nodes[0].provider_data.pull_requests.is_fetching === true) {
await new Promise(resolve => setTimeout(resolve, 200));
json = await this.getWorkspacesWithPullRequests();
}
return json;
}
async createWorkspace(): Promise<void> {}
async ensureWorkspace(): Promise<void> {}
}

+ 1
- 1
src/usageTracker.ts Visa fil

@ -30,7 +30,7 @@ export type TrackedUsageFeatures =
| 'timelineView'
| 'welcomeWebview'
| 'workspaceView'
| 'workspacesWebview';
| 'focusWebview';
export type TrackedUsageKeys = `${TrackedUsageFeatures}:shown`;
export type UsageChangeEvent = {

src/webviews/apps/plus/workspaces/components/git-avatars.ts → src/webviews/apps/plus/focus/components/git-avatars.ts Visa fil


src/webviews/apps/plus/workspaces/components/helpers.ts → src/webviews/apps/plus/focus/components/helpers.ts Visa fil


src/webviews/apps/plus/workspaces/components/issue-row.ts → src/webviews/apps/plus/focus/components/issue-row.ts Visa fil


src/webviews/apps/plus/workspaces/components/plus-content.ts → src/webviews/apps/plus/focus/components/plus-content.ts Visa fil


src/webviews/apps/plus/workspaces/components/pull-request-row.ts → src/webviews/apps/plus/focus/components/pull-request-row.ts Visa fil


src/webviews/apps/plus/workspaces/components/workspace-item.ts → src/webviews/apps/plus/focus/components/workspace-item.ts Visa fil


src/webviews/apps/plus/workspaces/components/workspace-list.ts → src/webviews/apps/plus/focus/components/workspace-list.ts Visa fil


src/webviews/apps/plus/workspaces/workspaces.html → src/webviews/apps/plus/focus/focus.html Visa fil

@ -13,8 +13,8 @@
<div class="app__content" id="content">
<div class="app__cover"></div>
<main class="app__main">
<section class="workspace-section app__section">
<header class="workspace-section__header">
<section class="focus-section app__section">
<header class="focus-section__header">
<h2>My Pull Requests</h2>
<nav class="tab-filter" id="pr-filter">
<button class="tab-filter__tab is-active" type="button" data-tab="">All</button>
@ -26,7 +26,7 @@
<button class="tab-filter__tab" type="button" data-tab="mentioned">Mentions Me</button>
</nav>
</header>
<div class="workspace-section__content">
<div class="focus-section__content">
<table-container id="pull-requests">
<table-row slot="head">
<table-cell class="data-status" header="column" pinned title="PR status"
@ -60,9 +60,8 @@
</div>
</div>
</section>
<section class="workspace-section app__section">
<header class="workspace-section__header">
<section class="focus-section app__section">
<header class="focus-section__header">
<h2>My Issues</h2>
<nav class="tab-filter" id="issue-filter">
<button class="tab-filter__tab is-active" type="button" data-tab="">All</button>
@ -71,7 +70,7 @@
<button class="tab-filter__tab" type="button" data-tab="mentioned">Mentions Me</button>
</nav>
</header>
<div class="workspace-section__content">
<div class="focus-section__content">
<table-container id="issues">
<table-row slot="head">
<table-cell class="data-status" header="column" pinned title="PR status">
@ -104,109 +103,7 @@
</div>
</div>
</section>
<!-- <section class="workspace-section app__section">
<header class="workspace-section__header">
<h2>Work in Progress</h2>
</header>
<div class="workspace-section__content">
<table-container>
<table-row slot="head">
<table-cell header="column" pinned>Repo</table-cell>
<table-cell header="column" pinned>Stats</table-cell>
<table-cell header="column" pinned>Branch</table-cell>
<table-cell header="column" pinned>Remote</table-cell>
</table-row>
<table-row>
<table-cell>vscode-gitlens</table-cell>
<table-cell
><span class="stat-added">+50</span> <span class="stat-modified">~100</span>
<span class="stat-deleted">-206</span></table-cell
>
<table-cell
><span class="tag"
><code-icon icon="source-control"></code-icon>feature/workspaces</span
></table-cell
>
<table-cell
><span class="tag"
><code-icon icon="repo"></code-icon>gitkraken/vscode-gitlens</span
></table-cell
>
</table-row>
</table-container>
</div>
</section> -->
</main>
<!-- <menu-list class="app__controls">
<menu-label>Type</menu-label>
<menu-item role="none">
<div class="choice">
<input class="choice__input" type="checkbox" id="filter-prs" value="mentioned" checked />
<span class="choice__indicator"><code-icon icon="check"></code-icon></span>
<label class="choice__label" for="filter-prs">Pull requests</label>
</div>
</menu-item>
<menu-item role="none">
<div class="choice">
<input class="choice__input" type="checkbox" id="filter-issues" value="mentioned" checked />
<span class="choice__indicator"><code-icon icon="check"></code-icon></span>
<label class="choice__label" for="filter-issues">Issues</label>
</div>
</menu-item>
<menu-divider></menu-divider>
<menu-label>Association</menu-label>
<menu-item role="none">
<div class="choice">
<input class="choice__input" type="checkbox" id="filter-assigned" value="assigned" checked />
<span class="choice__indicator"><code-icon icon="check"></code-icon></span>
<label class="choice__label" for="filter-assigned">Assigned to me</label>
</div>
</menu-item>
<menu-item role="none">
<div class="choice">
<input class="choice__input" type="checkbox" id="filter-created" value="authored" checked />
<span class="choice__indicator"><code-icon icon="check"></code-icon></span>
<label class="choice__label" for="filter-created">Created by me</label>
</div>
</menu-item>
<menu-item role="none">
<div class="choice">
<input
class="choice__input"
type="checkbox"
id="filter-review-requested"
value="review-requested"
checked
/>
<span class="choice__indicator"><code-icon icon="check"></code-icon></span>
<label class="choice__label" for="filter-review-requested">Review requested</label>
</div>
</menu-item>
<menu-item role="none">
<div class="choice">
<input class="choice__input" type="checkbox" id="filter-mentioned" value="mentioned" checked />
<span class="choice__indicator"><code-icon icon="check"></code-icon></span>
<label class="choice__label" for="filter-mentioned">Mentioned</label>
</div>
</menu-item>
<menu-divider></menu-divider>
<menu-label>Repos</menu-label>
<menu-item role="none">
<div class="choice">
<input
class="choice__input"
type="checkbox"
id="filter-repo-1"
value="mentioned"
checked
readonly
/>
<span class="choice__indicator"><code-icon icon="check"></code-icon></span>
<label class="choice__label" for="filter-repo-1">vscode-gitlens</label>
</div>
</menu-item>
</menu-list> -->
</div>
<div class="overlay" id="account-overlay" hidden>

src/webviews/apps/plus/workspaces/workspaces.scss → src/webviews/apps/plus/focus/focus.scss Visa fil

@ -180,12 +180,12 @@ p {
}
}
.workspace-icon {
.focus-icon {
font-size: 1.6rem;
vertical-align: sub;
}
.workspace-section {
.focus-section {
display: flex;
flex-direction: column;
gap: 0.8rem;

src/webviews/apps/plus/workspaces/workspaces.ts → src/webviews/apps/plus/focus/focus.ts Visa fil

@ -1,9 +1,9 @@
import { provideVSCodeDesignSystem, vsCodeButton } from '@vscode/webview-ui-toolkit';
import type { State } from '../../../../plus/webviews/workspaces/protocol';
import type { State } from '../../../../plus/webviews/focus/protocol';
import {
DidChangeStateNotificationType,
DidChangeSubscriptionNotificationType,
} from '../../../../plus/webviews/workspaces/protocol';
} from '../../../../plus/webviews/focus/protocol';
import type { IpcMessage } from '../../../protocol';
import { ExecuteCommandType, onIpc } from '../../../protocol';
import { App } from '../../shared/appBase';
@ -15,10 +15,6 @@ import type { PullRequestRow } from './components/pull-request-row';
import '../../shared/components/code-icon';
import '../../shared/components/avatars/avatar-item';
import '../../shared/components/avatars/avatar-stack';
import '../../shared/components/menu/menu-list';
import '../../shared/components/menu/menu-item';
import '../../shared/components/menu/menu-label';
import '../../shared/components/menu/menu-divider';
import '../../shared/components/table/table-container';
import '../../shared/components/table/table-row';
import '../../shared/components/table/table-cell';
@ -26,11 +22,11 @@ import '../../shared/components/account/account-badge';
import './components/issue-row';
import './components/plus-content';
import './components/pull-request-row';
import './workspaces.scss';
import './focus.scss';
export class WorkspacesApp extends App<State> {
export class FocusApp extends App<State> {
constructor() {
super('WorkspacesApp');
super('FocusApp');
}
_prFilter?: string;
@ -216,4 +212,4 @@ export class WorkspacesApp extends App {
}
}
new WorkspacesApp();
new FocusApp();

+ 1
- 1
src/webviews/webviewBase.ts Visa fil

@ -31,7 +31,7 @@ function nextIpcId() {
return `host:${ipcSequence}`;
}
export type WebviewIds = 'graph' | 'settings' | 'timeline' | 'welcome' | 'workspaces';
export type WebviewIds = 'graph' | 'settings' | 'timeline' | 'welcome' | 'focus';
@logName<WebviewBase<any>>((c, name) => `${name}(${c.id})`)
export abstract class WebviewBase<State> implements Disposable {

+ 2
- 2
webpack.config.js Visa fil

@ -329,7 +329,7 @@ function getWebviewsConfig(mode, env) {
getHtmlPlugin('settings', false, mode, env),
getHtmlPlugin('timeline', true, mode, env),
getHtmlPlugin('welcome', false, mode, env),
getHtmlPlugin('workspaces', true, mode, env),
getHtmlPlugin('focus', true, mode, env),
getCspHtmlPlugin(mode, env),
new InlineChunkHtmlPlugin(HtmlPlugin, mode === 'production' ? ['\\.css$'] : []),
new CopyPlugin({
@ -392,7 +392,7 @@ function getWebviewsConfig(mode, env) {
settings: './settings/settings.ts',
timeline: './plus/timeline/timeline.ts',
welcome: './welcome/welcome.ts',
workspaces: './plus/workspaces/workspaces.ts',
focus: './plus/focus/focus.ts',
},
mode: mode,
target: 'web',

Laddar…
Avbryt
Spara