From e03eb9d5801985d1968d0528dd76767bf3907cbf Mon Sep 17 00:00:00 2001 From: Test Date: Wed, 25 Sep 2024 10:26:35 -0700 Subject: [PATCH] feat: add gif to tutorial card --- core/protocol/ideWebview.ts | 1 + extensions/vscode/media/welcome.md | 9 +-- extensions/vscode/src/activation/activate.ts | 11 ---- .../vscode/src/extension/VsCodeMessenger.ts | 11 ++++ gui/src/components/mainInput/TutorialCard.tsx | 56 +++++++++++-------- gui/src/pages/gui.tsx | 4 +- 6 files changed, 51 insertions(+), 41 deletions(-) diff --git a/core/protocol/ideWebview.ts b/core/protocol/ideWebview.ts index a2762ce20..8ccc6d007 100644 --- a/core/protocol/ideWebview.ts +++ b/core/protocol/ideWebview.ts @@ -26,6 +26,7 @@ export type ToIdeFromWebviewProtocol = ToIdeFromWebviewOrCoreProtocol & { insertAtCursor: [{ text: string }, void]; copyText: [{ text: string }, void]; "jetbrains/editorInsetHeight": [{ height: number }, void]; + "vscode/openMoveRightMarkdown": [undefined, void]; setGitHubAuthToken: [{ token: string }, void]; acceptDiff: [{ filepath: string }, void]; rejectDiff: [{ filepath: string }, void]; diff --git a/extensions/vscode/media/welcome.md b/extensions/vscode/media/welcome.md index 33cdee623..73ab338f1 100644 --- a/extensions/vscode/media/welcome.md +++ b/extensions/vscode/media/welcome.md @@ -1,8 +1,5 @@ -# Move Continue to the right sidebar +# Move Chat to the right sidebar + +### This will prevent the Chat panel from covering your file explorer ![Move Continue to right sidebar](./move-to-right-sidebar.gif) - -Continue is currently in the left sidebar, but we recommend moving it to the right. -This way it won't cover your file explorer. - -You can move it back at any time. If you close the sidebar, it can be re-opened with Cmd/Ctrl + L. diff --git a/extensions/vscode/src/activation/activate.ts b/extensions/vscode/src/activation/activate.ts index 9af977b2d..cce7bcfbe 100644 --- a/extensions/vscode/src/activation/activate.ts +++ b/extensions/vscode/src/activation/activate.ts @@ -20,17 +20,6 @@ export async function activateExtension(context: vscode.ExtensionContext) { const vscodeExtension = new VsCodeExtension(context); - migrate("showWelcome_1", () => { - vscode.commands.executeCommand( - "markdown.showPreview", - vscode.Uri.file( - path.join(getExtensionUri().fsPath, "media", "welcome.md"), - ), - ); - - vscode.commands.executeCommand("continue.focusContinueInput"); - }); - // Load Continue configuration if (!context.globalState.get("hasBeenInstalled")) { context.globalState.update("hasBeenInstalled", true); diff --git a/extensions/vscode/src/extension/VsCodeMessenger.ts b/extensions/vscode/src/extension/VsCodeMessenger.ts index 786f5377a..b9bd4a5ce 100644 --- a/extensions/vscode/src/extension/VsCodeMessenger.ts +++ b/extensions/vscode/src/extension/VsCodeMessenger.ts @@ -84,9 +84,20 @@ export class VsCodeMessenger { this.onWebview("showFile", (msg) => { this.ide.openFile(msg.data.filepath); }); + + this.onWebview("vscode/openMoveRightMarkdown", (msg) => { + vscode.commands.executeCommand( + "markdown.showPreview", + vscode.Uri.file( + path.join(getExtensionUri().fsPath, "media", "welcome.md"), + ), + ); + }); + this.onWebview("openConfigJson", (msg) => { this.ide.openFile(getConfigJsonPath()); }); + this.onWebview("readRangeInFile", async (msg) => { return await vscode.workspace .openTextDocument(msg.data.filepath) diff --git a/gui/src/components/mainInput/TutorialCard.tsx b/gui/src/components/mainInput/TutorialCard.tsx index 525a69887..cd5be630b 100644 --- a/gui/src/components/mainInput/TutorialCard.tsx +++ b/gui/src/components/mainInput/TutorialCard.tsx @@ -1,4 +1,5 @@ import { + ArrowRightStartOnRectangleIcon, BookOpenIcon, ClipboardDocumentIcon, Cog6ToothIcon, @@ -7,7 +8,9 @@ import { } from "@heroicons/react/24/outline"; import styled from "styled-components"; import { defaultBorderRadius, lightGray, vscBackground } from ".."; -import { getMetaKeyLabel } from "../../util"; +import { getMetaKeyLabel, isJetBrains } from "../../util"; +import { useContext } from "react"; +import { IdeMessengerContext } from "../../context/IdeMessenger"; interface TutorialCardProps { onClose: () => void; @@ -38,6 +41,8 @@ const CloseButton = styled.button` `; export function TutorialCard({ onClose }: TutorialCardProps) { + const ideMessenger = useContext(IdeMessengerContext); + return ( @@ -45,46 +50,53 @@ export function TutorialCard({ onClose }: TutorialCardProps) {