Skip to content

feat: interactive mindmap with expand/collapse, zoom, node-ask, multi-format export#16

Open
Anionex wants to merge 70 commits into
OpenDCAI:mainfrom
Anionex:feat/interactive-mindmap
Open

feat: interactive mindmap with expand/collapse, zoom, node-ask, multi-format export#16
Anionex wants to merge 70 commits into
OpenDCAI:mainfrom
Anionex:feat/interactive-mindmap

Conversation

@Anionex

@Anionex Anionex commented Mar 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replace static Mermaid.js mindmap with interactive simple-mind-map library
  • Merge two-step LLM pipeline into single-pass with improved knowledge-map prompt
  • Add full mindmap interaction: expand/collapse all, zoom/pan/fit, node-level expand/collapse
  • Add export: PNG (fully expanded with padding), hierarchical TXT, Mermaid code
  • Add click-to-ask: click node → contextual question popover (2 options) → auto-fill chat input
  • Fix preview modal missing rounded corners and backdrop blur
  • Prompt retains concrete data/numbers, adapts to article type

Changes

  • Backend: Single-pass prompt with data-aware generation, max_depth=6 (route + state aligned)
  • Frontend: New MindMapPreview component, mermaidToMarkdown/markdownToMermaid utils, TS declarations
  • Dependencies: +simple-mind-map, -mermaid

Commits

  1. edfb7d0 — Backend: single-pass prompt + max_depth=6
  2. 9e8faff — Dependencies + format conversion utils + TS declarations
  3. a5fbc3e — MindMapPreview component + interactions + modal fix
  4. 4d438b3 — Code review fixes (debug logs, dead state, deps)
  5. 29e9656 — PNG export truncation fix (padding + fit before capture)

Test plan

  • Generate mindmap from uploaded document, verify interactive rendering
  • Test expand/collapse all buttons and node-level expand/collapse
  • Test zoom (scroll), pan (drag), fit button
  • Export PNG, TXT, Mermaid and verify output
  • Click node → verify popover with 2 question options
  • Select question → verify modal closes, chat input filled, input focused
  • Open old .mmd files in knowledge base → verify backward compatibility
  • PNG export captures full content without truncation

Huangdingcheng and others added 30 commits February 10, 2026 10:53
- Add flashcard data models and API endpoint
- Implement LLM-based flashcard generation service
- Create FlashcardGenerator and FlashcardViewer components
- Integrate flashcard feature into NotebookView
- Add development startup scripts
- Update Vite config for remote development

Co-Authored-By: Huangdingcheng <Apollo6662023@outlook.com>
Implement comprehensive Quiz functionality similar to NotebookLM:
- Single-choice questions with 4 options (A/B/C/D)
- Skip functionality for questions
- Statistics tracking (Right/Wrong/Skipped)
- Review Quiz with highlighted correct answers and detailed explanations
- Retake Quiz capability
- LLM-based question generation with quality prompts

Backend changes:
- Add Quiz data models (QuizOption, QuizQuestion, etc.) in schemas.py
- Create quiz_service.py for LLM-based question generation
- Add /generate-quiz API endpoint in kb.py
- Implement JSON parsing with error recovery for truncated responses

Frontend changes:
- Create QuizGenerator component for quiz creation
- Create QuizQuestion component for single question display
- Create QuizResults component with circular progress and statistics
- Create QuizReview component with answer explanations
- Create QuizContainer component as main orchestrator
- Integrate Quiz into NotebookView with Brain icon
- Update types to include 'quiz' in ToolType

Co-Authored-By: Huangdingcheng <Apollo6662023@outlook.com>
feat: Add Quiz feature with LLM-generated questions
…-to-load

Add backend read endpoints (list-flashcard-sets, list-quiz-sets,
get-flashcard-set, get-quiz-set) and wire frontend outputFeed items
to load saved sets from disk, surviving page refresh.

Co-Authored-By: Claude <noreply@anthropic.com>
…/flashcard/quiz)

- Rewrite /outputs disk fallback to scan notebook-centric paths via get_notebook_paths
- Frontend fetchOutputHistory now also calls list-flashcard-sets & list-quiz-sets
- mergeOutputFeeds preserves setId field during dedup
- Pass notebook_title to /outputs for reliable directory resolution

Co-Authored-By: Claude <noreply@anthropic.com>
…tart guide

- Rename Chinese image filenames to English for GitHub compatibility
- Add screenshots for all current features (12 total, collapsible)
- Update feature table: add flashcards, quizzes, web search, deep research
- Rewrite Quick Start with clear API config instructions (LLM/Search/Supabase)
- Add model configuration section (3-layer system)
- Restructure requirements-base.txt with categorized dependencies and version pins

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix introduce modal title (zh): remove outdated audio/video reference
- Add local embedding server (Octen-Embedding-0.6B) and download script
- Add logo assets for both frontends
- Update flashcard/quiz UI styling across en/zh frontends
- Update Dashboard and NotebookView with latest UI improvements
- Add docs guides (context_optimization, kb_source_flow)
- Remove obsolete requirements files (paper, win-base)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix openai version constraint (>=1.104.2,<2.0.0) to match langchain-openai==0.3.33
- Add missing deps: paddlepaddle, paddleocr, mineru_vl_utils, loguru
- Align requirements-backup.txt versions to notebook env (100 packages updated)

Co-Authored-By: Claude <noreply@anthropic.com>
完整集成 Alibaba DeepResearch 到 Open-NotebookLM 项目,支持双模式研究:
- 完整版 DeepResearch:多轮 ReAct 推理,支持工具调用
- 简化版:快速搜索和内容爬取

主要变更:
- 添加 DeepResearch 核心模块到 fastapi_app/deep_research/
- 实现 MultiTurnReactAgent 支持多轮推理
- 集成 5 个工具:Search, Visit, Python, Scholar, FileParser
- 修改 token 计数使用 tiktoken 替代 HuggingFace tokenizer
- 修复 API 调用支持完整 URL 和正确的 API key 传递
- 修复工具环境变量动态读取,避免模块加载时的静态绑定
- 添加 Jina API 错误处理,防止无限重试
- 实现 DeepResearchIntegration 服务类
- 更新 API 端点支持参数传递和双模式切换
- 减少重试次数从 10 次到 3 次

技术细节:
- 使用 qwen-agent 框架作为基础
- 支持 Serper API(搜索)和 Jina API(网页访问)
- 兼容 OpenAI API 格式的 LLM 服务
- 最大迭代次数可配置(默认 50 次)
- Token 上限 110K,超出自动截断

配置支持:
- 通过 API 请求传递配置参数
- 通过 .env 文件设置默认值
- 支持自定义 LLM API、搜索 API 和网页访问 API

Co-Authored-By: Huangdingcheng <Apollo6662023@outlook.com>
feat: 集成阿里巴巴 DeepResearch 深度研究功能
fix: resolve frontend and backend default port conflict
…v3.2

Merged PR OpenDCAI#6 and corrected port references across all docs and configs
to use port 8000. Reverted default LLM model change from gpt-4o back
to deepseek-v3.2 in frontend_zh.

Co-Authored-By: Claude <noreply@anthropic.com>
- ppt_tool.py: 在 ocr_images_to_ppt 和 convert_images_dir_to_pdf_and_ppt_api
  两处文本框写入逻辑中,复用已有 is_cjk() 函数,对含中文的文本自动设置
  Microsoft YaHei 字体,英文内容保持 Arial
- ppt_text_fit.py: TextFitStyle 默认字体从 Arial 改为 Microsoft YaHei,
  避免字体拟合时使用不含中文字形的字体

Co-Authored-By: Huangdingcheng <Apollo2023666@outlook.com>
…ana 2 support

- Embedding server: auto-pick free GPU via nvidia-smi, fallback to CPU
- Main app: skip re-launching embedding subprocess on --reload if already running
- DeepResearch: add missing deps (qwen-agent, alibabacloud-docmind, sandbox-fusion, etc.)
- DeepResearch: set API_KEY/API_BASE/SUMMARY_MODEL_NAME env vars for visit tool
- Frontend: always send search_api_key for all providers (including Serper)
- Frontend: show Search API Key input for Serper provider in settings
- PPT generation: add Nano Banana 2 image model option
- Docs: remove invalid `pip install -e .`, add changelog

Co-Authored-By: Claude <noreply@anthropic.com>
…ana 2 support

- Embedding server: auto-pick free GPU via nvidia-smi, fallback to CPU
- Main app: skip re-launching embedding subprocess on --reload if already running
- DeepResearch: add missing deps (qwen-agent, alibabacloud-docmind, sandbox-fusion, etc.)
- DeepResearch: set API_KEY/API_BASE/SUMMARY_MODEL_NAME env vars for visit tool
- Frontend: always send search_api_key for all providers (including Serper)
- Frontend: show Search API Key input for Serper provider in settings
- PPT generation: add Nano Banana 2 image model option
- Docs: remove invalid `pip install -e .`, add changelog

Co-Authored-By: Claude <noreply@anthropic.com>
- Implement block-based editor with drag-and-drop support
- Add slash command menu with multiple block types (text, headings, lists, code, etc.)
- Integrate AI chat feature for in-note assistance
- Support text auto-wrap and Enter key text splitting
- Add block operations (add, delete, type conversion)
- Implement both English and Chinese versions

Co-Authored-By: Huangdingcheng <Apollo6662023@outlook.com>
- Implement block-based editor with drag-and-drop support
- Add slash command menu with multiple block types (text, headings, lists, code, etc.)
- Integrate AI chat feature for in-note assistance
- Support text auto-wrap and Enter key text splitting
- Add block operations (add, delete, type conversion)
- Implement both English and Chinese versions

Co-Authored-By: Huangdingcheng <Apollo6662023@outlook.com>
Major Features:
- AI-assisted note editing: polish, rewrite, and source-based AI generation
- AI Panel: organize content with presets (summarize, outline, FAQ, etc.)
- Text Selection Toolbar: quick AI actions on selected text with diff preview
- Memory context: maintain conversation history for better AI responses

Bug Fixes:
- Fix reversed input issue by replacing contentEditable with textarea
- Fix first character deletion issue by consolidating event handling
- Fix numbered list indexing for mixed block types
- Simplify Backspace logic to avoid conflicts

Technical Improvements:
- Consolidate onChange/onInput handling to prevent event conflicts
- Use textarea.value consistently instead of mixed value/textContent
- Support both English and Chinese versions

Co-Authored-By: Hunagdingcheng <Apollo6662023@outlook.com>
feat: add Notion-style block editor for notes
- Phase 1: Split env config into .env and .env.models
- Phase 2: Remove 19 unused workflows, keep only 3 active
- Phase 3: Remove unused TTS adapters, keep Qwen and FireRed
- Update settings.py to load both env files
- Add TTS config fields to AppSettings
Huangdingcheng and others added 17 commits March 17, 2026 08:58
- Fix provider detection for Gemini TTS models
- Update frontend voice defaults from 'vivian' to 'Kore'
- Add voice name validation in ApiYiGeminiProvider
- Fix file_ids attribute error in podcast workflow
- Improve mindmap generation error handling

Co-Authored-By: Huangdingcheng <Apollo6662023@outlook.com>
- Accept main's note editor improvements
- Keep TTS voice validation fixes from this branch
Major Features:
- AI-assisted note editing: polish, rewrite, and source-based AI generation
- AI Panel: organize content with presets (summarize, outline, FAQ, etc.)
- Text Selection Toolbar: quick AI actions on selected text with diff preview
- Memory context: maintain conversation history for better AI responses

Bug Fixes:
- Fix reversed input issue by replacing contentEditable with textarea
- Fix first character deletion issue by consolidating event handling
- Fix numbered list indexing for mixed block types
- Simplify Backspace logic to avoid conflicts

Technical Improvements:
- Consolidate onChange/onInput handling to prevent event conflicts
- Use textarea.value consistently instead of mixed value/textContent
- Support both English and Chinese versions

Co-Authored-By: Hunagdingcheng <Apollo6662023@outlook.com>
… features

- Add guest login functionality to bypass Supabase authentication
- Fix numbered lists to preserve original AI-generated numbers (1. 2. 3.)
- Clean markdown format symbols (**bold**, *italic*) while preserving content
- Support indented bullet list parsing
- Add note editing capability with Edit/Delete buttons in output list
- Add timestamp to filenames to prevent same-name file conflicts
- Add 1-second delay for file list refresh after saving

Co-Authored-By: Huangdingcheng <Apollo6662023@outlook.com>
- 后端:实现完整的 Supabase 认证代理 API(登录/注册/登出/会话刷新)
- 后端:使用 HTTP-only cookies 存储访问令牌,提升安全性
- 后端:auth 端点从 API key 验证中排除
- 前端:移除直接 Supabase 连接,改用后端代理 API
- 前端:修复 401 响应后的加载状态问题
- 前端:优化会话刷新逻辑
- MinerU:启用 vLLM 模式,配置 GPU 利用率(TTS 65% + MinerU 30%)
- MinerU:修复端口配置,从环境变量读取
- 脚本:更新启动脚本的 GPU 配置
- 测试:添加 Supabase 连接测试脚本

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 同步 App.tsx, supabase.ts, authStore.ts 到英文版
- 同步 vite.config.ts 和 NotebookView.tsx
- 确保中英文前端功能一致

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 添加后端 OTP 验证和重发端点
- 前端实现 OTP 验证功能
- 登录/注册/验证成功时自动创建用户目录
- 优化速率限制错误提示
- 添加启动脚本

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tation

- Replace Chinese screenshots with English versions in README.md
- Add note feature documentation with screenshots (both EN and ZH versions)
- Enhance README layout with GitHub Stars badge and quick navigation
- Improve core features section with two-column layout

Co-Authored-By: Huangdingcheng <Apollo6662023@outlook.com>
docs: Update README with English screenshots and note feature documentation
@Anionex Anionex changed the title feat: replace Mermaid with interactive mindmap (simple-mind-map) feat: 交互式思维导图 — 展开收缩、缩放拖拽、节点提问、多格式导出 Mar 31, 2026
@Anionex Anionex changed the title feat: 交互式思维导图 — 展开收缩、缩放拖拽、节点提问、多格式导出 feat: interactive mindmap with expand/collapse, zoom, node-ask, multi-format export Mar 31, 2026
@Anionex Anionex marked this pull request as draft March 31, 2026 09:00
Anionex added 3 commits March 31, 2026 19:05
- Merge two-step LLM pipeline (analyze + generate) into one call
- Comprehensive prompt: adapts to article type, retains data/numbers,
  structures as topic modules with clear hierarchy
- max_depth default 6 (aligned in route and state)
- Replace mermaid with simple-mind-map in both frontends
- Add mermaidToMarkdown (indent-stack) and markdownToMermaid converters
- Add TypeScript declarations for simple-mind-map
- New MindMapPreview component (simple-mind-map): expand/collapse all,
  zoom/pan/fit, always-visible expand buttons, PNG/TXT/Mermaid export
- Click-to-ask popover: two contextual question options per node,
  closes modal, switches to chat, focuses input
- Fix preview modal: replace missing iOS Tailwind classes with standard
  rounded corners and backdrop blur
- Hide redundant download button for mindmap in modal header
- Delete old MermaidPreview component
@Anionex Anionex force-pushed the feat/interactive-mindmap branch from 9071ed8 to a5fbc3e Compare March 31, 2026 11:05
- Remove console.log debug statements from ZH MindMapPreview
- Remove unused isReady state from both EN/ZH components
- Keep useCallback/useEffect deps as [mermaidCode] (no self-reference)
@Anionex Anionex force-pushed the feat/interactive-mindmap branch from ddd9c9b to 4d438b3 Compare March 31, 2026 11:24
- exportPadding 20→50 to prevent bottom/right clipping
- After EXPAND_ALL, call view.fit() before export to ensure full layout
@Anionex Anionex marked this pull request as ready for review March 31, 2026 11:30
Anionex added a commit to Anionex/Open-NotebookLM that referenced this pull request Apr 7, 2026
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.

6 participants