fix(studio): single-frame export uses wrong content, ignores duration setting#55
Conversation
|
Hey @walliai-chenlb! 👋 Nice work tracking down three distinct bugs in the same export path — the I've assigned @Siri-Ray for code review. In the meantime, this PR is linked to #50 which reports the same duration issue — good alignment. |
… setting
1. Wrong content: exportMp4 always rendered the template's original
source HTML, ignoring the agent-generated preview saved to
lastPreviewHtmlPath. Now uses lastPreviewHtmlPath when present.
2. Duration ignored: exportMp4 hardcoded `duration: 'auto'`, causing
the adapter to fall back to the animation's natural length (~4s)
instead of the user's setting. durationTargetSec was defined in
UserPreferences but never written or read.
- studio-server now persists collected.duration to
preferences.durationTargetSec at generate time (covers both
single-frame and multi-frame paths).
- exportMp4 reads durationTargetSec and passes it as
durationMode: 'explicit' so the adapter honors it as a hard cap.
3. UI showed render time not video duration: the "MP4 已导出 · Xs"
badge was displaying elapsed_ms (wall-clock render time) instead
of the actual video length. export_done SSE event now carries
duration_sec; the studio UI uses that instead.
0471f48 to
0ec429d
Compare
|
@lefarcen Thanks for the feedback and for linking this PR to #50! I noticed there isn't currently a reviewer assigned on the PR, so just wanted to check whether the assignment to @Siri-Ray went through. Also, just a small note: this PR addresses both #50 and #51. I'll wait for the review and address any feedback once it's available. Thanks! |
fix(studio): single-frame export uses wrong content, ignores duration setting
Wrong content: exportMp4 always rendered the template's original
source HTML, ignoring the agent-generated preview saved to
lastPreviewHtmlPath. Now uses lastPreviewHtmlPath when present.
Duration ignored: exportMp4 hardcoded
duration: 'auto', causingthe adapter to fall back to the animation's natural length (~4s)
instead of the user's setting. durationTargetSec was defined in
UserPreferences but never written or read.
preferences.durationTargetSec at generate time (covers both
single-frame and multi-frame paths).
durationMode: 'explicit' so the adapter honors it as a hard cap.
UI showed render time not video duration: the "MP4 已导出 · Xs"
badge was displaying elapsed_ms (wall-clock render time) instead
of the actual video length. export_done SSE event now carries
duration_sec; the studio UI uses that instead.
Resolves #50
Resolves #51