Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.
TypeScript agent-skillscodex-clideskop-appdubbingimage-generationlocalizationskillsttsvideo-editingvideo-generationvideo-transcriptionvideo-translation
fix(creator): preserve explicit stickman settings
wulien-centerde2e1b7d2ebd
diff --git a/apps/daemon/src/creator/stickman/action-handler.ts b/apps/daemon/src/creator/stickman/action-handler.tsindex 322d311d..01a72968 100644--- a/apps/daemon/src/creator/stickman/action-handler.ts+++ b/apps/daemon/src/creator/stickman/action-handler.ts@@ -103,12 +103,9 @@ export function handleStickmanAction(input: {current.state.styleAsset,DEFAULT_STICKMAN_STYLE_ASSET);- const outputPreset = patch.outputPreset === 'youtube-shorts' || patch.outputPreset === 'landscape'- ? patch.outputPreset- : current.state.outputPreset;- const normalizedFormat = outputPreset === 'youtube-shorts'+ const normalizedFormat = patch.outputPreset === 'youtube-shorts'? stickmanOutputPresetDefaults('youtube-shorts')- : outputPreset === 'landscape'+ : patch.outputPreset === 'landscape'? stickmanOutputPresetDefaults('landscape'): {};const nextState: Record<string, CreatorJson> = {diff --git a/apps/daemon/test/unit/creator-stickman-action-handler.test.ts b/apps/daemon/test/unit/creator-stickman-action-handler.test.tsindex 42e632a2..61fc4496 100644--- a/apps/daemon/test/unit/creator-stickman-action-handler.test.ts+++ b/apps/daemon/test/unit/creator-stickman-action-handler.test.ts@@ -88,6 +88,50 @@ describe('stickman action handler', () => {expect(new Set(staleIds)).toHaveLength(artifacts.length);});+ it('preserves an explicit duration update when the output preset is unchanged', () => {+ const job = {+ id: 'job-1',+ projectId: 'project-1',+ templateId: 'stickman-video',+ templateVersion: 2,+ status: 'running',+ revision: 1,+ state: {+ outputPreset: 'landscape',+ ratio: '16:9',+ targetDurationSeconds: 30,+ targetLanguage: 'zh-CN'+ },+ stages: [],+ artifacts: [],+ providerRequests: [],+ activities: [],+ agentThreadId: null,+ createdAt: '2026-09-20T00:00:00.000Z',+ updatedAt: '2026-09-20T00:00:00.000Z'+ } as CreatorJob;+ const repository = {+ setArtifactStatus() {}+ } as unknown as CreatorRepository;++ const result = handleStickmanAction({+ repository,+ current: job,+ action: 'update-settings',+ parsedInput: { patch: { targetDurationSeconds: 125 } },+ actor: 'user',+ newRevision: 2+ });++ expect(result.handled).toBe(true);+ expect(result.state).toMatchObject({+ outputPreset: 'landscape',+ ratio: '16:9',+ targetDurationSeconds: 125,+ targetLanguage: 'zh-CN'+ });+ });+it('restores landscape defaults and global TTS selection when leaving Shorts', () => {const artifacts: CreatorArtifact[] = ['script_manifest', 'clean_video'].map((kind, index) => ({id: `artifact-${index + 1}`,diff --git a/apps/desktop/e2e/creator-packaged-app.spec.ts b/apps/desktop/e2e/creator-packaged-app.spec.tsindex c1ab5c6d..f0e1495f 100644--- a/apps/desktop/e2e/creator-packaged-app.spec.ts+++ b/apps/desktop/e2e/creator-packaged-app.spec.ts@@ -347,8 +347,6 @@ test('打包 App 的 Creator 设置页保留组件间距和下拉箭头内边距textInsets: Array.from(panel.querySelectorAll('.native-select select')).map(select => getComputedStyle(select).paddingInlineEnd)};})).toEqual({ sourceCharacterGap: 16, selectTopDelta: 0, arrowInsets: [12, 12], textInsets: ['40px', '40px'] });- await fixture.app.page.getByRole('combobox', { name: '目标时长' }).selectOption('60');- await expect(fixture.app.page.getByRole('combobox', { name: '目标时长' })).toHaveValue('60');await fixture.app.page.getByRole('combobox', { name: '目标时长' }).scrollIntoViewIfNeeded();await fixture.app.page.screenshot({ path: testInfo.outputPath('creator-settings-spacing-980.png') });} finally {@@ -849,10 +847,17 @@ test('@package-smoke 实际 Desktop 包创建并重启恢复 Creator Job,且aspectRatio: '9:16'});+ const currentProjectId = await currentApp.page.evaluate(() => {+ const stored = localStorage.getItem('opencreator.navigation.v3');+ if (stored === null) return undefined;+ const parsed = JSON.parse(stored) as { currentProjectId?: unknown };+ return typeof parsed.currentProjectId === 'string' ? parsed.currentProjectId : undefined;+ });+ expect(currentProjectId).toBeTruthy();const createdJob = await runtimeRequest<{job: { id: string; revision: number; state: Record<string, unknown> };}>(currentApp.page, 'POST', '/creator/jobs', {- projectId: createdProject.body.project.id,+ projectId: currentProjectId,templateId: 'video-translation',creationKey: 'packaged-video-translation',state: {@@ -964,16 +969,20 @@ test('@package-smoke 实际 Desktop 包创建并重启恢复 Creator Job,且deduplicated: false});+ const jobBeforeUpdate = await runtimeRequest<{+ job: { revision: number };+ }>(currentApp.page, 'GET', `/creator/jobs/${createdJob.body.job.id}`);+ expect(jobBeforeUpdate.status).toBe(200);const updatedJob = await runtimeRequest<{job: { id: string; revision: number; state: Record<string, unknown> };}>(currentApp.page, 'POST', `/creator/jobs/${createdJob.body.job.id}/actions`, {action: 'update-settings',- expectedRevision: 0,+ expectedRevision: jobBeforeUpdate.body.job.revision,input: { patch: { targetLanguage: 'ja', dubbing: true } }});expect(updatedJob.status).toBe(200);expect(updatedJob.body.job).toMatchObject({- revision: 1,+ revision: jobBeforeUpdate.body.job.revision + 1,state: { targetLanguage: 'ja', dubbing: true }});const imageJob = await runtimeRequest<{@@ -1118,7 +1127,7 @@ test('@package-smoke 实际 Desktop 包创建并重启恢复 Creator Job,且expect(restoredJob.status).toBe(200);expect(restoredJob.body.job).toMatchObject({id: createdJob.body.job.id,- revision: 1,+ revision: updatedJob.body.job.revision,state: { targetLanguage: 'ja', dubbing: true }});expect(restoredJob.body.job.issues).toEqual(expect.arrayContaining([