运行页顶栏收口:预览地址改按钮,版本入口并入顶栏同一套样式
- 删除运行区域上方的状态行与预览地址小字,运行画面回到两行栅格 - 预览地址改成顶栏动作区里的「在浏览器打开」按钮(opener 插件 openUrl),只在有活预览时渲染 - 版本入口搬进同一个顶栏动作区,外观复用该容器的基础按钮样式,去掉自带的边框、底色与 hover - 打开失败走 onNotice 的失败色 toast:onRunNotice 通道改成带 tone 的对象,四处调用点同步 - 补顶栏入口正向守卫,删掉状态行的旧样式用例并新增顶栏与浏览器打开的用例
This commit is contained in:
@@ -2741,6 +2741,14 @@ function assertAiGameCreatorShellUserDevBoundary() {
|
||||
);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 预览**不自动**开系统浏览器:启动与切换运行视图只走内置画面,两条老路必须一直挡着
|
||||
* (App.tsx 里的 `openPreviewInExternalBrowser` / 前端直调 `open_local_game_preview` /
|
||||
* Rust 侧 `.open_url(`)。
|
||||
*
|
||||
* 用户主动点「在浏览器打开」是另一回事:它走 opener 插件的 `openUrl`,入口只有顶栏那一枚
|
||||
* 按钮(见下面那条正向断言)。别把这条负向守卫推广成「任何地方都不许出现 openUrl」。
|
||||
*/
|
||||
if (
|
||||
aiGameCreatorShellAppSource.includes('openPreviewInExternalBrowser') ||
|
||||
aiGameCreatorShellAppSource.includes('open_local_game_preview') ||
|
||||
@@ -2750,6 +2758,19 @@ function assertAiGameCreatorShellUserDevBoundary() {
|
||||
'AI game creator preview must not invoke the external browser',
|
||||
);
|
||||
}
|
||||
for (const snippet of [
|
||||
"'@tauri-apps/plugin-opener'",
|
||||
'在浏览器打开',
|
||||
'await openUrl(embeddedPreviewUrl)',
|
||||
]) {
|
||||
if (
|
||||
!sourceIncludesSnippet(aiGameCreatorProjectDevelopmentSource, snippet)
|
||||
) {
|
||||
throw new Error(
|
||||
`AI game creator in-browser preview entry drifted: missing ${snippet}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
if (
|
||||
aiGameCreatorShellTauriSource.includes('fn open_developer_window(') ||
|
||||
aiGameCreatorShellTauriSource.includes(
|
||||
|
||||
Reference in New Issue
Block a user