You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
这个提案和后续的代码会在 AI 辅助下完成,由人审核。PR 里会如实写明哪些测试实际跑过、在什么环境下跑的,提交前会按 CONTRIBUTING 跑 npm run typecheck 和 npm run build,并提到 dev 分支。
English summary: We propose letting PiDeck import Wallpaper Engine video wallpapers (phase 1) and, optionally, web wallpapers (phase 2) from a workshop folder the user picks (steamapps/workshop/content/431960). We'd read only project.json and play the files in place, with no copying or redistribution, no Steam API, and no scene or application types. For video we'd preferably follow or reuse the existing pideck-video:// pattern (streaming with Range, whitelisted refs, no video bytes over IPC). The alternatives are widening pideck-bg:// to that one folder (today it uses readFile with stream:false) or a new protocol. Web wallpapers would reuse the sandboxed pideck-html:// iframe with a separate, no-network response-header CSP, and no Node integration or IPC. Memory would be benchmarked before and after with PiDeck's own PIDECK_MEMORY_PROFILE tool; we have no numbers yet. We'd test on headless Linux with sample files, and on a real Windows/Steam PC before the PR. The work is AI-assisted and human-reviewed. No code until you agree.
这个提案和后续的代码会在 AI 辅助下完成,由人审核。PR 里会如实写明哪些测试实际跑过、在什么环境下跑的,提交前会按 CONTRIBUTING 跑 npm run typecheck 和 npm run build,并提到 dev 分支。
English summary: We propose letting PiDeck import Wallpaper Engine video wallpapers (phase 1) and, optionally, web wallpapers (phase 2) from a workshop folder the user picks (steamapps/workshop/content/431960). We'd read only project.json and play the files in place, with no copying or redistribution, no Steam API, and no scene or application types. For video we'd preferably follow or reuse the existing pideck-video:// pattern (streaming with Range, whitelisted refs, no video bytes over IPC). The alternatives are widening pideck-bg:// to that one folder (today it uses readFile with stream:false) or a new protocol. Web wallpapers would reuse the sandboxed pideck-html:// iframe with a separate, no-network response-header CSP, and no Node integration or IPC. Memory would be benchmarked before and after with PiDeck's own PIDECK_MEMORY_PROFILE tool; we have no numbers yet. We'd test on headless Linux with sample files, and on a real Windows/Steam PC before the PR. The work is AI-assisted and human-reviewed. No code until you agree.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
你好 @ayuayue,感谢之前合并 #399。我们想在 PiDeck 现有的壁纸功能上做一个扩展:从用户本机已订阅的 Wallpaper Engine 创意工坊目录里导入视频和网页类型的壁纸作为背景。动手前先来问问你是否欢迎这个方向,以及你对设计的偏好。你点头之前我们不会提 PR。
目标
很多用户本地已经有 Wallpaper Engine 订阅的壁纸。希望 PiDeck 能直接把其中的动态壁纸用作工作台背景,并且继续沿用现有的透明度档位,让面板透出壁纸。
范围
做:
steamapps/workshop/content/431960/)。能自动检测到 Steam 目录就预填,检测不到就让用户手动选。project.json,只取title、type、file、preview、general.properties这几个字段,用来列出和预览壁纸。type: video。type: web(会运行第三方 HTML/JS,隔离方案见下文)。不做:
scene类型(scene.pkg是 Wallpaper Engine 的私有格式)和application类型(外部 exe)。userData里只存目录路径和选中的壁纸 ID。视频和网页壁纸本身就是普通文件,所以在 macOS、Linux 上只要能访问到这些文件(比如从 Windows 拷来的目录或共享盘)也能播放。不过 Wallpaper Engine 和 Steam 订阅本身只在 Windows 上。
设计草图(尽量贴合现有实现)
pideck-bg://是readFile整个读入,注册时stream: false,只适合静态图。我们考虑的方案按优先级排列:pideck-video://(src/main/videogen/VideoGenProtocol.ts)的做法,或直接复用它。它已经通过createReadStream和单区间 Range 流式输出给<video>,引用名走白名单正则,视频字节不进 IPC,主窗口 CSP 的media-src也已经允许pideck-video:。壁纸这边同样只传白名单引用名,主进程再解析到用户选定的工坊目录里,并做路径逃逸检查。pideck-bg://放开到用户明确选择的那一个工坊目录,同时改成流式输出。pideck-we://)。src/shared。渲染进程拿不到任意路径。<video muted loop playsinline>作为背景层,透明度继续走useAppAppearance.ts的现有档位,不改动现有的静态图逻辑和wallpaperThemeSync的契约测试,只为新类型补测试。pideck-html://(src/main/htmlPreviewProtocol.ts)。它用沙箱<iframe>,CSP 由主进程通过响应头下发,和主窗口策略解耦(bug: HTML 预览窗 (FileDiffViewer) 中内联 JavaScript 无法执行,被主窗口 CSP 拦截 #377)。壁纸不开 Node integration,不暴露 preload 和 IPC。现在文件预览用的 CSP 允许'unsafe-inline'和'unsafe-eval',壁纸会沿用同一套机制,但单独下发一份不允许联网的 CSP,只允许加载该壁纸目录里的资源。general.properties这类用户属性暂时只用默认值,不做属性编辑器。内存 / CPU 计划
PIDECK_MEMORY_PROFILE=1和scripts/analyze-memory.mjs做前后对比:无壁纸、静态图壁纸、视频壁纸三种情况各测一次,结果连同测试环境(系统、分辨率、视频规格)一起贴出来。目前我们还没有测出任何数字,所以这里不写具体指标。测试范围(如实说明)
我们这边的开发环境是没有显示器的 Linux。这里只能用自己构造的
project.json样例和测试视频,验证解析、协议和播放逻辑。真实的 Windows + Steam 工坊目录会由我们的成员在自己的 Windows 电脑上验证,PR 里会写清楚哪些是在什么环境测的。想请你确认的问题
pideck-video://的模式),方案 B(放开pideck-bg://并改成流式),还是方案 C(新开协议)?网页壁纸复用pideck-html://加一份独立的无网络 CSP,你能接受吗?关于 AI 辅助
这个提案和后续的代码会在 AI 辅助下完成,由人审核。PR 里会如实写明哪些测试实际跑过、在什么环境下跑的,提交前会按 CONTRIBUTING 跑
npm run typecheck和npm run build,并提到dev分支。English summary: We propose letting PiDeck import Wallpaper Engine video wallpapers (phase 1) and, optionally, web wallpapers (phase 2) from a workshop folder the user picks (
steamapps/workshop/content/431960). We'd read onlyproject.jsonand play the files in place, with no copying or redistribution, no Steam API, and no scene or application types. For video we'd preferably follow or reuse the existingpideck-video://pattern (streaming with Range, whitelisted refs, no video bytes over IPC). The alternatives are wideningpideck-bg://to that one folder (today it uses readFile with stream:false) or a new protocol. Web wallpapers would reuse the sandboxedpideck-html://iframe with a separate, no-network response-header CSP, and no Node integration or IPC. Memory would be benchmarked before and after with PiDeck's ownPIDECK_MEMORY_PROFILEtool; we have no numbers yet. We'd test on headless Linux with sample files, and on a real Windows/Steam PC before the PR. The work is AI-assisted and human-reviewed. No code until you agree.All reactions