feat: 无限画布 UI 重构 + 预览键盘控制 + 拖拽体验优化 (0.0.27)

- CanvasPage: AntD Layout 双栏布局 (Sider+Content),预览状态提升解耦 DOM
- CanvasSidebar (新): 项目/集数选择器 + 镜头搜索 + 列表 + 固定刷新按钮
- CategoryTabs (新): 双模式分类标签 (Assets/审核) + 数量徽标 + 媒体细分
- CanvasViewport: Ctrl/Cmd 拖拽平移 (pointerEvents:none 防误抓缩略图)
- CanvasViewport: previewActiveRef 双守卫阻止预览穿透缩放/拖拽
- MediaPreview: 键盘控制 Space 暂停/播放、<- -> 快退快进 ±0.5s
- electron/main.ts: local-media:// 协议 handler 转发 Range 头修复 seek
- StageTabs: 无限画布入口按钮 + 全局字号上调

Range seek 调试: 之前 net.fetch 未转发 Range 头 → 浏览器 seek 时
返回 200 全文件而非 206 Partial Content → currentTime 赋值无法定位
→ 播放位置回退到 0。修复: 提取 Range 头单向转发到 file:// handler。

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-06-24 19:26:08 +08:00
parent 48144ed784
commit b04b5a0390
17 changed files with 994 additions and 239 deletions

View File

@@ -252,12 +252,21 @@ app.whenReady().then(() => {
}
const fwd = filePath.replace(/\\/g, '/');
let fileUrl: string;
if (fwd.startsWith('//')) {
// UNCfile://server/share/pathauthority = server
return net.fetch('file:' + fwd);
fileUrl = 'file:' + fwd;
} else {
fileUrl = 'file:///' + fwd;
}
// 本地file:///C:/path/to/fileauthority 为空)
return net.fetch('file:///' + fwd);
// 只转发 Range 头,确保音视频 seek 时返回 206 Partial Content。
// ⚠️ 不能转发所有 headersOrigin/Referer/Sec-Fetch-* 等),
// 否则会干扰 Chromium 内部的 file:// 协议处理,导致请求失败。
const rangeHeader = request.headers.get('Range');
if (rangeHeader) {
return net.fetch(fileUrl, { headers: { Range: rangeHeader } });
}
return net.fetch(fileUrl);
});
setupAppMenu();