diff --git a/apps/server/src/open.test.ts b/apps/server/src/open.test.ts index 0f864554e..67a91cf2d 100644 --- a/apps/server/src/open.test.ts +++ b/apps/server/src/open.test.ts @@ -34,6 +34,15 @@ describe("resolveEditorLaunch", () => { args: ["/tmp/workspace"], }); + const traeLaunch = yield* resolveEditorLaunch( + { cwd: "/tmp/workspace", editor: "trae" }, + "darwin", + ); + assert.deepEqual(traeLaunch, { + command: "trae", + args: ["/tmp/workspace"], + }); + const zedLaunch = yield* resolveEditorLaunch( { cwd: "/tmp/workspace", editor: "zed" }, "darwin", @@ -74,6 +83,15 @@ describe("resolveEditorLaunch", () => { args: ["--goto", "/tmp/workspace/src/open.ts:71:5"], }); + const traeLineAndColumn = yield* resolveEditorLaunch( + { cwd: "/tmp/workspace/src/open.ts:71:5", editor: "trae" }, + "darwin", + ); + assert.deepEqual(traeLineAndColumn, { + command: "trae", + args: ["/tmp/workspace/src/open.ts:71:5"], + }); + const zedLineAndColumn = yield* resolveEditorLaunch( { cwd: "/tmp/workspace/src/open.ts:71:5", editor: "zed" }, "darwin", diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 1bd167291..bb33ba467 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -173,6 +173,7 @@ import { Icon, OpenAI, OpenCodeIcon, + TraeIcon, VisualStudioCode, Zed, } from "./Icons"; @@ -6056,6 +6057,11 @@ const OpenInPicker = memo(function OpenInPicker({ Icon: CursorIcon, value: "cursor", }, + { + label: "Trae", + Icon: TraeIcon, + value: "trae", + }, { label: "VS Code", Icon: VisualStudioCode, @@ -6087,6 +6093,15 @@ const OpenInPicker = memo(function OpenInPicker({ ? lastEditor : (options[0]?.value ?? null); const primaryOption = options.find(({ value }) => value === effectiveEditor) ?? null; + const getEditorIconClassName = useCallback( + (editor: EditorId, surface: "button" | "menu") => { + if (surface === "button") { + return editor === "trae" ? "size-4" : "size-3.5"; + } + return cn("text-muted-foreground", editor === "trae" && "size-5 sm:size-4.5"); + }, + [], + ); const openInEditor = useCallback( (editorId: EditorId | null) => { @@ -6128,7 +6143,12 @@ const OpenInPicker = memo(function OpenInPicker({ disabled={!effectiveEditor || !openInCwd} onClick={() => openInEditor(effectiveEditor)} > - {primaryOption?.Icon &&