feat(prompt): AI 提示词优化双栏交互

新增 prompt API 模块调用后端 /api/v1/prompt/optimize,PromptEditor
重构为左右双栏布局支持原始/优化提示词对比编辑,默认开启 AI 优化,
用户可关闭开关或手动编辑优化结果后再提交生成。
This commit is contained in:
2026-05-24 21:16:15 +08:00
parent eac64105de
commit c177cbaf82
6 changed files with 304 additions and 22 deletions
+3 -3
View File
@@ -8,7 +8,7 @@ import ProgressBar from '../components/ProgressBar'
export default function GeneratePage() {
const { projectId = 'proj-default' } = useParams()
const navigate = useNavigate()
const { prompt, assetType, reset: resetTask } = useTaskStore()
const { assetType, reset: resetTask } = useTaskStore()
const {
status,
stage,
@@ -35,8 +35,8 @@ export default function GeneratePage() {
}
}, [status, taskId, projectId, navigate])
const handleSubmit = async () => {
await submit(projectId, prompt, assetType)
const handleSubmit = async (finalPrompt: string) => {
await submit(projectId, finalPrompt, assetType)
}
const handleReset = () => {