A task the AI never names (mostly one asked for in the AI app's own chat, with no begin_task) took the summary of its first step that did something as its title, so the list read "run_workflow" or "new_workflow: anima test". ai_task_title.js shows such a title (title_from "auto", now in the list's summaries and the task links) with the tool in the page's words, "新建了工作流:anima test"; a title the user or the AI gave stays as written, and every page naming a task uses it. Renaming starts from that name. The short set's note said "drawing in the AI app's own chat", which the user read as the picture being drawn in the AI app. It now says it is for telling the AI to draw right in the app's chat, the picture still drawn by ComfyUI, and that a task started with New task cannot use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 lines
866 B
JavaScript
20 lines
866 B
JavaScript
/**
|
|
* A task's name on the page: the one the user or the AI gave, else the one Anomalous took from the
|
|
* AI's first step that did something (api/ai_tasks.py keeps it as "tool: what", title_from "auto"),
|
|
* with the tool said in the page's words, else "Untitled task". A task no one named is mostly one an
|
|
* AI worked on from its own chat, without begin_task.
|
|
*/
|
|
|
|
import { translate as t } from './locales.js';
|
|
import { toolKey } from './ai_task_view.js';
|
|
|
|
export function taskTitle(task) {
|
|
const title = task?.title || '';
|
|
if (!title) return t('aiUntitled');
|
|
if (task.title_from !== 'auto') return title;
|
|
const [, tool, about] = title.match(/^([a-z_]+)(?::\s*([\s\S]*))?$/) || [];
|
|
const what = tool ? t(toolKey(tool)) : '';
|
|
if (!what || what === toolKey(tool)) return title;
|
|
return about ? t('aiAutoTitle', { what, about }) : what;
|
|
}
|