Skip to content

Feature/ppt 3#27

Open
zhezhitanye-code wants to merge 9 commits into
mainfrom
feature/ppt-3
Open

Feature/ppt 3#27
zhezhitanye-code wants to merge 9 commits into
mainfrom
feature/ppt-3

Conversation

@zhezhitanye-code
Copy link
Copy Markdown
Collaborator

变更摘要

本次 PR 主要完善了 PPT 生成、预览、导出与下载链路。

主要改动

  • 新增结构化大纲卡片,并持久化保存 outline_payload
  • 新增 LLM 逐轮温和追问教学意图的流程
  • 新增每页 2 张候选配图,支持用户选择或不选择
  • 新增演讲备注生成、保存与预览展示
  • 优化 PPT 文本修改逻辑,安全更新标题、副标题和正文
  • 优化预览体验与缩放提示
  • 修复 Docmee 刷新下载地址失败时 PPT 无法下载的问题
  • 将 PDF 导出从隐藏 SVG 渲染改为 canvas 渲染,修复白页问题

Backend:
- Add PPT models (session, outline, message, result) with Alembic migration
- Add Docmee API proxy client with token management and V2 task flow
- Add auto image search service (Unsplash + LLM keyword translation)
- Add LangGraph workflow (retrieve -> outline -> image -> approval)
- Add PPT API routes: sessions, streaming outline, generate, modify, edit snapshot, download, versions

Frontend:
- Add ppt.js API client with SSE streaming support
- Add components: WelcomePanel, ChatPanel, ChatMessage, ChatInput, OutlineCard, TemplateSelector, KnowledgeLibraryModal, PptSidebar, PptThumbnailList, PptCanvas
- Rewrite LessonPrepPpt.vue with 3-stage flow (welcome -> chat -> preview)
- Add schemas/ppt.py with all request/response models
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@zhezhitanye-code
Copy link
Copy Markdown
Collaborator Author

@code-review

@zichen0116
Copy link
Copy Markdown
Owner

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e05737d1a1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread backend/app/api/ppt.py
Comment on lines +374 to +376
outline_result = await db.execute(
select(PptOutline).where(PptOutline.id == body.outline_id)
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Scope outline lookup to the authenticated session

stream_generate_ppt validates session_id for the current user, but then loads the outline by id alone. A crafted request can pass an outline from a different session (or another user if IDs are guessed), causing unauthorized outline content to be rendered into a new PPT and also creating cross-session foreign-key links (ppt_results.outline_id) that can cascade-delete unrelated results later. The outline query should be constrained to the same session/user context before generation proceeds.

Useful? React with 👍 / 👎.

Comment on lines +492 to +495
clarificationStage.value = 'generating_outline'
await streamGenerateOutline(buildOutlineRequestText())
clarificationStage.value = 'done'
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve clarification state when outline generation fails

After collecting clarification answers, handleSend always sets clarificationStage to done immediately after streamGenerateOutline(...), even when generation fails. Because streamGenerateOutline catches errors internally (does not rethrow), the stage still advances to done with no currentOutline, and subsequent sends bypass both idle and awaiting_reply branches, leaving the conversation stuck with no way to continue the outline flow.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants