diff --git a/CHANGELOG.md b/CHANGELOG.md index 28da3b2..b8cf95d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased ++ [新增] 画布节点提示词输入支持弹窗放大编辑,长提示词和多行内容可在更大空间内修改。 ++ [修复] 已有图片或文本节点的编辑提示词在关闭输入面板后继续保留,不再因点击画布空白处丢失。 + [新增] 配置页新增本地存储面板,可查看 Infinite Canvas 的 IndexedDB、站点配额和各对象仓库占用情况。 + [修复] 本地图片清理时保留生图与视频工作台历史引用的文件,避免生成记录仍在但图片丢失。 + [修复] 画布将空格键专用于临时切换工具,避免按钮保留焦点后按空格被再次触发。 diff --git a/docs/content/docs/progress/pending-test.mdx b/docs/content/docs/progress/pending-test.mdx index 3589c78..ffc730b 100644 --- a/docs/content/docs/progress/pending-test.mdx +++ b/docs/content/docs/progress/pending-test.mdx @@ -10,7 +10,7 @@ The current release needs manual verification in these areas: - Canvas navigation: the bottom toolbar should switch between Select and Move modes and reflect the active mode with its icon; Select should draw a clearly spaced dashed range whose dash length, gap, and stroke width remain visually constant at every zoom level, while Move should pan from either the background or a node. Holding Control or Space should temporarily invert the active tool without changing the toolbar mode: Select becomes Move, and Move becomes range selection. After clicking any canvas-page button, pressing Space should only invert the tool and must not trigger that button again. Middle-button panning and additive node selection with Shift/Cmd should continue to work, while Space remains available inside text inputs and editable content. - 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. +- Canvas node resize stability, prompt scrolling, generated-prompt restoration, edit-prompt persistence after closing an existing image or text node panel, expanded prompt editing with save/cancel behavior and `@` references, image editing, drag-and-drop references, and generation configuration. - Canvas side panel: clicking an element row should smoothly center and select its node without zooming above 100%; image elements with content should still open the large preview without triggering canvas focus. - 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 state should use a compact stack with at most three closely spaced backplates and a clearly legible count control; clicking the control should hide the floating toolbar 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. - Multi-image primary selection: choosing another primary image should preserve the node center and current maximum edge while adapting to the new image ratio; free-resize nodes should keep their exact dimensions, and the viewport zoom indicator must not change. diff --git a/web/src/components/canvas/canvas-node-prompt-panel.tsx b/web/src/components/canvas/canvas-node-prompt-panel.tsx index 903ccb7..babcc9a 100644 --- a/web/src/components/canvas/canvas-node-prompt-panel.tsx +++ b/web/src/components/canvas/canvas-node-prompt-panel.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; -import { ArrowUp, LoaderCircle, Square } from "lucide-react"; -import { Button } from "antd"; +import { ArrowUp, LoaderCircle, Maximize2, Square } from "lucide-react"; +import { Button, Modal, Tooltip } from "antd"; import { useTranslation } from "react-i18next"; import { ModelPicker } from "@/components/model-picker"; @@ -40,17 +40,20 @@ export function CanvasNodePromptPanel({ node, isRunning, onPromptChange, onConfi const hasTextContent = node.type === CanvasNodeType.Text && Boolean(node.metadata?.content?.trim()); const hasImageContent = node.type === CanvasNodeType.Image && Boolean(node.metadata?.content); const isEditingExistingContent = hasTextContent || hasImageContent; - const [prompt, setPrompt] = useState(node.metadata?.prompt || ""); + const [prompt, setPrompt] = useState(node.metadata?.composerContent ?? node.metadata?.prompt ?? ""); + const [expandedPrompt, setExpandedPrompt] = useState(""); + const [expanded, setExpanded] = useState(false); // Restore prompts only when switching nodes; preserve the current input after generation on the same node. useEffect(() => { - setPrompt(node.metadata?.prompt || ""); + setPrompt(node.metadata?.composerContent ?? node.metadata?.prompt ?? ""); // eslint-disable-next-line react-hooks/exhaustive-deps }, [node.id]); const updatePrompt = (value: string) => { setPrompt(value); - if (!isEditingExistingContent) onPromptChange(node.id, value); + if (isEditingExistingContent) onConfigChange(node.id, { composerContent: value }); + else onPromptChange(node.id, value); }; const submit = () => { @@ -59,6 +62,16 @@ export function CanvasNodePromptPanel({ node, isRunning, onPromptChange, onConfi onGenerate(node.id, mode, text); }; + const openExpandedEditor = () => { + setExpandedPrompt(prompt); + setExpanded(true); + }; + + const saveExpandedPrompt = () => { + updatePrompt(expandedPrompt); + setExpanded(false); + }; + return (
event.stopPropagation()} onWheel={(event) => event.stopPropagation()} > - +
+ + +
@@ -131,6 +149,18 @@ export function CanvasNodePromptPanel({ node, isRunning, onPromptChange, onConfi
+ setExpanded(false)} destroyOnHidden> +
event.stopPropagation()}> + +
+
); } diff --git a/web/src/components/canvas/canvas-prompt-chip-input.tsx b/web/src/components/canvas/canvas-prompt-chip-input.tsx index 8ba6626..ee66ef3 100644 --- a/web/src/components/canvas/canvas-prompt-chip-input.tsx +++ b/web/src/components/canvas/canvas-prompt-chip-input.tsx @@ -225,7 +225,7 @@ function MentionMenu({ rect, references, activeIndex, theme, onSelect }: { rect: return createPortal(