feat(admin,viewer,ui04): E06 management preview and v2 integration — real-component preview page, form mode fields, README

- viewer /embed-preview route: real EmbedStream with sample photography (picsum seeds), zero requests/WS (preview mode), postMessage config + simulated bursts through the real validation pipeline
- EmbedStream: preview prop (disables real WS subscription per §8.2 isolation) + exposed simulateBurst
- admin form: displayMode radio (new default), fixed 195x280 readonly, speed slider, reactions switch; v1 layout fields hidden in v2 (not silently effective)
- admin preview: v2 branch embeds the real preview iframe, white v2 handle, simulate-like tool button with sample-data note
- README-embed: v2 section (integration, hard sizing/docking, interactions/limits, artifact/version caching)
- tests: admin vitest 83 (+1 v2 placement), admin e2e 5 (v1 pinned carousel regression + full v2 chain incl. preview WYSIWYG heart and ov settings projection), viewer 244, v2 e2e 16

Note: part of the admin-side E06 changes (form/preview/utils/locales, mid-state of e2e spec) was swept into parallel commit eebf3b3 by a concurrent session's git add; this commit carries the final state of the remaining files and completes the set.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-22 18:20:50 +08:00
parent eebf3b3334
commit 3bba8d1dc5
7 changed files with 248 additions and 7 deletions
+26 -1
View File
@@ -65,7 +65,7 @@
- [x] E03 连续滚动(登记见下)
- [x] E04 操作和生命周期(登记见下)
- [x] E05 实时气泡(登记见下;含效果示例 embed-preview-2026-09-22.html 对齐)
- [ ] E06 管理预览与接入
- [x] E06 管理预览与接入(登记见下)
- [ ] E07 验收(EMB-A01…A16 逐项见第 5 节)
### E02 登记(2026-09-22)
@@ -154,6 +154,31 @@
(网络断言,EMB-A15);16s 真实点赞节奏录屏 recordings/e05-hearts-16s.webm。
- E05 出口确认:两上下文真实点赞触发正确图气泡(归属区间断言通过)。
### E06 登记(2026-09-22)
- 表单(SlotFormDialog):展示模式单选(照片上滚/旧版轮播;新建默认新版);
v2 字段组 = 固定尺寸只读「195 × 280」+ 上滚速度滑杆(8-32,实时值展示)+
点赞气泡开关;v1 布局字段(尺寸/间隔/适配)v2 下隐藏(§7.2「不保存后偷偷
生效」,切回旧版恢复编辑);位置/偏移/层级/语言/默认收起两模式共用。
- 真实组件预览(§8.2):EmbedSlotPreview v2 分支内嵌 viewer `/embed-preview`
iframe(新增路由,meta.layout embed)——渲染生产同源 EmbedStream/引擎/气泡层,
样例数据为 picsum 固定 seed 真实摄影(与 e2e fixtures 同比例);配置经
postMessage {type:config} 实时更新(不整页重载);「模拟点赞事件」按钮在
预览工具区(不在实际组件),经 simulateBurst 注入真实校验管线。
- 隔离(§8.2 红线):预览页零请求零订阅(preview 模式禁用 WS;不 fetch feed、
不上报浏览、不提交点赞);未保存草稿仅存在于表单/预览内存。
- 代码生成:displayMode=vertical-stream → /embed/v2/loader.js(E01 utils 已就绪,
EmbedCodeDialog 自动生效);data-speed/data-reactions 仅非默认生成。
- 文档:README-embed.md 增 v2 章节(接入/硬性尺寸与停靠/交互与限制/产物与
版本缓存说明)。
- 测试:admin vitest 83(+1 v2 placement:恒 195/无 sm 降档/mobile 默认收起;
v1 用例固定 carousel 后原断言保持);admin e2e 5(v1 用例先切 carousel 保
留回归 + 新增 UI-04 v2 全链:表单字段组/预览 iframe 内 .stream-viewport/
模拟点赞出心形/v2 代码卡/绑定后 ov settings 投影 displayMode+scrollSpeed=24
+reactions);viewer 244 / v2 e2e 16 全绿。
- E06 出口确认:后台保存与第三方跨源实际效果一致(admin e2e ov settings
投影 + viewer e2e 真实宿主效果两条链均有证据)。
## 4 测量与证据索引
(E02+ 起登记:尺寸实测、位移曲线、DOM/连接上限统计、录屏清单。)