Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/commands/showView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Commands } from '../constants.commands';
import type { Container } from '../container';
import type { GraphWebviewShowingArgs } from '../plus/webviews/graph/registration';
import { command } from '../system/vscode/command';
import type { HomeWebviewShowingArgs } from '../webviews/home/registration';
import type { CommandContext } from './base';
import { Command } from './base';

Expand Down Expand Up @@ -39,7 +40,10 @@ export class ShowViewCommand extends Command {
const command = context.command as Commands;
switch (command) {
case Commands.ShowAccountView:
return this.container.accountView.show();
return this.container.homeView.show(
undefined,
...([{ focusAccount: true }, ...args] as HomeWebviewShowingArgs),
);
case Commands.ShowBranchesView:
return this.container.branchesView.show();
case Commands.ShowCommitDetailsView:
Expand All @@ -55,7 +59,7 @@ export class ShowViewCommand extends Command {
case Commands.ShowGraphView:
return this.container.graphView.show(undefined, ...(args as GraphWebviewShowingArgs));
case Commands.ShowHomeView:
return this.container.homeView.show();
return this.container.homeView.show(undefined, ...(args as HomeWebviewShowingArgs));
case Commands.ShowLaunchpadView:
return this.container.launchpadView.show();
case Commands.ShowLineHistoryView:
Expand Down
10 changes: 2 additions & 8 deletions src/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import { EnrichmentService } from './plus/launchpad/enrichmentService';
import { LaunchpadIndicator } from './plus/launchpad/launchpadIndicator';
import { LaunchpadProvider } from './plus/launchpad/launchpadProvider';
import { RepositoryIdentityService } from './plus/repos/repositoryIdentityService';
import { registerAccountWebviewView } from './plus/webviews/account/registration';
import type { GraphWebviewShowingArgs } from './plus/webviews/graph/registration';
import {
registerGraphWebviewCommands,
Expand Down Expand Up @@ -91,6 +90,7 @@ import {
registerCommitDetailsWebviewView,
registerGraphDetailsWebviewView,
} from './webviews/commitDetails/registration';
import type { HomeWebviewShowingArgs } from './webviews/home/registration';
import { registerHomeWebviewView } from './webviews/home/registration';
import { RebaseEditorProvider } from './webviews/rebase/rebaseEditor';
import { registerSettingsWebviewCommands, registerSettingsWebviewPanel } from './webviews/settings/registration';
Expand Down Expand Up @@ -292,7 +292,6 @@ export class Container {
this._disposables.push((this._workspacesView = new WorkspacesView(this)));

this._disposables.push((this._homeView = registerHomeWebviewView(this._webviews)));
this._disposables.push((this._accountView = registerAccountWebviewView(this._webviews)));

if (configuration.get('launchpad.indicator.enabled')) {
this._disposables.push((this._launchpadIndicator = new LaunchpadIndicator(this, this._launchpadProvider)));
Expand Down Expand Up @@ -387,11 +386,6 @@ export class Container {
return this._accountAuthentication;
}

private readonly _accountView: WebviewViewProxy<[]>;
get accountView() {
return this._accountView;
}

private readonly _actionRunners: ActionRunners;
get actionRunners() {
return this._actionRunners;
Expand Down Expand Up @@ -628,7 +622,7 @@ export class Container {
return this._graphView;
}

private readonly _homeView: WebviewViewProxy<[]>;
private readonly _homeView: WebviewViewProxy<HomeWebviewShowingArgs>;
get homeView() {
return this._homeView;
}
Expand Down
2 changes: 1 addition & 1 deletion src/plus/gk/account/subscriptionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ export class SubscriptionService implements Disposable {
async showAccountView(silent: boolean = false): Promise<void> {
if (silent && !configuration.get('plusFeatures.enabled', undefined, true)) return;

if (!this.container.accountView.visible) {
if (!this.container.homeView.visible) {
await executeCommand(Commands.ShowAccountView);
}
}
Expand Down
130 changes: 0 additions & 130 deletions src/plus/webviews/account/accountWebview.ts

This file was deleted.

24 changes: 0 additions & 24 deletions src/plus/webviews/account/protocol.ts

This file was deleted.

24 changes: 0 additions & 24 deletions src/plus/webviews/account/registration.ts

This file was deleted.

3 changes: 2 additions & 1 deletion src/webviews/apps/home/components/feature-nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { consume } from '@lit/context';
import { css, html } from 'lit';
import { customElement, property, state } from 'lit/decorators.js';
import { when } from 'lit/directives/when.js';
import type { Source } from '../../../../constants.telemetry';
import type { State } from '../../../home/protocol';
import { GlElement } from '../../shared/components/element';
import { linkBase } from '../../shared/components/styles/lit/base.css';
Expand All @@ -13,7 +14,7 @@ export class GlFeatureNav extends GlElement {
static override styles = [linkBase, homeBaseStyles, navListStyles, css``];

@property({ type: Object })
private badgeSource = { source: 'home', detail: 'badge' };
private badgeSource: Source = { source: 'home', detail: 'badge' };

@consume<State>({ context: stateContext, subscribe: true })
@state()
Expand Down
27 changes: 26 additions & 1 deletion src/webviews/apps/home/home.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
/*global*/
import './home.scss';
import { html } from 'lit';
import { customElement } from 'lit/decorators.js';
import { customElement, query } from 'lit/decorators.js';
import type { State } from '../../home/protocol';
import { DidFocusAccount } from '../../home/protocol';
import type { GLHomeAccountContent } from '../plus/shared/components/home-account-content';
import { GlApp } from '../shared/app';
import { scrollableBase } from '../shared/components/styles/lit/base.css';
import type { Disposable } from '../shared/events';
import type { HostIpc } from '../shared/ipc';
import { homeBaseStyles, homeStyles } from './home.css';
import { HomeStateProvider } from './stateProvider';
Expand All @@ -17,13 +20,35 @@ import './components/onboarding';
@customElement('gl-home-app')
export class GlHomeApp extends GlApp<State> {
static override styles = [homeBaseStyles, scrollableBase, homeStyles];
private disposable: Disposable | undefined;

@query('#account-content')
private accountContentEl!: GLHomeAccountContent;

private badgeSource = { source: 'home', detail: 'badge' };

protected override createStateProvider(state: State, ipc: HostIpc) {
return new HomeStateProvider(this, state, ipc);
}

override connectedCallback(): void {
super.connectedCallback();

this.disposable = this._ipc.onReceiveMessage(msg => {
switch (true) {
case DidFocusAccount.is(msg):
this.accountContentEl.show();
break;
}
});
}

override disconnectedCallback(): void {
super.disconnectedCallback();

this.disposable?.dispose();
}

override render() {
return html`
<div class="home scrollable">
Expand Down
23 changes: 0 additions & 23 deletions src/webviews/apps/plus/account/account.html

This file was deleted.

Loading
Loading