Files
agent-desktop/console/src/os/webViewStore.ts
T
Pine 0277d51ed3 fix: 网页容器支持 MainLayout 覆盖层模式(桌面端主界面)
根因:桌面端实际运行在 MainLayout(/console 路径),无 OS 桌面窗口系统,
openApp 打开的 core.web-view 窗口无处渲染 → 外链点击无反应。
- 新增 webViewStore:MainLayout/浏览器模式以全屏覆盖层渲染 WebPage
- openInAppWebView 分流:/os 模式 → OS 窗口;否则 → 覆盖层(回到原页面)
- MainLayout 顶层挂载 {url && <WebPage/>};WebPage 支持 overlay 模式退出
- 调试面板移到 App 全局层(MainLayout 与 OS 均可见)
2026-09-07 20:58:33 +08:00

21 lines
626 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* webViewStore.ts — 应用内网页容器(WebPage)的宿主无关状态。
*
* OS 桌面模式(/os)下容器走 os 窗口(core.web-viewopenApp);
* MainLayout / 浏览器模式(/console 等)下没有窗口系统,容器以
* 全屏覆盖层形式渲染在 MainLayout 顶层,由本 store 驱动开关。
*/
import { create } from "zustand";
interface WebViewState {
url: string | null;
open: (url: string) => void;
close: () => void;
}
export const useWebViewStore = create<WebViewState>((set) => ({
url: null,
open: (url) => set({ url }),
close: () => set({ url: null }),
}));