Merge pull request #2577 from kyleli626/open-chat-cmd
feat: focus continue session id command
This commit is contained in:
commit
9cb7bf854c
4 changed files with 27 additions and 1 deletions
|
|
@ -66,6 +66,7 @@ export type ToWebviewFromIdeProtocol = ToWebviewFromIdeOrCoreProtocol & {
|
|||
* @deprecated Use navigateTo with a path instead.
|
||||
*/
|
||||
viewHistory: [undefined, void];
|
||||
focusContinueSessionId: [{ sessionId: string | undefined }, void];
|
||||
newSession: [undefined, void];
|
||||
setTheme: [{ theme: any }, void];
|
||||
setColors: [{ [key: string]: string }, void];
|
||||
|
|
|
|||
|
|
@ -280,6 +280,12 @@
|
|||
"category": "Continue",
|
||||
"title": "Docs Force Re-Index",
|
||||
"group": "Continue"
|
||||
},
|
||||
{
|
||||
"command": "continue.focusContinueSessionId",
|
||||
"category": "Continue",
|
||||
"title": "Focus Continue Chat",
|
||||
"group": "Continue"
|
||||
}
|
||||
],
|
||||
"keybindings": [
|
||||
|
|
|
|||
|
|
@ -480,6 +480,14 @@ const commandsMap: (
|
|||
"continue.viewHistory": () => {
|
||||
sidebar.webviewProtocol?.request("viewHistory", undefined);
|
||||
},
|
||||
"continue.focusContinueSessionId": async (sessionId: string | undefined) => {
|
||||
if (!sessionId) {
|
||||
sessionId = await vscode.window.showInputBox({
|
||||
prompt: "Enter the Session ID"
|
||||
});
|
||||
}
|
||||
sidebar.webviewProtocol?.request("focusContinueSessionId", { sessionId });
|
||||
},
|
||||
"continue.applyCodeFromChat": () => {
|
||||
sidebar.webviewProtocol.request("applyCodeFromChat", undefined);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ function TipTapEditor(props: TipTapEditorProps) {
|
|||
);
|
||||
const useActiveFile = useSelector(selectUseActiveFile);
|
||||
|
||||
const { saveSession } = useHistory(dispatch);
|
||||
const { saveSession, loadSession } = useHistory(dispatch);
|
||||
|
||||
const posthog = usePostHog();
|
||||
const [isEditorFocused, setIsEditorFocused] = useState(false);
|
||||
|
|
@ -806,6 +806,17 @@ function TipTapEditor(props: TipTapEditorProps) {
|
|||
!props.isMainInput,
|
||||
);
|
||||
|
||||
useWebviewListener(
|
||||
"focusContinueSessionId",
|
||||
async (data) => {
|
||||
if (!props.isMainInput) {
|
||||
return;
|
||||
}
|
||||
loadSession(data.sessionId);
|
||||
},
|
||||
[loadSession, props.isMainInput],
|
||||
);
|
||||
|
||||
const [showDragOverMsg, setShowDragOverMsg] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue