[PR #7754] [MERGED] feat: support anon local ai chat/writer #8090

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

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/7754
Author: @appflowy
Created: 4/15/2025
Status: Merged
Merged: 4/17/2025
Merged by: @appflowy

Base: mainHead: local_chat2


📝 Commits (10+)

  • f62686f chore: support local chat
  • e5b6393 Merge branch 'main' into local_chat2
  • c89f33e chore: remove unused code
  • 77fbf0f chore: local ai initialize
  • c633dd0 chore: remove unused code
  • 98b8352 chore: remove unused code
  • af91a72 chore: select message
  • 13065ac chore: add tests
  • c2339c3 Merge branch 'main' into local_chat2
  • 57e4d26 chore: enable local chat

📊 Changes

58 files changed (+1670 additions, -1090 deletions)

View changed files

📝 frontend/appflowy_flutter/lib/plugins/ai_chat/chat_page.dart (+8 -11)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/ai/ai_writer_toolbar_item.dart (+6 -10)
📝 frontend/appflowy_flutter/lib/user/application/workspace_error_bloc.dart (+1 -14)
📝 frontend/appflowy_flutter/lib/user/presentation/screens/workspace_error_screen.dart (+0 -42)
frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/local_settings_ai_view.dart (+34 -0)
📝 frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/settings_ai_view.dart (+0 -17)
📝 frontend/appflowy_flutter/lib/workspace/presentation/settings/settings_dialog.dart (+6 -1)
📝 frontend/rust-lib/Cargo.lock (+19 -222)
📝 frontend/rust-lib/Cargo.toml (+4 -2)
📝 frontend/rust-lib/event-integration-test/Cargo.toml (+0 -9)
📝 frontend/rust-lib/event-integration-test/tests/main.rs (+2 -0)
frontend/rust-lib/event-integration-test/tests/sql_test/chat_message_test.rs (+596 -0)
frontend/rust-lib/event-integration-test/tests/sql_test/mod.rs (+1 -0)
📝 frontend/rust-lib/flowy-ai-pub/Cargo.toml (+2 -1)
📝 frontend/rust-lib/flowy-ai-pub/src/cloud.rs (+3 -7)
📝 frontend/rust-lib/flowy-ai-pub/src/lib.rs (+1 -0)
📝 frontend/rust-lib/flowy-ai-pub/src/persistence/chat_message_sql.rs (+75 -13)
📝 frontend/rust-lib/flowy-ai-pub/src/persistence/chat_sql.rs (+55 -13)
📝 frontend/rust-lib/flowy-ai-pub/src/persistence/mod.rs (+0 -0)
📝 frontend/rust-lib/flowy-ai/Cargo.toml (+2 -2)

...and 38 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 local chat support in AppFlowy by refactoring and enhancing the local AI and chat message persistence infrastructure

New Features:

  • Added support for local chat functionality in the AppFlowy local server
  • Implemented local chat message persistence with advanced querying capabilities
  • Enhanced local AI chat message handling and storage

Enhancements:

  • Refactored chat message table schema to support more flexible metadata
  • Improved message retrieval with pagination and cursor-based navigation
  • Simplified local AI controller and resource management
  • Enhanced chat message selection and filtering

Tests:

  • Added comprehensive SQL integration tests for chat message persistence
  • Implemented test cases for message insertion, selection, and pagination

Chores:

  • Removed deprecated and unused code related to cloud services
  • Simplified local server implementations
  • Updated dependencies and cargo configurations

🔄 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/7754 **Author:** [@appflowy](https://github.com/appflowy) **Created:** 4/15/2025 **Status:** ✅ Merged **Merged:** 4/17/2025 **Merged by:** [@appflowy](https://github.com/appflowy) **Base:** `main` ← **Head:** `local_chat2` --- ### 📝 Commits (10+) - [`f62686f`](https://github.com/AppFlowy-IO/AppFlowy/commit/f62686fdeb1304e3eaabd829d95f77adbd7ad9d4) chore: support local chat - [`e5b6393`](https://github.com/AppFlowy-IO/AppFlowy/commit/e5b6393257feb2b7b008d0c5f42c89df65e38a73) Merge branch 'main' into local_chat2 - [`c89f33e`](https://github.com/AppFlowy-IO/AppFlowy/commit/c89f33e2f89f5cc82b3c3ff5b72f2f8b7e683605) chore: remove unused code - [`77fbf0f`](https://github.com/AppFlowy-IO/AppFlowy/commit/77fbf0f8a355bca2caaf123dd6b60e6ad06ab643) chore: local ai initialize - [`c633dd0`](https://github.com/AppFlowy-IO/AppFlowy/commit/c633dd0919304a160f6ac06e0c523da3354f5797) chore: remove unused code - [`98b8352`](https://github.com/AppFlowy-IO/AppFlowy/commit/98b835227ed59bb64b572ba886bef04aa7d038d4) chore: remove unused code - [`af91a72`](https://github.com/AppFlowy-IO/AppFlowy/commit/af91a72187a5bd199c3f95a951608b6493f48998) chore: select message - [`13065ac`](https://github.com/AppFlowy-IO/AppFlowy/commit/13065ac726e8e52ab9f0ff39838079b9e29eb926) chore: add tests - [`c2339c3`](https://github.com/AppFlowy-IO/AppFlowy/commit/c2339c3522ae966759059d384eab35eac780ee78) Merge branch 'main' into local_chat2 - [`57e4d26`](https://github.com/AppFlowy-IO/AppFlowy/commit/57e4d269eb097a527b5982fee2a7a5fd13bea0e4) chore: enable local chat ### 📊 Changes **58 files changed** (+1670 additions, -1090 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/lib/plugins/ai_chat/chat_page.dart` (+8 -11) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/ai/ai_writer_toolbar_item.dart` (+6 -10) 📝 `frontend/appflowy_flutter/lib/user/application/workspace_error_bloc.dart` (+1 -14) 📝 `frontend/appflowy_flutter/lib/user/presentation/screens/workspace_error_screen.dart` (+0 -42) ➕ `frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/local_settings_ai_view.dart` (+34 -0) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/settings_ai_view.dart` (+0 -17) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/settings/settings_dialog.dart` (+6 -1) 📝 `frontend/rust-lib/Cargo.lock` (+19 -222) 📝 `frontend/rust-lib/Cargo.toml` (+4 -2) 📝 `frontend/rust-lib/event-integration-test/Cargo.toml` (+0 -9) 📝 `frontend/rust-lib/event-integration-test/tests/main.rs` (+2 -0) ➕ `frontend/rust-lib/event-integration-test/tests/sql_test/chat_message_test.rs` (+596 -0) ➕ `frontend/rust-lib/event-integration-test/tests/sql_test/mod.rs` (+1 -0) 📝 `frontend/rust-lib/flowy-ai-pub/Cargo.toml` (+2 -1) 📝 `frontend/rust-lib/flowy-ai-pub/src/cloud.rs` (+3 -7) 📝 `frontend/rust-lib/flowy-ai-pub/src/lib.rs` (+1 -0) 📝 `frontend/rust-lib/flowy-ai-pub/src/persistence/chat_message_sql.rs` (+75 -13) 📝 `frontend/rust-lib/flowy-ai-pub/src/persistence/chat_sql.rs` (+55 -13) 📝 `frontend/rust-lib/flowy-ai-pub/src/persistence/mod.rs` (+0 -0) 📝 `frontend/rust-lib/flowy-ai/Cargo.toml` (+2 -2) _...and 38 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 - [ ] 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 Implement local chat support in AppFlowy by refactoring and enhancing the local AI and chat message persistence infrastructure New Features: - Added support for local chat functionality in the AppFlowy local server - Implemented local chat message persistence with advanced querying capabilities - Enhanced local AI chat message handling and storage Enhancements: - Refactored chat message table schema to support more flexible metadata - Improved message retrieval with pagination and cursor-based navigation - Simplified local AI controller and resource management - Enhanced chat message selection and filtering Tests: - Added comprehensive SQL integration tests for chat message persistence - Implemented test cases for message insertion, selection, and pagination Chores: - Removed deprecated and unused code related to cloud services - Simplified local server implementations - Updated dependencies and cargo configurations --- <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:34 +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#8090
No description provided.