mirror of
https://github.com/basketikun/infinite-canvas.git
synced 2026-08-07 01:54:24 +08:00
feat(canvas): enhance multi-image generation to track individual image statuses and prioritize display of the first successful result
This commit is contained in:
@@ -50,7 +50,7 @@ type CanvasConnection = {
|
||||
|
||||
Node positions and sizes use canvas-world coordinates. Edges store only node IDs; their paths are calculated while rendering. Deleting a node removes its connected edges.
|
||||
|
||||
Common metadata includes content, prompt, status, generation mode, model, size, count, natural dimensions, image results, input order, `storageKey`, MIME type, and byte size. A multi-image generation remains one image node: `images` stores every result and `primaryImageId` selects the result mirrored by the node-level `content` and image metadata. Image and video `content` values are normally session-scoped `blob:` URLs; `storageKey` is the persistent identity.
|
||||
Common metadata includes content, prompt, status, generation mode, model, size, count, natural dimensions, image results, input order, `storageKey`, MIME type, and byte size. A multi-image generation remains one image node: `images` creates all requested slots before generation starts and records each slot's `status`, `errorDetails`, and completed image data. `primaryImageId` selects the result mirrored by the node-level `content` and image metadata; the first successful slot becomes primary immediately. Image and video `content` values are normally session-scoped `blob:` URLs; `storageKey` is the persistent identity.
|
||||
|
||||
## Assistant sessions
|
||||
|
||||
|
||||
@@ -79,6 +79,8 @@ type CanvasNodeData = {
|
||||
```ts
|
||||
type CanvasNodeImage = {
|
||||
id: string;
|
||||
status: "idle" | "success" | "loading" | "error";
|
||||
errorDetails?: string;
|
||||
content: string;
|
||||
storageKey: string;
|
||||
naturalWidth: number;
|
||||
@@ -115,7 +117,7 @@ type CanvasNodeMetadata = {
|
||||
- 视频节点:`content` 是当前可播放的视频 URL,通常是 `blob:` URL;`storageKey` 指向本地视频 Blob;`bytes/mimeType` 保存文件信息。
|
||||
- 文本节点:`content` 保存文本内容;`fontSize` 保存字体大小;`prompt/status/errorDetails` 保存生成状态。
|
||||
- 生成配置节点:`generationMode/model/size/count/inputOrder` 保存生成配置;`generationMode` 可选择文本、图片或视频;上游输入通过 `connections` 计算。
|
||||
- 多图图片节点:批量生成仍只保存为一个图片节点,`images` 记录全部结果,`primaryImageId` 指定由节点级 `content` 和图片元数据展示的主图;展开状态仅属于当前界面,不写入项目数据。
|
||||
- 多图图片节点:批量生成仍只保存为一个图片节点,请求开始前会在 `images` 中创建全部图片槽位,每个槽位通过 `status/errorDetails` 独立记录实时状态,成功后补充图片数据;最先成功的槽位会立即写入 `primaryImageId`,并由节点级 `content` 和图片元数据展示;展开状态仅属于当前界面,不写入项目数据。
|
||||
|
||||
## 连线结构
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ The current release needs manual verification in these areas:
|
||||
- English and Simplified Chinese switching across navigation, settings, titles, descriptions, Ant Design components, and persisted preferences.
|
||||
- Global Dropdown, Menu, Select, Cascader, and TreeSelect popup backgrounds, hover states, and selected states in both light and dark themes.
|
||||
- Canvas node resize stability, prompt scrolling, generated-prompt restoration, image editing, drag-and-drop references, and generation configuration.
|
||||
- Multi-image canvas generation: generating N images should create one image node with exactly N stored results and one incoming connection; the collapsed count control should remain clearly legible over any image, hide the floating toolbar when clicked, and expand the N images upward and to the right; every secondary image should keep a clearly legible primary-image action visible in both themes, and clicking the empty canvas should collapse the group.
|
||||
- Multi-image canvas generation: starting N images should immediately create one image node with N expandable slots and one incoming connection; each empty slot should independently show generating or failure while requests are running, every slot with image content should always display that image, and the first successful image should appear as the primary image immediately. The collapsed count control should remain clearly legible over any image, hide the floating toolbar when clicked, and expand the slots upward and to the right; every completed secondary image should keep a clearly legible primary-image action visible in both themes, and clicking the empty canvas should collapse the group.
|
||||
- Canvas Agent startup, MCP status, model and permission controls, approvals, version reporting, diagnostics, streaming responses, history consistency, multi-tab isolation, and local Skill management.
|
||||
- Agent header tabs in English and Chinese at different panel widths; labels should collapse to icons and counts before either edge is clipped.
|
||||
- Agent message layout, Markdown, code blocks, attachments, token statistics, progress timelines, command groups, and scroll-follow behavior.
|
||||
|
||||
@@ -48,7 +48,7 @@ description: 当前版本已实现但仍需人工验证的变更项
|
||||
- 画布节点提示词:图片等节点下方的提示词超过输入区域高度后,鼠标悬停在输入区域内滚动应查看提示词内容,不应缩放画布。
|
||||
- 画布节点提示词回显:单图或多图生成完成后,切换选择生成结果的根节点及任一子节点,下方输入区域都应继续显示生成时的提示词;切换到其他节点再选回来后也不应清空。
|
||||
- 画布生成配置:连接文本节点后连续点击生成(包含失败重试),组装提示词不应重复追加上游文本;在生图、文本、视频、音频之间切换时,实际请求应始终使用当前面板展示的对应类型模型。
|
||||
- 画布多图生成:生成 N 张图片后应只创建一个包含 N 张结果的图片节点,并且来源到结果只保留一条连线;收起状态下右上角应显示醒目的「N 张」数量提示,在任意图片背景上都清晰可辨;点击数量后,浮动工具条应暂时隐藏,主图与其余图片应从当前节点向右上方整齐展开且总数严格为 N;其余图片的「设为主图」应常驻显示,并在亮色、深色主题及不同图片背景上保持清晰;点击画布空白处应自动收起并恢复工具条。
|
||||
- 画布多图生成:开始生成 N 张图片后应立即创建一个包含 N 个可展开槽位的图片节点,并且来源到结果只保留一条连线;生成期间空槽位应独立显示生成中或失败,任何已有图片内容的槽位都必须始终显示图片,任意图片率先成功后应立即成为主图并展示,不等待其他请求完成;收起状态下右上角应显示醒目的「N 张」数量提示,在任意图片背景上都清晰可辨;点击数量后,浮动工具条应暂时隐藏,各图片槽位应从当前节点向右上方整齐展开;已成功图片的「设为主图」应常驻显示,并在亮色、深色主题及不同图片背景上保持清晰;点击画布空白处应自动收起并恢复工具条。
|
||||
- 画布左侧元素列表:点击元素整行应平滑定位并选中对应节点;有内容的图片元素应显示预览按钮,点击后打开大图弹窗且不触发画布定位。
|
||||
- 配置与用户偏好:导出 JSON 后应包含渠道、默认模型、生成偏好、提示词来源和 WebDAV 配置;在修改当前配置后重新导入该文件,应恢复导出时的设置,错误 JSON 文件应提示格式不正确。配置文件包含 API Key 和 WebDAV 凭据,不应公开分享。
|
||||
- 模型渠道协议:渠道编辑可选择「火山方舟」并自动填入方舟接口地址;任意名称的生图模型应按方舟 JSON 格式提交参考图,任意名称的视频模型应按方舟任务格式提交和查询,不再依赖模型名包含 `doubao`、`seedream` 或 `seedance`;1080p 不应再因模型名包含 `fast` 被禁用,参考视频应允许最大 200MB、总像素 409600-8295044,并继续校验官方宽高、比例和时长限制。
|
||||
|
||||
Reference in New Issue
Block a user