Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
bit-pm
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
燕伟桐
bit-pm
Commits
a9353638
Unverified
提交
a9353638
authored
7月 08, 2025
作者:
Will Chen
提交者:
GitHub
7月 08, 2025
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support Beta release channel (#591)
上级
ab6a9d3b
显示空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
195 行增加
和
2 行删除
+195
-2
test_helper.ts
e2e-tests/helpers/test_helper.ts
+9
-0
release_channel.spec.ts
e2e-tests/release_channel.spec.ts
+22
-0
auto_update.spec.ts_auto-update---disable-and-enable-1.txt
...uto_update.spec.ts_auto-update---disable-and-enable-1.txt
+2
-0
auto_update.spec.ts_auto-update---disable-and-enable-2.txt
...uto_update.spec.ts_auto-update---disable-and-enable-2.txt
+2
-0
context_window.spec.ts_context-window-4.txt
...sts/snapshots/context_window.spec.ts_context-window-4.txt
+2
-0
release_channel.spec.ts_release-channel---change-from-stable-to-beta-and-back-1.txt
...lease-channel---change-from-stable-to-beta-and-back-1.txt
+20
-0
release_channel.spec.ts_release-channel---change-from-stable-to-beta-and-back-2.txt
...lease-channel---change-from-stable-to-beta-and-back-2.txt
+20
-0
telemetry.spec.ts_telemetry---accept-1.txt
...ests/snapshots/telemetry.spec.ts_telemetry---accept-1.txt
+2
-0
telemetry.spec.ts_telemetry---accept-2.txt
...ests/snapshots/telemetry.spec.ts_telemetry---accept-2.txt
+2
-0
telemetry.spec.ts_telemetry---later-1.txt
...tests/snapshots/telemetry.spec.ts_telemetry---later-1.txt
+2
-0
telemetry.spec.ts_telemetry---later-2.txt
...tests/snapshots/telemetry.spec.ts_telemetry---later-2.txt
+2
-0
telemetry.spec.ts_telemetry---reject-1.txt
...ests/snapshots/telemetry.spec.ts_telemetry---reject-1.txt
+2
-0
telemetry.spec.ts_telemetry---reject-2.txt
...ests/snapshots/telemetry.spec.ts_telemetry---reject-2.txt
+2
-0
thinking_budget.spec.ts_thinking-budget-1.txt
...s/snapshots/thinking_budget.spec.ts_thinking-budget-1.txt
+2
-0
thinking_budget.spec.ts_thinking-budget-3.txt
...s/snapshots/thinking_budget.spec.ts_thinking-budget-3.txt
+2
-0
thinking_budget.spec.ts_thinking-budget-5.txt
...s/snapshots/thinking_budget.spec.ts_thinking-budget-5.txt
+2
-0
ReleaseChannelSelector.tsx
src/components/ReleaseChannelSelector.tsx
+76
-0
schemas.ts
src/lib/schemas.ts
+4
-0
main.ts
src/main.ts
+14
-2
settings.ts
src/main/settings.ts
+1
-0
settings.tsx
src/pages/settings.tsx
+5
-0
没有找到文件。
e2e-tests/helpers/test_helper.ts
浏览文件 @
a9353638
...
...
@@ -837,6 +837,15 @@ export class PageObject {
await
this
.
page
.
getByRole
(
"switch"
,
{
name
:
"Auto-update"
}).
click
();
}
async
changeReleaseChannel
(
channel
:
"stable"
|
"beta"
)
{
// await page.getByRole('combobox').filter({ hasText: 'Stable' }).click();
// await page.getByRole('option', { name: 'Beta' }).dblclick();
await
this
.
page
.
getByRole
(
"combobox"
,
{
name
:
"Release Channel"
}).
click
();
await
this
.
page
.
getByRole
(
"option"
,
{
name
:
channel
===
"stable"
?
"Stable"
:
"Beta"
})
.
click
();
}
async
clickTelemetryAccept
()
{
await
this
.
page
.
getByTestId
(
"telemetry-accept-button"
).
click
();
}
...
...
e2e-tests/release_channel.spec.ts
0 → 100644
浏览文件 @
a9353638
import
{
expect
}
from
"@playwright/test"
;
import
{
test
}
from
"./helpers/test_helper"
;
test
(
"release channel - change from stable to beta and back"
,
async
({
po
,
})
=>
{
await
po
.
goToSettingsTab
();
// Change to beta channel
await
po
.
changeReleaseChannel
(
"beta"
);
await
expect
(
po
.
page
.
getByRole
(
"button"
,
{
name
:
"Restart Dyad"
}),
).
toBeVisible
();
await
po
.
snapshotSettings
();
// Change back to stable channel
await
po
.
changeReleaseChannel
(
"stable"
);
await
expect
(
po
.
page
.
getByRole
(
"button"
,
{
name
:
"Download Stable"
}),
).
toBeVisible
();
await
po
.
snapshotSettings
();
});
e2e-tests/snapshots/auto_update.spec.ts_auto-update---disable-and-enable-1.txt
浏览文件 @
a9353638
...
...
@@ -14,5 +14,6 @@
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": false,
"releaseChannel": "stable",
"isTestMode": true
}
\ No newline at end of file
e2e-tests/snapshots/auto_update.spec.ts_auto-update---disable-and-enable-2.txt
浏览文件 @
a9353638
...
...
@@ -14,5 +14,6 @@
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isTestMode": true
}
\ No newline at end of file
e2e-tests/snapshots/context_window.spec.ts_context-window-4.txt
浏览文件 @
a9353638
...
...
@@ -16,5 +16,6 @@
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isTestMode": true
}
\ No newline at end of file
e2e-tests/snapshots/release_channel.spec.ts_release-channel---change-from-stable-to-beta-and-back-1.txt
0 → 100644
浏览文件 @
a9353638
{
"selectedModel": {
"name": "auto",
"provider": "auto"
},
"providerSettings": {},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "beta",
"isTestMode": true
}
\ No newline at end of file
e2e-tests/snapshots/release_channel.spec.ts_release-channel---change-from-stable-to-beta-and-back-2.txt
0 → 100644
浏览文件 @
a9353638
{
"selectedModel": {
"name": "auto",
"provider": "auto"
},
"providerSettings": {},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isTestMode": true
}
\ No newline at end of file
e2e-tests/snapshots/telemetry.spec.ts_telemetry---accept-1.txt
浏览文件 @
a9353638
...
...
@@ -13,5 +13,6 @@
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isTestMode": true
}
\ No newline at end of file
e2e-tests/snapshots/telemetry.spec.ts_telemetry---accept-2.txt
浏览文件 @
a9353638
...
...
@@ -14,5 +14,6 @@
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isTestMode": true
}
\ No newline at end of file
e2e-tests/snapshots/telemetry.spec.ts_telemetry---later-1.txt
浏览文件 @
a9353638
...
...
@@ -13,5 +13,6 @@
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isTestMode": true
}
\ No newline at end of file
e2e-tests/snapshots/telemetry.spec.ts_telemetry---later-2.txt
浏览文件 @
a9353638
...
...
@@ -14,5 +14,6 @@
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isTestMode": true
}
\ No newline at end of file
e2e-tests/snapshots/telemetry.spec.ts_telemetry---reject-1.txt
浏览文件 @
a9353638
...
...
@@ -13,5 +13,6 @@
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isTestMode": true
}
\ No newline at end of file
e2e-tests/snapshots/telemetry.spec.ts_telemetry---reject-2.txt
浏览文件 @
a9353638
...
...
@@ -14,5 +14,6 @@
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isTestMode": true
}
\ No newline at end of file
e2e-tests/snapshots/thinking_budget.spec.ts_thinking-budget-1.txt
浏览文件 @
a9353638
...
...
@@ -23,5 +23,6 @@
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isTestMode": true
}
\ No newline at end of file
e2e-tests/snapshots/thinking_budget.spec.ts_thinking-budget-3.txt
浏览文件 @
a9353638
...
...
@@ -23,5 +23,6 @@
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isTestMode": true
}
\ No newline at end of file
e2e-tests/snapshots/thinking_budget.spec.ts_thinking-budget-5.txt
浏览文件 @
a9353638
...
...
@@ -23,5 +23,6 @@
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isTestMode": true
}
\ No newline at end of file
src/components/ReleaseChannelSelector.tsx
0 → 100644
浏览文件 @
a9353638
import
{
useSettings
}
from
"@/hooks/useSettings"
;
import
{
Select
,
SelectContent
,
SelectItem
,
SelectTrigger
,
SelectValue
,
}
from
"@/components/ui/select"
;
import
{
toast
}
from
"sonner"
;
import
{
IpcClient
}
from
"@/ipc/ipc_client"
;
import
type
{
ReleaseChannel
}
from
"@/lib/schemas"
;
export
function
ReleaseChannelSelector
()
{
const
{
settings
,
updateSettings
}
=
useSettings
();
if
(
!
settings
)
{
return
null
;
}
const
handleReleaseChannelChange
=
(
value
:
ReleaseChannel
)
=>
{
updateSettings
({
releaseChannel
:
value
});
if
(
value
===
"stable"
)
{
toast
(
"Using Stable release channel"
,
{
description
:
"You'll stay on your current version until a newer stable release is available, or you can manually downgrade now."
,
action
:
{
label
:
"Download Stable"
,
onClick
:
()
=>
{
IpcClient
.
getInstance
().
openExternalUrl
(
"https://dyad.sh/download"
);
},
},
});
}
else
{
toast
(
"Using Beta release channel"
,
{
description
:
"You will need to restart Dyad for your settings to take effect."
,
action
:
{
label
:
"Restart Dyad"
,
onClick
:
()
=>
{
IpcClient
.
getInstance
().
restartDyad
();
},
},
});
}
};
return
(
<
div
className=
"space-y-1"
>
<
div
className=
"flex items-center space-x-2"
>
<
label
htmlFor=
"release-channel"
className=
"text-sm font-medium text-gray-700 dark:text-gray-300"
>
Release Channel
</
label
>
<
Select
value=
{
settings
.
releaseChannel
}
onValueChange=
{
handleReleaseChannelChange
}
>
<
SelectTrigger
className=
"w-32"
id=
"release-channel"
>
<
SelectValue
/>
</
SelectTrigger
>
<
SelectContent
>
<
SelectItem
value=
"stable"
>
Stable
</
SelectItem
>
<
SelectItem
value=
"beta"
>
Beta
</
SelectItem
>
</
SelectContent
>
</
Select
>
</
div
>
<
div
className=
"text-sm text-gray-500 dark:text-gray-400"
>
<
p
>
Stable is recommended for most users.
</
p
>
<
p
>
Beta receives more frequent updates but may have more bugs.
</
p
>
</
div
>
</
div
>
);
}
src/lib/schemas.ts
浏览文件 @
a9353638
...
...
@@ -125,6 +125,9 @@ export type ContextPathResults = {
smartContextAutoIncludes
:
ContextPathResult
[];
};
export
const
ReleaseChannelSchema
=
z
.
enum
([
"stable"
,
"beta"
]);
export
type
ReleaseChannel
=
z
.
infer
<
typeof
ReleaseChannelSchema
>
;
/**
* Zod schema for user settings
*/
...
...
@@ -152,6 +155,7 @@ export const UserSettingsSchema = z.object({
enableAutoFixProblems
:
z
.
boolean
().
optional
(),
enableNativeGit
:
z
.
boolean
().
optional
(),
enableAutoUpdate
:
z
.
boolean
(),
releaseChannel
:
ReleaseChannelSchema
,
////////////////////////////////
// E2E TESTING ONLY.
...
...
src/main.ts
浏览文件 @
a9353638
...
...
@@ -4,7 +4,7 @@ import { registerIpcHandlers } from "./ipc/ipc_host";
import
dotenv
from
"dotenv"
;
// @ts-ignore
import
started
from
"electron-squirrel-startup"
;
import
{
updateElectronApp
}
from
"update-electron-app"
;
import
{
updateElectronApp
,
UpdateSourceType
}
from
"update-electron-app"
;
import
log
from
"electron-log"
;
import
{
readSettings
,
writeSettings
}
from
"./main/settings"
;
import
{
handleSupabaseOAuthReturn
}
from
"./supabase_admin/supabase_return_handler"
;
...
...
@@ -20,7 +20,19 @@ const logger = log.scope("main");
// Check settings before enabling auto-update
const
settings
=
readSettings
();
if
(
settings
.
enableAutoUpdate
)
{
updateElectronApp
({
logger
});
// additional configuration options available
// Technically we could just pass the releaseChannel directly to the host,
// but this is more explicit and falls back to stable if there's an unknown
// release channel.
const
postfix
=
settings
.
releaseChannel
===
"beta"
?
"beta"
:
"stable"
;
const
host
=
`https://api.dyad.sh/v1/update/
${
postfix
}
`
;
updateElectronApp
({
logger
,
updateSource
:
{
type
:
UpdateSourceType
.
ElectronPublicUpdateService
,
repo
:
"dyad-sh/dyad"
,
host
,
},
});
// additional configuration options available
}
// Load environment variables from .env file
...
...
src/main/settings.ts
浏览文件 @
a9353638
...
...
@@ -22,6 +22,7 @@ const DEFAULT_SETTINGS: UserSettings = {
selectedChatMode
:
"build"
,
enableAutoFixProblems
:
false
,
enableAutoUpdate
:
true
,
releaseChannel
:
"stable"
,
};
const
SETTINGS_FILE
=
"user-settings.json"
;
...
...
src/pages/settings.tsx
浏览文件 @
a9353638
...
...
@@ -19,6 +19,7 @@ import { Switch } from "@/components/ui/switch";
import
{
Label
}
from
"@/components/ui/label"
;
import
{
AutoFixProblemsSwitch
}
from
"@/components/AutoFixProblemsSwitch"
;
import
{
AutoUpdateSwitch
}
from
"@/components/AutoUpdateSwitch"
;
import
{
ReleaseChannelSelector
}
from
"@/components/ReleaseChannelSelector"
;
export
default
function
SettingsPage
()
{
const
[
isResetDialogOpen
,
setIsResetDialogOpen
]
=
useState
(
false
);
...
...
@@ -270,6 +271,10 @@ export function GeneralSettings({ appVersion }: { appVersion: string | null }) {
</
div
>
</
div
>
<
div
className=
"mt-4"
>
<
ReleaseChannelSelector
/>
</
div
>
<
div
className=
"flex items-center text-sm text-gray-500 dark:text-gray-400 mt-4"
>
<
span
className=
"mr-2 font-medium"
>
App Version:
</
span
>
<
span
className=
"bg-gray-100 dark:bg-gray-700 px-2 py-0.5 rounded text-gray-800 dark:text-gray-200 font-mono"
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论