Skip to content
44 changes: 44 additions & 0 deletions packages/ai-ide/src/browser/ai-first-perspective-contribution.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// *****************************************************************************
// Copyright (C) 2026 EclipseSource GmbH.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License v. 2.0 which is available at
// http://www.eclipse.org/legal/epl-2.0.
//
// This Source Code may also be made available under the following Secondary
// Licenses when the conditions for such availability set forth in the Eclipse
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
// with the GNU Classpath Exception which is available at
// https://www.gnu.org/software/classpath/license.html.
//
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
// *****************************************************************************

import { injectable } from '@theia/core/shared/inversify';
import { nls } from '@theia/core';
import { PerspectiveContribution, PerspectiveChromeOptions, PerspectiveService } from '@theia/core/lib/browser/perspective-service';
import { ApplicationShell } from '@theia/core/lib/browser/shell/application-shell';
import { EXPLORER_VIEW_CONTAINER_ID } from '@theia/navigator/lib/browser';
import { SCM_VIEW_CONTAINER_ID } from '@theia/scm/lib/browser/scm-contribution';
import { ChatViewWidget } from '@theia/ai-chat-ui/lib/browser/chat-view-widget';

@injectable()
export class AIFirstPerspectiveContribution implements PerspectiveContribution {

registerPerspectives(service: PerspectiveService): void {
const chromeOptions: PerspectiveChromeOptions = {
hideStatusBar: true,
collapseAreas: ['left', 'bottom']
};
service.registerPerspective({
id: 'ai-first',
label: nls.localize('theia/ai-ide/perspective/aiFirst', 'AI First'),
viewPlacements: new Map<string, ApplicationShell.Area>([
[ChatViewWidget.ID, 'main'],
[EXPLORER_VIEW_CONTAINER_ID, 'right'],
[SCM_VIEW_CONTAINER_ID, 'right']
]),
chromeOptions
});
}
}
5 changes: 5 additions & 0 deletions packages/ai-ide/src/browser/frontend-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ import { CodeReviewerAgent } from './code-reviewer-agent';
import { CodeReviewCapabilityContribution } from './code-review-capability-contribution';
import { PRReviewAgent } from './review/pr-review-agent';
import { PRReviewCapabilityContribution } from './review/pr-review-capability-contribution';
import { PerspectiveContribution } from '@theia/core/lib/browser/perspective-service';
import { AIFirstPerspectiveContribution } from './ai-first-perspective-contribution';

export default new ContainerModule((bind, _unbind, _isBound, rebind) => {
bind(PreferenceContribution).toConstantValue({ schema: aiIdePreferenceSchema });
Expand Down Expand Up @@ -350,4 +352,7 @@ export default new ContainerModule((bind, _unbind, _isBound, rebind) => {

bind(FrontendApplicationContribution).to(CodeReviewCapabilityContribution);
bind(FrontendApplicationContribution).to(PRReviewCapabilityContribution);

bind(AIFirstPerspectiveContribution).toSelf().inSingletonScope();
bind(PerspectiveContribution).toService(AIFirstPerspectiveContribution);
});
6 changes: 6 additions & 0 deletions packages/core/src/browser/frontend-application-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ import { WidgetStatusBarContribution, WidgetStatusBarService } from './widget-st
import { SymbolIconColorContribution } from './symbol-icon-color-contribution';
import { CorePreferences, bindCorePreferences } from '../common/core-preferences';
import { bindBadgeDecoration } from './badges';
import { PerspectiveContribution, PerspectiveService } from './perspective-service';

export { bindResourceProvider, bindMessageService, bindPreferenceService };

Expand Down Expand Up @@ -483,6 +484,11 @@ export const frontendApplicationModule = new ContainerModule((bind, _unbind, _is
bind(DomInputUndoRedoHandler).toSelf().inSingletonScope();
bind(UndoRedoHandler).toService(DomInputUndoRedoHandler);

bind(PerspectiveService).toSelf().inSingletonScope();
bind(FrontendApplicationContribution).toService(PerspectiveService);
bind(CommandContribution).toService(PerspectiveService);
bindRootContributionProvider(bind, PerspectiveContribution);

bind(WidgetStatusBarService).toSelf().inSingletonScope();
bind(FrontendApplicationContribution).toService(WidgetStatusBarService);
bindRootContributionProvider(bind, WidgetStatusBarContribution);
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/browser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ export * from './markdown-rendering/markdown-renderer';
export * from './markdown-rendering/markdown';
export * from './markdown-rendering/markdown-link-handler';
export * from './components';
export * from './perspective-service';
Loading