General Improvements #4
Merged
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.
This pull request includes several changes aimed at improving the MCP frontend application, including updates to the user interface, API integration, and code organization. The most important changes include the addition of new API calls, the introduction of a new component, and various UI enhancements.
API Integration:
src/api/index.ts
: Added new functionsfetchLLMProviders
andfetchTools
to fetch data from the backend API.New Component:
src/components/AIIcon.tsx
: Created a newAIIcon
component for displaying an AI icon with customizable size and color.UI Enhancements:
src/App.tsx
: Updated the app to include the newAIIcon
component in the header.index.html
: Changed the favicon link to usemcp_chat.svg
instead ofvite.svg
.Code Organization:
src/components/ChatContainer.tsx
: Refactored theChatContainer
component to use the newChatService
class and improved state management. [1] [2] [3] [4]Other Changes:
README.md
: Updated instructions for setting environment variables when running with Docker.API Methods and Service Refactoring:
src/api/index.ts
: Added new methodsfetchLLMProviders
andfetchTools
for fetching LLM providers and tools.src/services/APIClient.ts
: IntroducedAPIClient
class to handle API requests with error handling.src/services/ChatService.ts
: RefactoredChatService
to extendAPIClient
and added methods for sending messages and loading chat history.src/services/LLMService.ts
: AddedLLMService
class for fetching LLM providers.src/services/ToolService.ts
: AddedToolService
class for fetching tools.Component Updates:
src/components/ChatContainer.tsx
: Updated to use the newChatService
and refactored state management for chat messages. [1] [2] [3] [4] [5]src/components/LLMProvidersModal.tsx
: Updated to use the newLLMService
and refactored the modal's state and error handling. [1] [2] [3]src/components/ChatInputButton/ToolsModal.tsx
: Updated to use the newfetchTools
method fromsrc/api/index.ts
. [1] [2]Documentation and Other Changes:
README.md
: Updated instructions for running the application locally and with Docker.src/types/llm.ts
: AddedLLMProvidersResponse
interface.These changes aim to improve the maintainability and scalability of the codebase by introducing a more structured approach to API interactions and enhancing the user experience with better error handling and state management.