[PR #7805] [MERGED] feat: built-in custom prompts #8126

Closed
opened 2026-03-23 23:22:44 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/7805
Author: @richardshiue
Created: 4/22/2025
Status: Merged
Merged: 4/23/2025
Merged by: @richardshiue

Base: mainHead: feat/built-in-prompt-library


📝 Commits (4)

📊 Changes

21 files changed (+2276 additions, -94 deletions)

View changed files

frontend/appflowy_flutter/assets/built_in_prompts.json (+874 -0)
📝 frontend/appflowy_flutter/lib/ai/ai.dart (+3 -2)
📝 frontend/appflowy_flutter/lib/ai/service/ai_entities.dart (+97 -0)
frontend/appflowy_flutter/lib/ai/service/ai_prompt_selector_cubit.dart (+206 -0)
📝 frontend/appflowy_flutter/lib/ai/service/appflowy_ai_service.dart (+40 -0)
frontend/appflowy_flutter/lib/ai/widgets/ai_prompt_modal/ai_prompt_category_list.dart (+184 -0)
frontend/appflowy_flutter/lib/ai/widgets/ai_prompt_modal/ai_prompt_modal.dart (+152 -0)
frontend/appflowy_flutter/lib/ai/widgets/ai_prompt_modal/ai_prompt_preview.dart (+201 -0)
frontend/appflowy_flutter/lib/ai/widgets/ai_prompt_modal/ai_prompt_visible_list.dart (+244 -0)
frontend/appflowy_flutter/lib/ai/widgets/prompt_input/browse_prompts_button.dart (+67 -0)
📝 frontend/appflowy_flutter/lib/ai/widgets/prompt_input/desktop_prompt_input.dart (+57 -42)
📝 frontend/appflowy_flutter/lib/ai/widgets/prompt_input/mentioned_page_text_span.dart (+13 -14)
frontend/appflowy_flutter/lib/ai/widgets/prompt_input/prompt_input_text_controller.dart (+78 -0)
📝 frontend/appflowy_flutter/lib/plugins/ai_chat/chat_page.dart (+1 -1)
📝 frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_input/mobile_chat_input.dart (+6 -4)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/ai/ai_writer_block_component.dart (+3 -3)
📝 frontend/appflowy_flutter/lib/workspace/presentation/widgets/dialog_v2.dart (+5 -16)
📝 frontend/appflowy_flutter/packages/appflowy_ui/example/lib/src/modal/modal_page.dart (+1 -1)
📝 frontend/appflowy_flutter/packages/appflowy_ui/lib/src/component/textfield/textfield.dart (+6 -1)
📝 frontend/appflowy_flutter/pubspec.yaml (+9 -8)

...and 1 more files

📄 Description

Feature Preview


PR Checklist

  • My code adheres to AppFlowy's Conventions
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

Summary by Sourcery

Implement built-in prompts feature for AI interactions, adding a comprehensive system for browsing, selecting, and using predefined AI prompts across the application

New Features:

  • Add a built-in prompts system with categorization and browsing capabilities
  • Introduce a modal for exploring and selecting AI prompts
  • Create a mechanism for using predefined prompts in AI interactions

Enhancements:

  • Improve text input handling for AI prompts with special text span support
  • Enhance AI prompt selection with category filtering and preview

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/7805 **Author:** [@richardshiue](https://github.com/richardshiue) **Created:** 4/22/2025 **Status:** ✅ Merged **Merged:** 4/23/2025 **Merged by:** [@richardshiue](https://github.com/richardshiue) **Base:** `main` ← **Head:** `feat/built-in-prompt-library` --- ### 📝 Commits (4) - [`0da64f6`](https://github.com/AppFlowy-IO/AppFlowy/commit/0da64f68442e2b9400f74092131bb23b741d0345) feat: custom prompts - [`500a77c`](https://github.com/AppFlowy-IO/AppFlowy/commit/500a77c666732b3da51aac6901a9a05e53f6b6ef) chore: add new prompts - [`b4ade06`](https://github.com/AppFlowy-IO/AppFlowy/commit/b4ade061e540bfa6c8a17e1f1501b0dd151c5113) chore: hover to preview - [`40f8559`](https://github.com/AppFlowy-IO/AppFlowy/commit/40f85594d89f7f464a1825f87577eb0ddce1c6e2) chore: enable in ai writer as well ### 📊 Changes **21 files changed** (+2276 additions, -94 deletions) <details> <summary>View changed files</summary> ➕ `frontend/appflowy_flutter/assets/built_in_prompts.json` (+874 -0) 📝 `frontend/appflowy_flutter/lib/ai/ai.dart` (+3 -2) 📝 `frontend/appflowy_flutter/lib/ai/service/ai_entities.dart` (+97 -0) ➕ `frontend/appflowy_flutter/lib/ai/service/ai_prompt_selector_cubit.dart` (+206 -0) 📝 `frontend/appflowy_flutter/lib/ai/service/appflowy_ai_service.dart` (+40 -0) ➕ `frontend/appflowy_flutter/lib/ai/widgets/ai_prompt_modal/ai_prompt_category_list.dart` (+184 -0) ➕ `frontend/appflowy_flutter/lib/ai/widgets/ai_prompt_modal/ai_prompt_modal.dart` (+152 -0) ➕ `frontend/appflowy_flutter/lib/ai/widgets/ai_prompt_modal/ai_prompt_preview.dart` (+201 -0) ➕ `frontend/appflowy_flutter/lib/ai/widgets/ai_prompt_modal/ai_prompt_visible_list.dart` (+244 -0) ➕ `frontend/appflowy_flutter/lib/ai/widgets/prompt_input/browse_prompts_button.dart` (+67 -0) 📝 `frontend/appflowy_flutter/lib/ai/widgets/prompt_input/desktop_prompt_input.dart` (+57 -42) 📝 `frontend/appflowy_flutter/lib/ai/widgets/prompt_input/mentioned_page_text_span.dart` (+13 -14) ➕ `frontend/appflowy_flutter/lib/ai/widgets/prompt_input/prompt_input_text_controller.dart` (+78 -0) 📝 `frontend/appflowy_flutter/lib/plugins/ai_chat/chat_page.dart` (+1 -1) 📝 `frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_input/mobile_chat_input.dart` (+6 -4) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/ai/ai_writer_block_component.dart` (+3 -3) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/widgets/dialog_v2.dart` (+5 -16) 📝 `frontend/appflowy_flutter/packages/appflowy_ui/example/lib/src/modal/modal_page.dart` (+1 -1) 📝 `frontend/appflowy_flutter/packages/appflowy_ui/lib/src/component/textfield/textfield.dart` (+6 -1) 📝 `frontend/appflowy_flutter/pubspec.yaml` (+9 -8) _...and 1 more files_ </details> ### 📄 Description <!--- Thank you for submitting a pull request to AppFlowy. The team will dedicate their best efforts to reviewing and approving your pull request. If you have any questions about the project or feedback for us, please join our [Discord](https://discord.gg/wdjWUXXhtw). --> <!--- If your pull request adds a new feature, please drag and drop a video into this section to showcase what you've done! If not, you may delete this section. --> ### Feature Preview <!--- List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example: fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106 --> --- <!--- Before you mark this PR ready for review, run through this checklist! --> #### PR Checklist - [x] My code adheres to [AppFlowy's Conventions](https://docs.appflowy.io/docs/documentation/software-contributions/conventions) - [x] I've listed at least one issue that this PR fixes in the description above. - [x] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [x] All existing tests are passing. ## Summary by Sourcery Implement built-in prompts feature for AI interactions, adding a comprehensive system for browsing, selecting, and using predefined AI prompts across the application New Features: - Add a built-in prompts system with categorization and browsing capabilities - Introduce a modal for exploring and selecting AI prompts - Create a mechanism for using predefined prompts in AI interactions Enhancements: - Improve text input handling for AI prompts with special text span support - Enhance AI prompt selection with category filtering and preview --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 23:22:44 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#8126
No description provided.