Skip to content

Conversation

rwoll
Copy link
Member

@rwoll rwoll commented Sep 17, 2025

No description provided.

Copy link
Member Author

@rwoll rwoll left a 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}`,
Copy link
Member Author

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}` : '@';
Copy link
Member Author

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}`);
Copy link
Member Author

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';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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();
Copy link
Member Author

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);
Copy link
Member Author

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;
Copy link
Member Author

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.

@rwoll rwoll closed this Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant