Merged
Conversation
Contributor
|
⏳ Processing in progress |
Preview mcp_server Image: |
Preview sandbox Image: |
Preview fastgpt Image: |
a88b2cd to
54b4192
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements soft delete functionality for chat logs, introducing a new deleteTime field to the chat schema. The implementation differentiates between user-facing soft deletes (for chat history management) and administrative hard deletes (for log management with proper permissions).
Key changes include:
- Added soft delete capability with a new
deleteTimefield in the chat schema and updated database indexes - Created new API endpoints for chat history management (getHistories, updateHistory, delHistory, clearHistories, batchDelete)
- Implemented batch delete functionality in the logs UI with multi-select capability
Reviewed changes
Copilot reviewed 34 out of 38 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
packages/service/core/chat/chatSchema.ts |
Added deleteTime field to chat schema and updated indexes to support soft delete filtering |
packages/global/openapi/core/chat/history/api.ts |
Defined Zod schemas for new chat history API endpoints with proper validation |
packages/global/openapi/core/chat/history/index.ts |
Added OpenAPI documentation for chat history management endpoints |
projects/app/src/pages/api/core/chat/history/delHistory.ts |
New endpoint for soft deleting a single chat history |
projects/app/src/pages/api/core/chat/history/clearHistories.ts |
Modified to use soft delete instead of hard delete for clearing chat histories |
projects/app/src/pages/api/core/chat/history/batchDelete.ts |
New endpoint for hard deleting multiple chats (admin function for log management) |
projects/app/src/pages/api/core/chat/history/updateHistory.ts |
Updated to use new schema validation and updateOne instead of findOneAndUpdate |
projects/app/src/pages/api/core/chat/history/getHistories.ts |
Modified to exclude soft-deleted chats from results |
projects/app/src/web/core/chat/history/api.ts |
New API client functions for chat history management |
projects/app/src/pageComponents/app/detail/Logs/LogTable.tsx |
Added batch delete UI with multi-select checkboxes and floating action bar |
packages/web/hooks/useTableMultipleSelect.tsx |
Enhanced to support custom active background color |
packages/web/components/common/MyPopover/PopoverConfirm.tsx |
Improved event handling with stopPropagation for better UX |
packages/web/i18n/*/app.json |
Added translations for delete confirmation messages |
test/mocks/common/s3.ts |
Added mock functions for S3 chat source operations to support testing |
projects/app/test/api/core/chat/history/*.test.ts |
Comprehensive test coverage for all new history API endpoints |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Docs Preview:🚀 FastGPT Document Preview Ready! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.