-
Notifications
You must be signed in to change notification settings - Fork 35.1k
[WIP] poc: branch-associated Chat Sessions #267139
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
Conversation
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.
First working draft. Some higher level followups:
- when switching chat sessions, auto checkout the branch as well.
- UI treatment - when you checkout out a previous branch, it's not obvious the chat session is restored since before v. after is a wall of text. Need some UI indicator.
- Put this all behind a setting.
@@ -579,7 +580,7 @@ export function registerChatActions() { | |||
separator, | |||
{ | |||
label: i.title, | |||
description: i.isActive ? `(${localize('currentChatLabel', 'current')})` : '', | |||
description: i.isActive ? `(${i.createdOnBranch} - ${localize('currentChatLabel', 'current')})` : `${i.createdOnBranch}`, |
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.
use last active branch instead of createdOnBranch?
@@ -1232,7 +1233,7 @@ export function registerChatActions() { | |||
const suggestCtrl = SuggestController.get(widget.inputEditor); | |||
if (suggestCtrl) { | |||
const curText = widget.inputEditor.getValue(); | |||
const newValue = curText ? `@ ${curText}` : '@'; | |||
const newValue = curText ? `@${curText}` : '@'; |
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.
revert. this seems unrelated.
@@ -1402,7 +1403,7 @@ export function registerChatActions() { | |||
|
|||
override async run(accessor: ServicesAccessor): Promise<void> { | |||
const extensionsWorkbenchService = accessor.get(IExtensionsWorkbenchService); | |||
extensionsWorkbenchService.openSearch(`@feature:${CopilotUsageExtensionFeatureId}`); | |||
extensionsWorkbenchService.openSearch(`@feature: ${CopilotUsageExtensionFeatureId}`); |
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.
revert. unrelated.
@@ -87,6 +87,7 @@ export const CHAT_CATEGORY = localize2('chat.category', 'Chat'); | |||
export const ACTION_ID_NEW_CHAT = `workbench.action.chat.newChat`; | |||
export const ACTION_ID_NEW_EDIT_SESSION = `workbench.action.chat.newEditSession`; | |||
export const CHAT_OPEN_ACTION_ID = 'workbench.action.chat.open'; | |||
export const CHAT_OPEN_HISTORICAL_SESSION_ACTION_ID = 'workbench.action.chat.openHistoricalSession'; |
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.
export const CHAT_OPEN_HISTORICAL_SESSION_ACTION_ID = 'workbench.action.chat.openHistoricalSession'; | |
export const CHAT_RESTORE_SESSION_ACTION_ID = 'workbench.action.chat.restoreSession'; |
// Set up listener for current history item ref changes (HEAD movement) | ||
return runOnChange(historyProvider.historyItemRef, () => { | ||
// Fire event when the current branch reference changes | ||
const currentBranch = this.getCurrentBranch(); |
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.
Should this use getCurrentBranch()
…or does historyItemRef
have the actual branch info already?
return runOnChange(historyProvider.historyItemRef, () => { | ||
// Fire event when the current branch reference changes | ||
const currentBranch = this.getCurrentBranch(); | ||
this._onChangedBranch.fire(currentBranch); |
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.
Do we need to debounce this?
this._register(this.gitStatus.onChangedBranch(async branch => { | ||
console.log('Branch changed to:', branch); | ||
const history = await this.getHistory(); | ||
const sessionId = history.find(h => h.lastUsedOnBranch === branch)?.sessionId; |
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.
Need to check ordering on this. Ensure history
is sorted in an expected way. Ideally, we want the most recent session related to the branch.
No description provided.