HEL-665: preserve creative inputs and isolate cloud catalogue keyboard selection

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
leefer
2026-10-12 00:54:27 +08:00
co-authored by multica-agent
parent aaddd3dcaf
commit ac1c0f98a6
6 changed files with 50 additions and 4 deletions
@@ -367,8 +367,11 @@
let ctxApplied = false;
$effect(() => {
const wf = currentWorkflow;
const selectedId = workflowId;
untrack(() => {
if (!wf) {
// Keep the previous inputs while a newly selected workflow loads.
if (selectedId != null) return;
if (lastWf) values = {};
lastWf = null;
return;
@@ -137,6 +137,8 @@
if (e.key === 'Escape' && !catalogue) {
e.preventDefault();
onClose();
} else if (source !== 'local') {
return;
} else if (e.key === 'ArrowDown') {
e.preventDefault();
move(1);
@@ -552,7 +552,9 @@
font-size: 10px;
text-align: left;
line-height: 1.7;
max-width: none;
white-space: normal;
overflow-wrap: anywhere;
max-width: 100%;
}
.lbl {
max-width: 100%;
+2 -2
View File
@@ -36,8 +36,8 @@
});
const workflowsQuery = createQuery({
queryKey: ['workflows'],
queryFn: workflows.list,
queryKey: ['workflows-meta'],
queryFn: workflows.listMeta,
});
const allProjects = $derived($projectsQuery.data ?? []);
+1 -1
View File
@@ -34,7 +34,7 @@
- `npm run check`:0 错误;2 条原有警告(镜头视频字幕与 div 自闭合)。
- `npm test`:存储、随机 ID、技能正文和尾帧算法四组检查通过。
- `npm run build`:静态构建通过。
- `e2e/refract.mjs`:30/30 通过;独立本地 API + 假 ComfyUI;涵盖真实项目上下文、提交、回存与重载、画面对比、首尾帧上传、视频播放、收藏、目录导入、五阶段与五角色、画布、1280/1440/1920 桌面及减少动效。
- `e2e/refract.mjs`:33/33 通过;独立本地 API + 假 ComfyUI;涵盖真实项目上下文、提交、回存与重载、画面对比、首尾帧上传、视频播放、收藏、目录导入、五阶段与五角色、画布、1280/1440/1920 桌面及减少动效;新增云端目录回车隔离,以及首次切换工作流保留提示词与首尾帧。
- 测试只在本地临时数据库操作,流程生成的项目、工作流与任务在 finally 中清理。
运行浏览器检查前启动现有 `e2e/fake_comfy.py`、本地后端 8247 与 Vite 5173,运行 `e2e/seed.py`,并通过批量导入导入仓库的本地工作流。脚本拒绝向非 localhost API 写测试数据。
+39
View File
@@ -90,6 +90,14 @@ try {
},
});
workflows.push(h3.id);
const h3Copy = await api('/api/workflows', {
name: 'H3 首尾帧·首次加载回归',
kind: h3.kind,
usage: h3.usage,
workflow_json: h3.workflow_json,
});
workflows.push(h3Copy.id);
const project = await api('/api/projects', {
title: '折光·可删除测试项目',
idea: '从一个想法开始',
@@ -173,6 +181,13 @@ try {
await page.locator('[aria-label="搜索工作流"]').fill('文生图·回归');
await until(async () => (await page.locator('[role="dialog"] .workflow-card').count()) === 1);
ok('workflow search in modal', true);
await page.getByRole('button', { name: '云端与智能体', exact: true }).click();
await page.locator('[aria-label="搜索工作流"]').focus();
await page.keyboard.press('Enter');
ok(
'cloud search Enter does not choose a hidden local workflow',
(await page.locator('[role="dialog"]').count()) === 1,
);
await page.keyboard.press('Escape');
ok(
'Escape restores selector focus',
@@ -256,6 +271,30 @@ try {
await uploads.nth(0).setInputFiles(path.join(ROOT, '../calliope-web/static/refract/coast.jpg'));
await uploads.nth(1).setInputFiles(path.join(ROOT, '../calliope-web/static/refract/arch.jpg'));
await until(async () => (await page.locator('.studio-form img').count()) >= 2);
await page.fill('#desk-prompt', '切换后保留提示词与首尾帧');
const inputSources = await page
.locator('.studio-form img')
.evaluateAll((els) => els.map((e) => e.getAttribute('src')));
await page.locator('.model-selector').click();
await page.fill('[aria-label="搜索工作流"]', h3Copy.name);
await page.getByRole('button', { name: '使用 ' + h3Copy.name, exact: true }).click();
await page.locator('#desk-prompt').waitFor();
ok(
'first uncached workflow keeps prompt',
(await page.inputValue('#desk-prompt')) === '切换后保留提示词与首尾帧',
);
ok(
'first uncached workflow keeps uploaded frames',
JSON.stringify(
await page
.locator('.studio-form img')
.evaluateAll((els) => els.map((e) => e.getAttribute('src'))),
) === JSON.stringify(inputSources),
);
await page.locator('.model-selector').click();
await page.fill('[aria-label="搜索工作流"]', h3.name);
await page.getByRole('button', { name: '使用 ' + h3.name, exact: true }).click();
await page.locator('#desk-prompt').waitFor();
submitted = page.waitForRequest(
(r) => r.url().endsWith('/api/playground/generate') && r.method() === 'POST',
);