fix(vscode): send an editor comment to the sidebar chat instead of opening a tab
A comment went to the active session tab, and when there was none it opened a new one, even while the user was chatting in the sidebar. That is not how the other capture flows behave. The comment now takes the same route as Add to Context: the active session tab when one exists, otherwise the sidebar, revealed if it is closed. Claude-Session: https://claude.ai/code/session_01VqV56Hez25hTxXH4ipJfzH
This commit is contained in:
@@ -375,39 +375,6 @@ export class SessionEditorPanelProvider {
|
||||
return entry.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delivers a comment to a session tab, opening one when none exists.
|
||||
*
|
||||
* A comment is written against code the user is reading, so it must not
|
||||
* depend on their having opened a chat first. With no tab open this behaves
|
||||
* like the toolbar's new-session button, then delivers into that tab once its
|
||||
* webview is listening.
|
||||
*/
|
||||
public openWithLineComment(payload: LineCommentPayload, activeSessionId: string | null): string | null {
|
||||
if (!payload.relativePath.trim()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const accepted = this.addLineCommentToActivePanel(payload);
|
||||
if (accepted) {
|
||||
return accepted;
|
||||
}
|
||||
|
||||
if (activeSessionId) {
|
||||
this.createOrShow(activeSessionId);
|
||||
} else {
|
||||
this.createOrShowNewSession();
|
||||
}
|
||||
|
||||
const entry = this._getActivePanelEntry();
|
||||
if (!entry) {
|
||||
return null;
|
||||
}
|
||||
|
||||
entry.pendingLineComments.push(payload);
|
||||
return entry.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Drops a draft the user removed from its editor thread.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user