-
Notifications
You must be signed in to change notification settings - Fork 36.5k
agent sessions - show a link to open all sessions #279366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |||||||||||||||||||||||||
| *--------------------------------------------------------------------------------------------*/ | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| import './media/chatViewPane.css'; | ||||||||||||||||||||||||||
| import { $, getWindow } from '../../../../base/browser/dom.js'; | ||||||||||||||||||||||||||
| import { $, append, getWindow } from '../../../../base/browser/dom.js'; | ||||||||||||||||||||||||||
| import { CancellationToken } from '../../../../base/common/cancellation.js'; | ||||||||||||||||||||||||||
| import { MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; | ||||||||||||||||||||||||||
| import { MarshalledId } from '../../../../base/common/marshallingIds.js'; | ||||||||||||||||||||||||||
|
|
@@ -36,11 +36,15 @@ import { CHAT_PROVIDER_ID } from '../common/chatParticipantContribTypes.js'; | |||||||||||||||||||||||||
| import { IChatModelReference, IChatService } from '../common/chatService.js'; | ||||||||||||||||||||||||||
| import { IChatSessionsExtensionPoint, IChatSessionsService, localChatSessionType } from '../common/chatSessionsService.js'; | ||||||||||||||||||||||||||
| import { LocalChatSessionUri } from '../common/chatUri.js'; | ||||||||||||||||||||||||||
| import { ChatAgentLocation, ChatConfiguration, ChatModeKind } from '../common/constants.js'; | ||||||||||||||||||||||||||
| import { ChatAgentLocation, ChatConfiguration, ChatModeKind, LEGACY_AGENT_SESSIONS_VIEW_ID } from '../common/constants.js'; | ||||||||||||||||||||||||||
| import { AGENT_SESSIONS_VIEW_ID } from './agentSessions/agentSessions.js'; | ||||||||||||||||||||||||||
| import { showCloseActiveChatNotification } from './actions/chatCloseNotification.js'; | ||||||||||||||||||||||||||
| import { ChatWidget } from './chatWidget.js'; | ||||||||||||||||||||||||||
| import { Link } from '../../../../platform/opener/browser/link.js'; | ||||||||||||||||||||||||||
| import { localize } from '../../../../nls.js'; | ||||||||||||||||||||||||||
| import { ChatViewWelcomeController, IViewWelcomeDelegate } from './viewsWelcome/chatViewWelcomeController.js'; | ||||||||||||||||||||||||||
| import { AgentSessionsControl } from './agentSessions/agentSessionsControl.js'; | ||||||||||||||||||||||||||
| import { ICommandService } from '../../../../platform/commands/common/commands.js'; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| interface IChatViewPaneState extends Partial<IChatModelInputState> { | ||||||||||||||||||||||||||
| sessionId?: string; | ||||||||||||||||||||||||||
|
|
@@ -64,6 +68,7 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate { | |||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| private sessionsContainer: HTMLElement | undefined; | ||||||||||||||||||||||||||
| private sessionsControl: AgentSessionsControl | undefined; | ||||||||||||||||||||||||||
| private sessionsLinkContainer: HTMLElement | undefined; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| private restoringSession: Promise<void> | undefined; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
@@ -88,6 +93,7 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate { | |||||||||||||||||||||||||
| @ILayoutService private readonly layoutService: ILayoutService, | ||||||||||||||||||||||||||
| @IChatSessionsService private readonly chatSessionsService: IChatSessionsService, | ||||||||||||||||||||||||||
| @ITelemetryService private readonly telemetryService: ITelemetryService, | ||||||||||||||||||||||||||
| @ICommandService private readonly commandService: ICommandService, | ||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||
| super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, hoverService); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
@@ -247,9 +253,24 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate { | |||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| private createSessionsControl(parent: HTMLElement): void { | ||||||||||||||||||||||||||
| this.sessionsContainer = parent.appendChild($('.chat-viewpane-sessions-container')); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // Sessions Control | ||||||||||||||||||||||||||
| this.sessionsContainer = parent.appendChild($('.agent-sessions-container')); | ||||||||||||||||||||||||||
| this.sessionsControl = this._register(this.instantiationService.createInstance(AgentSessionsControl, this.sessionsContainer, undefined)); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // Link to Sessions View | ||||||||||||||||||||||||||
| this.sessionsLinkContainer = append(this.sessionsContainer, $('.agent-sessions-link-container')); | ||||||||||||||||||||||||||
| this._register(this.instantiationService.createInstance(Link, this.sessionsLinkContainer, { label: localize('openAgentSessionsView', "Show All Sessions"), href: '', }, { | ||||||||||||||||||||||||||
| opener: () => { | ||||||||||||||||||||||||||
| // TODO@bpasero remove this check once settled | ||||||||||||||||||||||||||
| if (this.configurationService.getValue('chat.agentSessionsViewLocation') === 'single-view') { | ||||||||||||||||||||||||||
| this.commandService.executeCommand(AGENT_SESSIONS_VIEW_ID); | ||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||
| this.commandService.executeCommand(LEGACY_AGENT_SESSIONS_VIEW_ID); | ||||||||||||||||||||||||||
|
Comment on lines
+264
to
+269
|
||||||||||||||||||||||||||
| opener: () => { | |
| // TODO@bpasero remove this check once settled | |
| if (this.configurationService.getValue('chat.agentSessionsViewLocation') === 'single-view') { | |
| this.commandService.executeCommand(AGENT_SESSIONS_VIEW_ID); | |
| } else { | |
| this.commandService.executeCommand(LEGACY_AGENT_SESSIONS_VIEW_ID); | |
| opener: async () => { | |
| // TODO@bpasero remove this check once settled | |
| if (this.configurationService.getValue('chat.agentSessionsViewLocation') === 'single-view') { | |
| await this.commandService.executeCommand(AGENT_SESSIONS_VIEW_ID); | |
| } else { | |
| await this.commandService.executeCommand(LEGACY_AGENT_SESSIONS_VIEW_ID); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imports should be grouped and ordered consistently. The newly added imports should be placed with their respective groups:
Link(line 43) should be with other platform imports (lines 13-26)localize(line 44) should be earlier, typically near the top with base importsICommandService(line 47) should be with other platform imports (lines 13-26)Suggested order: