diff --git a/apps/server/src/open.test.ts b/apps/server/src/open.test.ts index 649e88462c..947a60ac2a 100644 --- a/apps/server/src/open.test.ts +++ b/apps/server/src/open.test.ts @@ -40,6 +40,24 @@ it.layer(NodeServices.layer)("resolveEditorLaunch", (it) => { args: ["/tmp/workspace"], }); + const vscodeInsidersLaunch = yield* resolveEditorLaunch( + { cwd: "/tmp/workspace", editor: "vscode-insiders" }, + "darwin", + ); + assert.deepEqual(vscodeInsidersLaunch, { + command: "code-insiders", + args: ["/tmp/workspace"], + }); + + const vscodiumLaunch = yield* resolveEditorLaunch( + { cwd: "/tmp/workspace", editor: "vscodium" }, + "darwin", + ); + assert.deepEqual(vscodiumLaunch, { + command: "codium", + args: ["/tmp/workspace"], + }); + const zedLaunch = yield* resolveEditorLaunch( { cwd: "/tmp/workspace", editor: "zed" }, "darwin", @@ -80,6 +98,24 @@ it.layer(NodeServices.layer)("resolveEditorLaunch", (it) => { args: ["--goto", "/tmp/workspace/src/open.ts:71:5"], }); + const vscodeInsidersLineAndColumn = yield* resolveEditorLaunch( + { cwd: "/tmp/workspace/src/open.ts:71:5", editor: "vscode-insiders" }, + "darwin", + ); + assert.deepEqual(vscodeInsidersLineAndColumn, { + command: "code-insiders", + args: ["--goto", "/tmp/workspace/src/open.ts:71:5"], + }); + + const vscodiumLineAndColumn = yield* resolveEditorLaunch( + { cwd: "/tmp/workspace/src/open.ts:71:5", editor: "vscodium" }, + "darwin", + ); + assert.deepEqual(vscodiumLineAndColumn, { + command: "codium", + args: ["--goto", "/tmp/workspace/src/open.ts:71:5"], + }); + const zedLineAndColumn = yield* resolveEditorLaunch( { cwd: "/tmp/workspace/src/open.ts:71:5", editor: "zed" }, "darwin", @@ -220,13 +256,14 @@ it.layer(NodeServices.layer)("resolveAvailableEditors", (it) => { const path = yield* Path.Path; const dir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-editors-" }); - yield* fs.writeFileString(path.join(dir, "cursor.CMD"), "@echo off\r\n"); + yield* fs.writeFileString(path.join(dir, "code-insiders.CMD"), "@echo off\r\n"); + yield* fs.writeFileString(path.join(dir, "codium.CMD"), "@echo off\r\n"); yield* fs.writeFileString(path.join(dir, "explorer.CMD"), "MZ"); const editors = resolveAvailableEditors("win32", { PATH: dir, PATHEXT: ".COM;.EXE;.BAT;.CMD", }); - assert.deepEqual(editors, ["cursor", "file-manager"]); + assert.deepEqual(editors, ["vscode-insiders", "vscodium", "file-manager"]); }), ); }); diff --git a/apps/server/src/open.ts b/apps/server/src/open.ts index e7238c04b2..3fbfd1653d 100644 --- a/apps/server/src/open.ts +++ b/apps/server/src/open.ts @@ -39,10 +39,8 @@ interface CommandAvailabilityOptions { const LINE_COLUMN_SUFFIX_PATTERN = /:\d+(?::\d+)?$/; -function shouldUseGotoFlag(editorId: EditorId, target: string): boolean { - return ( - (editorId === "cursor" || editorId === "vscode") && LINE_COLUMN_SUFFIX_PATTERN.test(target) - ); +function shouldUseGotoFlag(editor: (typeof EDITORS)[number], target: string): boolean { + return editor.supportsGoto && LINE_COLUMN_SUFFIX_PATTERN.test(target); } function fileManagerCommandForPlatform(platform: NodeJS.Platform): string { @@ -213,7 +211,7 @@ export const resolveEditorLaunch = Effect.fnUntraced(function* ( } if (editorDef.command) { - return shouldUseGotoFlag(editorDef.id, input.cwd) + return shouldUseGotoFlag(editorDef, input.cwd) ? { command: editorDef.command, args: ["--goto", input.cwd] } : { command: editorDef.command, args: [input.cwd] }; } diff --git a/apps/web/src/components/BranchToolbar.logic.test.ts b/apps/web/src/components/BranchToolbar.logic.test.ts index 5aef38ccf6..2f66e063ad 100644 --- a/apps/web/src/components/BranchToolbar.logic.test.ts +++ b/apps/web/src/components/BranchToolbar.logic.test.ts @@ -6,6 +6,7 @@ import { resolveBranchSelectionTarget, resolveDraftEnvModeAfterBranchChange, resolveBranchToolbarValue, + shouldIncludeBranchPickerItem, } from "./BranchToolbar.logic"; describe("resolveDraftEnvModeAfterBranchChange", () => { @@ -267,3 +268,38 @@ describe("resolveBranchSelectionTarget", () => { }); }); }); + +describe("shouldIncludeBranchPickerItem", () => { + it("keeps the synthetic checkout PR item visible for gh pr checkout input", () => { + expect( + shouldIncludeBranchPickerItem({ + itemValue: "__checkout_pull_request__:1359", + normalizedQuery: "gh pr checkout 1359", + createBranchItemValue: "__create_new_branch__:gh pr checkout 1359", + checkoutPullRequestItemValue: "__checkout_pull_request__:1359", + }), + ).toBe(true); + }); + + it("keeps the synthetic create-branch item visible for arbitrary branch input", () => { + expect( + shouldIncludeBranchPickerItem({ + itemValue: "__create_new_branch__:feature/demo", + normalizedQuery: "feature/demo", + createBranchItemValue: "__create_new_branch__:feature/demo", + checkoutPullRequestItemValue: null, + }), + ).toBe(true); + }); + + it("still filters ordinary branch items by query text", () => { + expect( + shouldIncludeBranchPickerItem({ + itemValue: "main", + normalizedQuery: "gh pr checkout 1359", + createBranchItemValue: "__create_new_branch__:gh pr checkout 1359", + checkoutPullRequestItemValue: "__checkout_pull_request__:1359", + }), + ).toBe(false); + }); +}); diff --git a/apps/web/src/components/BranchToolbar.logic.ts b/apps/web/src/components/BranchToolbar.logic.ts index 2215569c83..99928441c7 100644 --- a/apps/web/src/components/BranchToolbar.logic.ts +++ b/apps/web/src/components/BranchToolbar.logic.ts @@ -123,3 +123,26 @@ export function resolveBranchSelectionTarget(input: { reuseExistingWorktree: false, }; } + +export function shouldIncludeBranchPickerItem(input: { + itemValue: string; + normalizedQuery: string; + createBranchItemValue: string | null; + checkoutPullRequestItemValue: string | null; +}): boolean { + const { itemValue, normalizedQuery, createBranchItemValue, checkoutPullRequestItemValue } = input; + + if (normalizedQuery.length === 0) { + return true; + } + + if (createBranchItemValue && itemValue === createBranchItemValue) { + return true; + } + + if (checkoutPullRequestItemValue && itemValue === checkoutPullRequestItemValue) { + return true; + } + + return itemValue.toLowerCase().includes(normalizedQuery); +} diff --git a/apps/web/src/components/BranchToolbarBranchSelector.tsx b/apps/web/src/components/BranchToolbarBranchSelector.tsx index 9446279161..b41ea0a6e1 100644 --- a/apps/web/src/components/BranchToolbarBranchSelector.tsx +++ b/apps/web/src/components/BranchToolbarBranchSelector.tsx @@ -28,6 +28,7 @@ import { EnvMode, resolveBranchSelectionTarget, resolveBranchToolbarValue, + shouldIncludeBranchPickerItem, } from "./BranchToolbar.logic"; import { Button } from "./ui/button"; import { @@ -134,11 +135,20 @@ export function BranchToolbarBranchSelector({ () => normalizedDeferredBranchQuery.length === 0 ? branchPickerItems - : branchPickerItems.filter((itemValue) => { - if (createBranchItemValue && itemValue === createBranchItemValue) return true; - return itemValue.toLowerCase().includes(normalizedDeferredBranchQuery); - }), - [branchPickerItems, createBranchItemValue, normalizedDeferredBranchQuery], + : branchPickerItems.filter((itemValue) => + shouldIncludeBranchPickerItem({ + itemValue, + normalizedQuery: normalizedDeferredBranchQuery, + createBranchItemValue, + checkoutPullRequestItemValue, + }), + ), + [ + branchPickerItems, + checkoutPullRequestItemValue, + createBranchItemValue, + normalizedDeferredBranchQuery, + ], ); const [resolvedActiveBranch, setOptimisticBranch] = useOptimistic( canonicalActiveBranch, diff --git a/apps/web/src/components/ChatView.browser.tsx b/apps/web/src/components/ChatView.browser.tsx index 0995ae1ccc..7bf3ecf26c 100644 --- a/apps/web/src/components/ChatView.browser.tsx +++ b/apps/web/src/components/ChatView.browser.tsx @@ -56,6 +56,7 @@ interface TestFixture { let fixture: TestFixture; const wsRequests: WsRequestEnvelope["body"][] = []; +let customWsRpcResolver: ((body: WsRequestEnvelope["body"]) => unknown | undefined) | null = null; const wsLink = ws.link(/ws(s)?:\/\/.*/); interface ViewportSpec { @@ -356,6 +357,25 @@ function withProjectScripts( }; } +function setDraftThreadWithoutWorktree(): void { + useComposerDraftStore.setState({ + draftThreadsByThreadId: { + [THREAD_ID]: { + projectId: PROJECT_ID, + createdAt: NOW_ISO, + runtimeMode: "full-access", + interactionMode: "default", + branch: null, + worktreePath: null, + envMode: "local", + }, + }, + projectDraftThreadIdByProjectId: { + [PROJECT_ID]: THREAD_ID, + }, + }); +} + function createSnapshotWithLongProposedPlan(): OrchestrationReadModel { const snapshot = createSnapshotForTargetUser({ targetMessageId: "msg-user-plan-target" as MessageId, @@ -414,6 +434,10 @@ function createSnapshotWithLongProposedPlan(): OrchestrationReadModel { } function resolveWsRpc(body: WsRequestEnvelope["body"]): unknown { + const customResult = customWsRpcResolver?.(body); + if (customResult !== undefined) { + return customResult; + } const tag = body._tag; if (tag === ORCHESTRATION_WS_METHODS.getSnapshot) { return fixture.snapshot; @@ -748,9 +772,11 @@ async function mountChatView(options: { viewport: ViewportSpec; snapshot: OrchestrationReadModel; configureFixture?: (fixture: TestFixture) => void; + resolveRpc?: (body: WsRequestEnvelope["body"]) => unknown | undefined; }): Promise { fixture = buildFixture(options.snapshot); options.configureFixture?.(fixture); + customWsRpcResolver = options.resolveRpc ?? null; await setViewport(options.viewport); await waitForProductionStyles(); @@ -776,6 +802,7 @@ async function mountChatView(options: { await waitForLayout(); const cleanup = async () => { + customWsRpcResolver = null; await screen.unmount(); host.remove(); }; @@ -835,6 +862,7 @@ describe("ChatView timeline estimator parity (full app)", () => { localStorage.clear(); document.body.innerHTML = ""; wsRequests.length = 0; + customWsRpcResolver = null; useComposerDraftStore.setState({ draftsByThreadId: {}, draftThreadsByThreadId: {}, @@ -850,6 +878,7 @@ describe("ChatView timeline estimator parity (full app)", () => { }); afterEach(() => { + customWsRpcResolver = null; document.body.innerHTML = ""; }); @@ -1011,22 +1040,7 @@ describe("ChatView timeline estimator parity (full app)", () => { ); it("opens the project cwd for draft threads without a worktree path", async () => { - useComposerDraftStore.setState({ - draftThreadsByThreadId: { - [THREAD_ID]: { - projectId: PROJECT_ID, - createdAt: NOW_ISO, - runtimeMode: "full-access", - interactionMode: "default", - branch: null, - worktreePath: null, - envMode: "local", - }, - }, - projectDraftThreadIdByProjectId: { - [PROJECT_ID]: THREAD_ID, - }, - }); + setDraftThreadWithoutWorktree(); const mounted = await mountChatView({ viewport: DEFAULT_VIEWPORT, @@ -1067,6 +1081,153 @@ describe("ChatView timeline estimator parity (full app)", () => { } }); + it("opens the project cwd with VS Code Insiders when it is the only available editor", async () => { + setDraftThreadWithoutWorktree(); + + const mounted = await mountChatView({ + viewport: DEFAULT_VIEWPORT, + snapshot: createDraftOnlySnapshot(), + configureFixture: (nextFixture) => { + nextFixture.serverConfig = { + ...nextFixture.serverConfig, + availableEditors: ["vscode-insiders"], + }; + }, + }); + + try { + const openButton = await waitForElement( + () => + Array.from(document.querySelectorAll("button")).find( + (button) => button.textContent?.trim() === "Open", + ) as HTMLButtonElement | null, + "Unable to find Open button.", + ); + openButton.click(); + + await vi.waitFor( + () => { + const openRequest = wsRequests.find( + (request) => request._tag === WS_METHODS.shellOpenInEditor, + ); + expect(openRequest).toMatchObject({ + _tag: WS_METHODS.shellOpenInEditor, + cwd: "/repo/project", + editor: "vscode-insiders", + }); + }, + { timeout: 8_000, interval: 16 }, + ); + } finally { + await mounted.cleanup(); + } + }); + + it("filters the open picker menu and opens VSCodium from the menu", async () => { + setDraftThreadWithoutWorktree(); + + const mounted = await mountChatView({ + viewport: DEFAULT_VIEWPORT, + snapshot: createDraftOnlySnapshot(), + configureFixture: (nextFixture) => { + nextFixture.serverConfig = { + ...nextFixture.serverConfig, + availableEditors: ["vscode-insiders", "vscodium"], + }; + }, + }); + + try { + const menuButton = await waitForElement( + () => document.querySelector('button[aria-label="Copy options"]'), + "Unable to find Open picker button.", + ); + (menuButton as HTMLButtonElement).click(); + + await waitForElement( + () => + Array.from(document.querySelectorAll('[data-slot="menu-item"]')).find((item) => + item.textContent?.includes("VS Code Insiders"), + ) ?? null, + "Unable to find VS Code Insiders menu item.", + ); + + expect( + Array.from(document.querySelectorAll('[data-slot="menu-item"]')).some((item) => + item.textContent?.includes("Zed"), + ), + ).toBe(false); + + const vscodiumItem = await waitForElement( + () => + Array.from(document.querySelectorAll('[data-slot="menu-item"]')).find((item) => + item.textContent?.includes("VSCodium"), + ) ?? null, + "Unable to find VSCodium menu item.", + ); + (vscodiumItem as HTMLElement).click(); + + await vi.waitFor( + () => { + const openRequest = wsRequests.find( + (request) => request._tag === WS_METHODS.shellOpenInEditor, + ); + expect(openRequest).toMatchObject({ + _tag: WS_METHODS.shellOpenInEditor, + cwd: "/repo/project", + editor: "vscodium", + }); + }, + { timeout: 8_000, interval: 16 }, + ); + } finally { + await mounted.cleanup(); + } + }); + + it("falls back to the first installed editor when the stored favorite is unavailable", async () => { + localStorage.setItem("t3code:last-editor", "vscodium"); + setDraftThreadWithoutWorktree(); + + const mounted = await mountChatView({ + viewport: DEFAULT_VIEWPORT, + snapshot: createDraftOnlySnapshot(), + configureFixture: (nextFixture) => { + nextFixture.serverConfig = { + ...nextFixture.serverConfig, + availableEditors: ["vscode-insiders"], + }; + }, + }); + + try { + const openButton = await waitForElement( + () => + Array.from(document.querySelectorAll("button")).find( + (button) => button.textContent?.trim() === "Open", + ) as HTMLButtonElement | null, + "Unable to find Open button.", + ); + openButton.click(); + + await vi.waitFor( + () => { + const openRequest = wsRequests.find( + (request) => request._tag === WS_METHODS.shellOpenInEditor, + ); + expect(openRequest).toMatchObject({ + _tag: WS_METHODS.shellOpenInEditor, + cwd: "/repo/project", + editor: "vscode-insiders", + }); + }, + { timeout: 8_000, interval: 16 }, + ); + } finally { + await mounted.cleanup(); + } + }); + it("runs project scripts from local draft threads at the project cwd", async () => { useComposerDraftStore.setState({ draftThreadsByThreadId: { @@ -1206,6 +1367,154 @@ describe("ChatView timeline estimator parity (full app)", () => { } }); + it("runs setup scripts after preparing a pull request worktree thread", async () => { + useComposerDraftStore.setState({ + draftThreadsByThreadId: { + [THREAD_ID]: { + projectId: PROJECT_ID, + createdAt: NOW_ISO, + runtimeMode: "full-access", + interactionMode: "default", + branch: null, + worktreePath: null, + envMode: "local", + }, + }, + projectDraftThreadIdByProjectId: { + [PROJECT_ID]: THREAD_ID, + }, + }); + + const mounted = await mountChatView({ + viewport: DEFAULT_VIEWPORT, + snapshot: withProjectScripts(createDraftOnlySnapshot(), [ + { + id: "setup", + name: "Setup", + command: "bun install", + icon: "configure", + runOnWorktreeCreate: true, + }, + ]), + resolveRpc: (body) => { + if (body._tag === WS_METHODS.gitResolvePullRequest) { + return { + pullRequest: { + number: 1359, + title: "Add thread archiving and settings navigation", + url: "https://github.com/pingdotgg/t3code/pull/1359", + baseBranch: "main", + headBranch: "archive-settings-overhaul", + state: "open", + }, + }; + } + if (body._tag === WS_METHODS.gitPreparePullRequestThread) { + return { + pullRequest: { + number: 1359, + title: "Add thread archiving and settings navigation", + url: "https://github.com/pingdotgg/t3code/pull/1359", + baseBranch: "main", + headBranch: "archive-settings-overhaul", + state: "open", + }, + branch: "archive-settings-overhaul", + worktreePath: "/repo/worktrees/pr-1359", + }; + } + return undefined; + }, + }); + + try { + const branchButton = await waitForElement( + () => + Array.from(document.querySelectorAll("button")).find( + (button) => button.textContent?.trim() === "main", + ) as HTMLButtonElement | null, + "Unable to find branch selector button.", + ); + branchButton.click(); + + const branchInput = await waitForElement( + () => document.querySelector('input[placeholder="Search branches..."]'), + "Unable to find branch search input.", + ); + branchInput.focus(); + await page.getByPlaceholder("Search branches...").fill("1359"); + + const checkoutItem = await waitForElement( + () => + Array.from(document.querySelectorAll("span")).find( + (element) => element.textContent?.trim() === "Checkout Pull Request", + ) as HTMLSpanElement | null, + "Unable to find checkout pull request option.", + ); + checkoutItem.click(); + + const worktreeButton = await waitForElement( + () => + Array.from(document.querySelectorAll("button")).find( + (button) => button.textContent?.trim() === "Worktree", + ) as HTMLButtonElement | null, + "Unable to find Worktree button.", + ); + worktreeButton.click(); + + await vi.waitFor( + () => { + const prepareRequest = wsRequests.find( + (request) => request._tag === WS_METHODS.gitPreparePullRequestThread, + ); + expect(prepareRequest).toMatchObject({ + _tag: WS_METHODS.gitPreparePullRequestThread, + cwd: "/repo/project", + reference: "1359", + mode: "worktree", + }); + }, + { timeout: 8_000, interval: 16 }, + ); + + await vi.waitFor( + () => { + const openRequest = wsRequests.find( + (request) => + request._tag === WS_METHODS.terminalOpen && request.cwd === "/repo/worktrees/pr-1359", + ); + expect(openRequest).toMatchObject({ + _tag: WS_METHODS.terminalOpen, + threadId: expect.any(String), + cwd: "/repo/worktrees/pr-1359", + env: { + T3CODE_PROJECT_ROOT: "/repo/project", + T3CODE_WORKTREE_PATH: "/repo/worktrees/pr-1359", + }, + }); + }, + { timeout: 8_000, interval: 16 }, + ); + + await vi.waitFor( + () => { + const writeRequest = wsRequests.find( + (request) => + request._tag === WS_METHODS.terminalWrite && request.data === "bun install\r", + ); + expect(writeRequest).toMatchObject({ + _tag: WS_METHODS.terminalWrite, + threadId: expect.any(String), + data: "bun install\r", + }); + }, + { timeout: 8_000, interval: 16 }, + ); + } finally { + await mounted.cleanup(); + } + }); + it("toggles plan mode with Shift+Tab only while the composer is focused", async () => { const mounted = await mountChatView({ viewport: DEFAULT_VIEWPORT, diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index b0129ab75a..1d926bf308 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -239,6 +239,12 @@ interface ChatViewProps { threadId: ThreadId; } +interface PendingPullRequestSetupRequest { + threadId: ThreadId; + worktreePath: string; + scriptId: string; +} + export default function ChatView({ threadId }: ChatViewProps) { const threads = useStore((store) => store.threads); const projects = useStore((store) => store.projects); @@ -350,6 +356,8 @@ export default function ChatView({ threadId }: ChatViewProps) { const [composerHighlightedItemId, setComposerHighlightedItemId] = useState(null); const [pullRequestDialogState, setPullRequestDialogState] = useState(null); + const [pendingPullRequestSetupRequest, setPendingPullRequestSetupRequest] = + useState(null); const [attachmentPreviewHandoffByMessageId, setAttachmentPreviewHandoffByMessageId] = useState< Record >({}); @@ -527,14 +535,14 @@ export default function ChatView({ threadId }: ChatViewProps) { params: { threadId: storedDraftThread.threadId }, }); } - return; + return storedDraftThread.threadId; } const activeDraftThread = getDraftThread(threadId); if (!isServerThread && activeDraftThread?.projectId === activeProject.id) { setDraftThreadContext(threadId, input); setProjectDraftThreadId(activeProject.id, threadId, input); - return; + return threadId; } clearProjectDraftThreadId(activeProject.id); @@ -549,6 +557,7 @@ export default function ChatView({ threadId }: ChatViewProps) { to: "/$threadId", params: { threadId: nextThreadId }, }); + return nextThreadId; }, [ activeProject, @@ -565,13 +574,24 @@ export default function ChatView({ threadId }: ChatViewProps) { const handlePreparedPullRequestThread = useCallback( async (input: { branch: string; worktreePath: string | null }) => { - await openOrReuseProjectDraftThread({ + const targetThreadId = await openOrReuseProjectDraftThread({ branch: input.branch, worktreePath: input.worktreePath, envMode: input.worktreePath ? "worktree" : "local", }); + const setupScript = + input.worktreePath && activeProject ? setupProjectScript(activeProject.scripts) : null; + if (targetThreadId && input.worktreePath && setupScript) { + setPendingPullRequestSetupRequest({ + threadId: targetThreadId, + worktreePath: input.worktreePath, + scriptId: setupScript.id, + }); + } else { + setPendingPullRequestSetupRequest(null); + } }, - [openOrReuseProjectDraftThread], + [activeProject, openOrReuseProjectDraftThread], ); useEffect(() => { @@ -1418,6 +1438,45 @@ export default function ChatView({ threadId }: ChatViewProps) { terminalState.terminalIds, ], ); + + useEffect(() => { + if (!pendingPullRequestSetupRequest || !activeProject || !activeThreadId || !activeThread) { + return; + } + if (pendingPullRequestSetupRequest.threadId !== activeThreadId) { + return; + } + if (activeThread.worktreePath !== pendingPullRequestSetupRequest.worktreePath) { + return; + } + + const setupScript = + activeProject.scripts.find( + (script) => script.id === pendingPullRequestSetupRequest.scriptId, + ) ?? null; + setPendingPullRequestSetupRequest(null); + if (!setupScript) { + return; + } + + void runProjectScript(setupScript, { + cwd: pendingPullRequestSetupRequest.worktreePath, + worktreePath: pendingPullRequestSetupRequest.worktreePath, + rememberAsLastInvoked: false, + }).catch((error) => { + toastManager.add({ + type: "error", + title: "Failed to run setup script.", + description: error instanceof Error ? error.message : "An error occurred.", + }); + }); + }, [ + activeProject, + activeThread, + activeThreadId, + pendingPullRequestSetupRequest, + runProjectScript, + ]); const persistProjectScripts = useCallback( async (input: { projectId: ProjectId; diff --git a/apps/web/src/components/GitActionsControl.tsx b/apps/web/src/components/GitActionsControl.tsx index 09b84444e2..1593a151da 100644 --- a/apps/web/src/components/GitActionsControl.tsx +++ b/apps/web/src/components/GitActionsControl.tsx @@ -765,7 +765,7 @@ export default function GitActionsControl({ gitCwd, activeThreadId }: GitActions } > - + {quickAction.label} @@ -781,12 +781,12 @@ export default function GitActionsControl({ gitCwd, activeThreadId }: GitActions onClick={runQuickAction} > - + {quickAction.label} )} - + { if (open) void invalidateGitQueries(queryClient); diff --git a/apps/web/src/components/ProjectScriptsControl.tsx b/apps/web/src/components/ProjectScriptsControl.tsx index 4d6c5eef78..11b08cc2cf 100644 --- a/apps/web/src/components/ProjectScriptsControl.tsx +++ b/apps/web/src/components/ProjectScriptsControl.tsx @@ -277,11 +277,11 @@ export default function ProjectScriptsControl({ title={`Run ${primaryScript.name}`} > - + {primaryScript.name} - + } @@ -342,7 +342,7 @@ export default function ProjectScriptsControl({ ) : ( diff --git a/apps/web/src/components/PullRequestThreadDialog.tsx b/apps/web/src/components/PullRequestThreadDialog.tsx index 8b1ed51220..2a69facd10 100644 --- a/apps/web/src/components/PullRequestThreadDialog.tsx +++ b/apps/web/src/components/PullRequestThreadDialog.tsx @@ -153,9 +153,9 @@ export function PullRequestThreadDialog({ const validationMessage = !referenceDirty ? null : reference.trim().length === 0 - ? "Paste a GitHub pull request URL or enter 123 / #123." + ? "Paste a GitHub pull request URL, `gh pr checkout 123`, or enter 123 / #123." : parsedReference === null - ? "Use a GitHub pull request URL, 123, or #123." + ? "Use a GitHub pull request URL, `gh pr checkout 123`, 123, or #123." : null; const errorMessage = validationMessage ?? @@ -191,7 +191,7 @@ export function PullRequestThreadDialog({ Pull request { setReferenceDirty(true); diff --git a/apps/web/src/components/chat/ChatHeader.tsx b/apps/web/src/components/chat/ChatHeader.tsx index 39a4f6eedc..f04c9879fa 100644 --- a/apps/web/src/components/chat/ChatHeader.tsx +++ b/apps/web/src/components/chat/ChatHeader.tsx @@ -62,7 +62,7 @@ export const ChatHeader = memo(function ChatHeader({ onToggleDiff, }: ChatHeaderProps) { return ( -
+

{activeProjectName && ( - - {activeProjectName} + + {activeProjectName} )} {activeProjectName && !isGitRepo && ( @@ -82,7 +82,7 @@ export const ChatHeader = memo(function ChatHeader({ )}

-
+
{activeProjectScripts && ( openInEditor(preferredEditor)} > {primaryOption?.Icon &&