Skip to content

Commit a6e1f2e

Browse files
authored
Merge pull request #87 from AltimateAI/merge/upstream-v1.2.20
chore: merge upstream opencode v1.2.20
2 parents 6f9720e + 89b6c44 commit a6e1f2e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+1060
-400
lines changed

bun.lock

Lines changed: 32 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type { Context as GitHubContext } from "@actions/github/lib/context"
88
import type { IssueCommentEvent, PullRequestReviewCommentEvent } from "@octokit/webhooks-types"
99
import { createOpencodeClient } from "@opencode-ai/sdk"
1010
import { spawn } from "node:child_process"
11+
import { setTimeout as sleep } from "node:timers/promises"
1112

1213
type GitHubAuthor = {
1314
login: string
@@ -281,7 +282,7 @@ async function assertOpencodeConnected() {
281282
connected = true
282283
break
283284
} catch (e) {}
284-
await Bun.sleep(300)
285+
await sleep(300)
285286
} while (retry++ < 30)
286287

287288
if (!connected) {

nix/hashes.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"nodeModules": {
3-
"x86_64-linux": "sha256-v83hWzYVg/g4zJiBpGsQ71wTdndPk3BQVZ2mjMApUIQ=",
4-
"aarch64-linux": "sha256-inpMwkQqwBFP2wL8w/pTOP7q3fg1aOqvE0wgzVd3/B8=",
5-
"aarch64-darwin": "sha256-r42LGrQWqDyIy62mBSU5Nf3M22dJ3NNo7mjN/1h8d8Y=",
6-
"x86_64-darwin": "sha256-J6XrrdK5qBK3sQBQOO/B3ZluOnsAf5f65l4q/K1nDTI="
3+
"x86_64-linux": "sha256-pBTIT8Pgdm3272YhBjiAZsmj0SSpHTklh6lGc8YcMoE=",
4+
"aarch64-linux": "sha256-prt039++d5UZgtldAN6+RVOR557ifIeusiy5XpzN8QU=",
5+
"aarch64-darwin": "sha256-Y3f+cXcIGLqz6oyc5fG22t6CLD4wGkvwqO6RNXjFriQ=",
6+
"x86_64-darwin": "sha256-BjbBBhQUgGhrlP56skABcrObvutNUZSWnrnPCg1OTKE="
77
}
88
}

packages/app/e2e/actions.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ export async function createTestProject() {
197197
await fs.writeFile(path.join(root, "README.md"), "# e2e\n")
198198

199199
execSync("git init", { cwd: root, stdio: "ignore" })
200+
execSync("git config core.fsmonitor false", { cwd: root, stdio: "ignore" })
200201
execSync("git add -A", { cwd: root, stdio: "ignore" })
201202
execSync('git -c user.name="e2e" -c user.email="e2e@example.com" commit -m "init" --allow-empty', {
202203
cwd: root,
@@ -207,7 +208,10 @@ export async function createTestProject() {
207208
}
208209

209210
export async function cleanupTestProject(directory: string) {
210-
await fs.rm(directory, { recursive: true, force: true }).catch(() => undefined)
211+
try {
212+
execSync("git fsmonitor--daemon stop", { cwd: directory, stdio: "ignore" })
213+
} catch {}
214+
await fs.rm(directory, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 }).catch(() => undefined)
211215
}
212216

213217
export function sessionIDFromUrl(url: string) {

packages/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opencode-ai/app",
3-
"version": "1.2.18",
3+
"version": "1.2.20",
44
"description": "",
55
"type": "module",
66
"exports": {

packages/app/src/pages/layout.tsx

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { ResizeHandle } from "@opencode-ai/ui/resize-handle"
2222
import { Button } from "@opencode-ai/ui/button"
2323
import { Icon } from "@opencode-ai/ui/icon"
2424
import { IconButton } from "@opencode-ai/ui/icon-button"
25-
import { Tooltip, TooltipKeybind } from "@opencode-ai/ui/tooltip"
25+
import { Tooltip } from "@opencode-ai/ui/tooltip"
2626
import { DropdownMenu } from "@opencode-ai/ui/dropdown-menu"
2727
import { Dialog } from "@opencode-ai/ui/dialog"
2828
import { getFilename } from "@opencode-ai/util/path"
@@ -1937,20 +1937,14 @@ export default function Layout(props: ParentProps) {
19371937
fallback={
19381938
<>
19391939
<div class="shrink-0 py-4 px-3">
1940-
<TooltipKeybind
1941-
title={language.t("command.session.new")}
1942-
keybind={command.keybind("session.new")}
1943-
placement="top"
1940+
<Button
1941+
size="large"
1942+
icon="plus-small"
1943+
class="w-full"
1944+
onClick={() => navigateWithSidebarReset(`/${base64Encode(p.worktree)}/session`)}
19441945
>
1945-
<Button
1946-
size="large"
1947-
icon="plus-small"
1948-
class="w-full"
1949-
onClick={() => navigateWithSidebarReset(`/${base64Encode(p.worktree)}/session`)}
1950-
>
1951-
{language.t("command.session.new")}
1952-
</Button>
1953-
</TooltipKeybind>
1946+
{language.t("command.session.new")}
1947+
</Button>
19541948
</div>
19551949
<div class="flex-1 min-h-0">
19561950
<LocalWorkspace
@@ -1965,15 +1959,9 @@ export default function Layout(props: ParentProps) {
19651959
>
19661960
<>
19671961
<div class="shrink-0 py-4 px-3">
1968-
<TooltipKeybind
1969-
title={language.t("workspace.new")}
1970-
keybind={command.keybind("workspace.new")}
1971-
placement="top"
1972-
>
1973-
<Button size="large" icon="plus-small" class="w-full" onClick={() => createWorkspace(p)}>
1974-
{language.t("workspace.new")}
1975-
</Button>
1976-
</TooltipKeybind>
1962+
<Button size="large" icon="plus-small" class="w-full" onClick={() => createWorkspace(p)}>
1963+
{language.t("workspace.new")}
1964+
</Button>
19771965
</div>
19781966
<div class="relative flex-1 min-h-0">
19791967
<DragDropProvider

packages/app/src/pages/session.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,7 @@ export default function Page() {
720720
showAllFiles,
721721
tabForPath: file.tab,
722722
openTab: tabs().open,
723+
setActive: tabs().setActive,
723724
loadFile: file.load,
724725
})
725726

packages/app/src/pages/session/helpers.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ describe("createOpenReviewFile", () => {
1111
return `file://${path}`
1212
},
1313
openTab: (tab) => calls.push(`open:${tab}`),
14+
setActive: (tab) => calls.push(`active:${tab}`),
1415
loadFile: (path) => calls.push(`load:${path}`),
1516
})
1617

1718
openReviewFile("src/a.ts")
1819

19-
expect(calls).toEqual(["show", "load:src/a.ts", "tab:src/a.ts", "open:file://src/a.ts"])
20+
expect(calls).toEqual(["show", "load:src/a.ts", "tab:src/a.ts", "open:file://src/a.ts", "active:file://src/a.ts"])
2021
})
2122
})
2223

packages/app/src/pages/session/helpers.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,20 @@ export const createOpenReviewFile = (input: {
2424
showAllFiles: () => void
2525
tabForPath: (path: string) => string
2626
openTab: (tab: string) => void
27+
setActive: (tab: string) => void
2728
loadFile: (path: string) => any | Promise<void>
2829
}) => {
2930
return (path: string) => {
3031
batch(() => {
3132
input.showAllFiles()
3233
const maybePromise = input.loadFile(path)
33-
const openTab = () => input.openTab(input.tabForPath(path))
34-
if (maybePromise instanceof Promise) maybePromise.then(openTab)
35-
else openTab()
34+
const open = () => {
35+
const tab = input.tabForPath(path)
36+
input.openTab(tab)
37+
input.setActive(tab)
38+
}
39+
if (maybePromise instanceof Promise) maybePromise.then(open)
40+
else open()
3641
})
3742
}
3843
}

0 commit comments

Comments
 (0)