feat: 二级页面、孤儿路由防护、iframe 全屏与 DS Bot 侧栏隐藏 (v0.5.3-local.5)
借鉴同线分支 dsh-worktable 0.5.2-local.9 的四项改造,逐项评估后移植: - 二级页面:LayoutSpec.parentId + layoutTree 树形侧栏 + 折叠/展开。 仅一级嵌套;删父项目不级联删子页面(提升为顶级,避免误删用户内容)。 管理面板加「+新增二级页面」,继承父项目文件夹。 - 孤儿路由防护:register 遇 duplicate 路由只 warn 不抛,避免热重载时 旧 fiber 未释放导致新 fiber 激活失败、侧边栏抽屉整体消失。 - iframe allowFullScreen:项目窗格里的 HTML 看板可全屏。 - DS Bot 侧栏隐藏:由本插件注入 CSS,替代改 ds-bot/client.js 的做法 (ds-bot 随应用升级,改源码必丢)。nav.bt-home-nav 带标签选择器避免误伤。 未移植对方的状态防清空(stateStore.serverKeys):本仓 hostState.ts 已有 hydrated 守卫(读完宿主前禁写、读不到整场不写)与更细的 6 段退避重试, 覆盖面更强。 顺带修三个 Windows 兼容缺陷,否则 pack 门禁过不去: - release-prep.mjs:tar 加 --force-local(GNU tar 把 C: 当 rsh 主机) - preview-files.test.mjs:rmSync 删 junction 失败,加 unlinkSync 兜底 - widget-mount.test.mjs:提取段缺 normalizeProjects 依赖,起点前移 验证:npm run pack 全绿(139 项兼容回归 + 工厂门禁 10/10 + 结构 7 文件 + 独立安装 import + 锚点 14 场景 + Chromium 分栏 5 场景 + 服务端 3 场景)。 双资产同源 sha256 cf633ad7…。
This commit is contained in:
@@ -70,6 +70,8 @@ export type LayoutSpec = {
|
||||
chatFullHeight?: boolean
|
||||
/** 顶行首次打开时高度占可用高度比例(0~1;0.5 = 上下等分);拖动后由存档值覆盖 */
|
||||
topHeightRatio?: number
|
||||
/** 二级页面:挂在某项目下的独立布局页(仅一级嵌套;缺省 = 顶级项目) */
|
||||
parentId?: string
|
||||
}
|
||||
|
||||
type Geom = { left: number; top: number; right: number; bottom: number }
|
||||
@@ -2479,7 +2481,7 @@ function FileViewer(props: { path: string }) {
|
||||
const ext = (props.path.split('.').pop() || '').toLowerCase()
|
||||
const fileUrl = '/api/worktable/file?path=' + encodeURIComponent(props.path)
|
||||
if (ext === 'pdf') {
|
||||
return <iframe className="dsh-wt_paneFrame" src={fileUrl} title={basenameOf(props.path)} />
|
||||
return <iframe className="dsh-wt_paneFrame" src={fileUrl} title={basenameOf(props.path)} allowFullScreen />
|
||||
}
|
||||
if (IMAGE_EXTS.test('.' + ext)) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user