[PR #7652] [MERGED] chore: display message when using ai writer with local ai, but local ai is disabled #8020

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

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/7652
Author: @appflowy
Created: 3/30/2025
Status: Merged
Merged: 3/30/2025
Merged by: @appflowy

Base: mainHead: show_not_ready


📝 Commits (4)

  • f76ce2b chore: show not ready state when using ai writer with local ai
  • 2277d7d chore: show local ai disable
  • b63c4df chore: show local ai disable
  • e3a0806 chore: clippy

📊 Changes

15 files changed (+214 additions, -105 deletions)

View changed files

📝 frontend/appflowy_flutter/lib/ai/service/ai_entities.dart (+14 -0)
📝 frontend/appflowy_flutter/lib/ai/service/appflowy_ai_service.dart (+77 -49)
📝 frontend/appflowy_flutter/lib/plugins/ai_chat/application/chat_message_stream.dart (+12 -22)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/ai/ai_writer_block_component.dart (+20 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/ai/operations/ai_writer_cubit.dart (+25 -0)
📝 frontend/appflowy_flutter/test/bloc_test/ai_writer_test/ai_writer_bloc_test.dart (+8 -0)
📝 frontend/resources/translations/en.json (+3 -1)
📝 frontend/rust-lib/flowy-ai/src/ai_manager.rs (+16 -4)
📝 frontend/rust-lib/flowy-ai/src/chat.rs (+5 -8)
📝 frontend/rust-lib/flowy-ai/src/completion.rs (+14 -13)
📝 frontend/rust-lib/flowy-ai/src/event_handler.rs (+5 -1)
📝 frontend/rust-lib/flowy-ai/src/event_map.rs (+1 -5)
📝 frontend/rust-lib/flowy-ai/src/middleware/chat_service_mw.rs (+6 -2)
📝 frontend/rust-lib/flowy-error/src/code.rs (+3 -0)
📝 frontend/rust-lib/flowy-error/src/errors.rs (+5 -0)

📄 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

Add support for displaying messages when local AI is disabled or not ready in the AI writer

New Features:

  • Introduce a new LocalAIStreamingState to handle local AI streaming states
  • Add UI support for displaying messages when local AI is disabled or not ready

Enhancements:

  • Refactor AI event handling to support more granular local AI state reporting
  • Improve error handling for local AI scenarios

Chores:

  • Update error codes to include LocalAIDisabled
  • Modify AI service interfaces to support local AI state changes

🔄 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/7652 **Author:** [@appflowy](https://github.com/appflowy) **Created:** 3/30/2025 **Status:** ✅ Merged **Merged:** 3/30/2025 **Merged by:** [@appflowy](https://github.com/appflowy) **Base:** `main` ← **Head:** `show_not_ready` --- ### 📝 Commits (4) - [`f76ce2b`](https://github.com/AppFlowy-IO/AppFlowy/commit/f76ce2be1481a4195b462632da6cd096bf5fdef0) chore: show not ready state when using ai writer with local ai - [`2277d7d`](https://github.com/AppFlowy-IO/AppFlowy/commit/2277d7d23436c6cb2ecc62a2929e9578b2319ff0) chore: show local ai disable - [`b63c4df`](https://github.com/AppFlowy-IO/AppFlowy/commit/b63c4dfe212436be8cfcea8a478636e86f1d4322) chore: show local ai disable - [`e3a0806`](https://github.com/AppFlowy-IO/AppFlowy/commit/e3a0806eee2e24cc47f015655fa09f5fd8a97b1e) chore: clippy ### 📊 Changes **15 files changed** (+214 additions, -105 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/lib/ai/service/ai_entities.dart` (+14 -0) 📝 `frontend/appflowy_flutter/lib/ai/service/appflowy_ai_service.dart` (+77 -49) 📝 `frontend/appflowy_flutter/lib/plugins/ai_chat/application/chat_message_stream.dart` (+12 -22) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/ai/ai_writer_block_component.dart` (+20 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/ai/operations/ai_writer_cubit.dart` (+25 -0) 📝 `frontend/appflowy_flutter/test/bloc_test/ai_writer_test/ai_writer_bloc_test.dart` (+8 -0) 📝 `frontend/resources/translations/en.json` (+3 -1) 📝 `frontend/rust-lib/flowy-ai/src/ai_manager.rs` (+16 -4) 📝 `frontend/rust-lib/flowy-ai/src/chat.rs` (+5 -8) 📝 `frontend/rust-lib/flowy-ai/src/completion.rs` (+14 -13) 📝 `frontend/rust-lib/flowy-ai/src/event_handler.rs` (+5 -1) 📝 `frontend/rust-lib/flowy-ai/src/event_map.rs` (+1 -5) 📝 `frontend/rust-lib/flowy-ai/src/middleware/chat_service_mw.rs` (+6 -2) 📝 `frontend/rust-lib/flowy-error/src/code.rs` (+3 -0) 📝 `frontend/rust-lib/flowy-error/src/errors.rs` (+5 -0) </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 - [ ] My code adheres to [AppFlowy's Conventions](https://docs.appflowy.io/docs/documentation/software-contributions/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 Add support for displaying messages when local AI is disabled or not ready in the AI writer New Features: - Introduce a new LocalAIStreamingState to handle local AI streaming states - Add UI support for displaying messages when local AI is disabled or not ready Enhancements: - Refactor AI event handling to support more granular local AI state reporting - Improve error handling for local AI scenarios Chores: - Update error codes to include LocalAIDisabled - Modify AI service interfaces to support local AI state changes --- <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:15 +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#8020
No description provided.