Skip to content

Commit b8fdbb8

Browse files
opencode-agent[bot]kitlangtonthdxrrekram1-nodeusrnk1
authored
chore(release): promote dev to production (#55264)
Co-authored-by: Kit Langton <kit.langton@gmail.com> Co-authored-by: Dax <mail@thdxr.com> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Co-authored-by: usrnk1 <7547651+usrnk1@users.noreply.github.com> Co-authored-by: LukeParkerDev <10430890+Hona@users.noreply.github.com> Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com> Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com> Co-authored-by: Slickstef11 <98915060+Slickstef11@users.noreply.github.com> Co-authored-by: 1052326311 <65798732+1052326311@users.noreply.github.com>
1 parent e9def88 commit b8fdbb8

97 files changed

Lines changed: 5265 additions & 1852 deletions

File tree

Some content is hidden

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

‎bun.lock‎

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

‎nix/hashes.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"nodeModules": {
3-
"x86_64-linux": "sha256-41b9FJaGRnezYwKLyBTHlJw69OX4bBP8kF6mRKqbbVQ=",
4-
"aarch64-linux": "sha256-O8FzCskkOWpTtTHyJpOw2t4/LqA3geahG35TH71ElSY=",
5-
"aarch64-darwin": "sha256-bD2PVCF1nx/+dKKWCd2qC+ka34pNzrA7HNv7U3L+em0="
3+
"x86_64-linux": "sha256-G+C40h8bzdZBERZg945GyC79kvO9joY4u8WVYUbJbDQ=",
4+
"aarch64-linux": "sha256-z3iVkmxKslz52myQmZHNdbw7E1UCCoyEIguDhqwSB0w=",
5+
"aarch64-darwin": "sha256-w9+aQ1R33RCSm6oXOLyOaXTX+/XMSdVOwGeUFseC3bs="
66
}
77
}

‎package.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
"@octokit/rest": "22.0.0",
5555
"@hono/standard-validator": "0.2.0",
5656
"@hono/zod-validator": "0.4.2",
57-
"@opentui/core": "0.6.2",
58-
"@opentui/keymap": "0.6.2",
59-
"@opentui/solid": "0.6.2",
57+
"@opentui/core": "0.6.3",
58+
"@opentui/keymap": "0.6.3",
59+
"@opentui/solid": "0.6.3",
6060
"@tanstack/solid-virtual": "3.13.37",
6161
"@shikijs/stream": "4.4.3",
6262
"@standard-schema/spec": "1.1.0",

‎packages/app/component-tests/browser-pane-restore.spec.ts‎

Lines changed: 109 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import { expect, sourceURL, story } from "../../storybook/playwright/story"
2+
import type { ParentProps } from "solid-js"
3+
import type { Command } from "@opencode/gui-extensions/sdk"
4+
import type { Item } from "../src/runtime/extension/host"
25

36
const source = (path: string) => sourceURL(new URL(path, import.meta.url))
47

@@ -9,21 +12,49 @@ const modules = {
912
language: source("../src/runtime/i18n/language.tsx"),
1013
browser: source("../../gui-extensions/src/browser/index.ts"),
1114
browserRenderer: source("../../gui-extensions/src/browser/renderer.tsx"),
15+
browserPanel: source("../../gui-extensions/src/browser/panel.tsx"),
1216
file: source("../../gui-extensions/src/file/index.ts"),
1317
fileRenderer: source("../../gui-extensions/src/file/renderer.tsx"),
18+
commands: source("../src/shell/commands/command.tsx"),
19+
sdk: source("../../gui-extensions/src/sdk/index.ts"),
20+
render: source("../src/runtime/extension/render.tsx"),
21+
settings: source("../src/settings/model.tsx"),
22+
platform: source("../src/runtime/platform/platform.tsx"),
23+
solid: source("./extension-host.fixture.tsx"),
1424
}
1525

1626
story.beforeEach(async ({ mount, page }) => {
1727
// Any story loads the app styles; the fixture mounts the real side region and extensions beside it.
1828
await mount("ui-line-comment--editor")
1929
await page.evaluate(async (modules) => {
20-
const [{ mountBrowserRegion }, host, panels, language, browser, file] = await Promise.all([
30+
const [
31+
{ mountBrowserRegion },
32+
host,
33+
panels,
34+
language,
35+
browser,
36+
file,
37+
commands,
38+
sdk,
39+
renderer,
40+
settings,
41+
platform,
42+
solid,
43+
] = await Promise.all([
2144
import(modules.fixture),
2245
import(modules.host),
2346
import(modules.panels),
2447
import(modules.language),
2548
import(modules.browser),
2649
import(modules.file),
50+
import(modules.commands),
51+
import(modules.sdk),
52+
import(modules.render),
53+
import(modules.settings),
54+
import(modules.platform),
55+
import(modules.solid),
56+
// Load the pane before mounting: Vite must not reload the page to optimize its dependencies mid-fixture.
57+
import(modules.browserPanel),
2758
])
2859

2960
mountBrowserRegion({
@@ -35,10 +66,87 @@ story.beforeEach(async ({ mount, page }) => {
3566
{ ...browser.default, renderer: () => import(modules.browserRenderer) },
3667
{ ...file.default, renderer: () => import(modules.fileRenderer) },
3768
],
69+
Shell: (props: ParentProps) =>
70+
solid.createComponent(platform.PlatformProvider, {
71+
value: { platform: "web", openExternal() {}, restart: async () => undefined, notify: async () => undefined },
72+
get children() {
73+
return solid.createComponent(settings.SettingsProvider, {
74+
get children() {
75+
return solid.createComponent(commands.CommandProvider, {
76+
get children() {
77+
return props.children
78+
},
79+
})
80+
},
81+
})
82+
},
83+
}),
84+
Commands: (props: { close: () => void }) => {
85+
const command = commands.useCommand()
86+
const extensions = host.useExtensionHost()
87+
command.register("fixture-session", () => [
88+
{
89+
id: "tab.close",
90+
title: "Close session tab",
91+
keybind: "mod+w",
92+
onSelect: props.close,
93+
},
94+
])
95+
// Storybook aliases the app's command hook to a no-op. Bridge the real extension contributions
96+
// to the real dispatcher imported by source URL, so the shortcut runs rather than its alias.
97+
command.register("fixture-extensions", () =>
98+
extensions.items(sdk.Command).map((item: Item<Command>) => {
99+
const scope = item.value.scope
100+
101+
return {
102+
id: `${item.extension}.${item.value.id}`,
103+
title: item.value.title,
104+
keybind: item.value.bind,
105+
disabled: item.value.enabled === false,
106+
hidden: item.value.hidden,
107+
editable: item.value.editable,
108+
when: scope
109+
? (event: KeyboardEvent) => event.target instanceof Element && !!event.target.closest(scope)
110+
: undefined,
111+
onSelect: () => item.value.run(),
112+
}
113+
}),
114+
)
115+
116+
return null
117+
},
118+
Contribution: renderer.Contribution,
38119
})
39120
}, modules)
40121
})
41122

123+
story("closes a blank browser tab from its address field without closing the session", async ({ page }) => {
124+
const root = page.getByTestId("browser-region-fixture")
125+
const outside = root.getByRole("button", { name: "Beta", exact: true })
126+
await expect(root.getByText("Registrations: 1", { exact: true })).toBeVisible()
127+
await outside.click()
128+
await expect(root.getByText("Registrations: 2", { exact: true })).toBeVisible()
129+
await root.getByRole("button", { name: "Blank page", exact: true }).click()
130+
await expect(root.getByRole("tab", { name: "New tab", exact: true })).toHaveAttribute("aria-selected", "true")
131+
132+
// Prove the scope while browser.close is still registered.
133+
await outside.focus()
134+
await outside.press("ControlOrMeta+w")
135+
await expect(root.getByTestId("session-state")).toHaveText("closed")
136+
await expect(root.getByTestId("browser-closes")).toHaveText("[]")
137+
await expect(root.getByRole("tab", { name: "New tab", exact: true })).toBeVisible()
138+
await outside.click()
139+
await expect(root.getByTestId("session-state")).toHaveText("open")
140+
141+
const address = root.getByRole("combobox", { name: "Browser address", exact: true })
142+
await address.fill("example.com")
143+
await expect(address).toBeFocused()
144+
await address.press("ControlOrMeta+w")
145+
await expect(root.getByRole("tab", { name: "New tab", exact: true })).toHaveCount(0)
146+
await expect(root.getByTestId("browser-closes")).toHaveText('["tab_33333333-3333-3333-3333-333333333333"]')
147+
await expect(root.getByTestId("session-state")).toHaveText("open")
148+
})
149+
42150
story("keeps a restored browser tab selected and undrawn until the desktop's first inventory", async ({ page }) => {
43151
const root = page.getByTestId("browser-region-fixture")
44152
const tabs = root.getByRole("tab")

0 commit comments

Comments
 (0)