Skip to content

Chatgptsansjules#2

Merged
drewano merged 9 commits into
mainfrom
chatgptsansjules
May 23, 2025
Merged

Chatgptsansjules#2
drewano merged 9 commits into
mainfrom
chatgptsansjules

Conversation

@drewano
Copy link
Copy Markdown
Owner

@drewano drewano commented May 23, 2025

* denotes required fields

Priority*

  • High: This PR needs to be merged first, before other tasks.
  • Medium: This PR should be merged quickly to prevent conflicts due to common changes. (default)
  • Low: This PR does not affect other tasks, so it can be merged later.

Purpose of the PR*

Changes*

This pull request introduces several enhancements and bug fixes to the MessageHandler class, streaming services, and UI components in the Chrome extension. The key changes include adding sender information to specific message handlers, improving artifact generation and streaming logic, and refining UI interactions for better user experience.

Enhancements to Message Handling:

  • Updated handleAiChatRequest and handleRagChatRequest to include the sender parameter, enabling sender-specific logic. For example, it now checks if the sender is internal before fetching page content. (chrome-extension/src/background/handlers/message-handler.ts, [1] [2] [3] [4] [5] [6] [7]

Improvements to Streaming and Artifact Generation:

  • Introduced effectiveModelName for better model selection and consistency during streaming. (chrome-extension/src/background/handlers/message-handler.ts, [1] [2] [3] [4]
  • Enhanced error handling and fallback mechanisms for artifact and chat response generation in the AgentService. (chrome-extension/src/background/services/agent-service.ts, [1] [2]

UI Enhancements:

  • Added logic to save the current session before resetting the chat and artifact in the "New Canvas" button. This ensures users do not lose their work unintentionally. (pages/main/src/components/layout/MainLayout.tsx, [1] [2] [3]
  • Improved navigation item styling for better clarity and interaction feedback. (packages/ui/lib/components/DodaiSidebar.tsx, packages/ui/lib/components/DodaiSidebar.tsxL54-R56)

Structural and Data Model Updates:

  • Introduced new interfaces ChatArtifact and ChatArtifactWithHistory to represent artifacts and their history in the chat storage. (packages/storage/lib/impl/chat-history-storage.ts, [1] [2]

Streaming Service Updates:

How to check the feature

Reference

drewano and others added 9 commits May 20, 2025 18:43
- Introduced a toggle between 'canvas' and 'chat' view modes in CanvasView, allowing users to switch seamlessly.
- Updated ChatPanel to accept view mode as a prop, enabling dynamic rendering based on the selected mode.
- Enhanced message handling in message-handler.ts to utilize effective model names consistently across streaming events.
- Added optional properties to the Message interface for better flexibility in handling chat messages.
… awareness

- Updated AI and RAG chat request handlers to accept the sender parameter, allowing for better context management.
- Added logic to conditionally fetch page content based on whether the request is internal or external, improving efficiency.
- Enhanced logging to provide clearer insights into request origins and handling processes.
- Introduced a new streaming request type in StreamingService for better handling of simple text chat streams.
- Removed unnecessary overflow-hidden class from the header in CanvasView for better visual consistency.
- Updated ChatPanel to conditionally render message content based on activeViewMode, improving user experience and interaction flow.
- Streamlined the rendering logic for initial hub view and message display, enhancing clarity in the component structure.
…consistency

- Changed background color from 'bg-slate-850' to 'bg-slate-800' in the dropdown menu of DodaiModelSelector to enhance visual coherence with the overall theme.
…management

- Updated MainLayout to include enhanced logic for creating new canvas sessions, including saving current chat sessions and managing conversation history.
- Integrated new conversation handling in CanvasView, allowing users to load, delete, and rename conversations with improved state management.
- Added a toggle for the chat history panel in CanvasView, enhancing user interaction and accessibility to past conversations.
- Refactored the resetChatAndArtifact function to support a callback for pre-reset actions, improving flexibility in chat management.
- Updated ChatPanel to support toggling the history panel, streamlining user experience in chat interactions.
…ression in config

- Modified ChatPanel to conditionally render based on the onToggleHistory prop, improving user interaction.
- Enabled compression in repomix.config.json for optimized configuration settings.
…or enhanced chat management

- Added new interfaces for ChatArtifact and ChatArtifactWithHistory to structure chat artifacts and their history.
- Updated CanvasView to handle currentArtifact more effectively during conversation loading and saving.
- Enhanced useDodaiCanvasHistory hook to manage artifact conversion between storage and canvas formats, improving data handling.
- Disabled compression in repomix.config.json for better compatibility.
- Added STREAM_START message handling in agent-service.ts to notify UI when streaming begins.
- Improved chat response generation logic to provide clearer user feedback based on artifact generation success or failure.
- Updated streaming-service.ts to include a new simple chat stream type for better message handling.
- Refactored MainLayout.tsx to streamline chat session saving and removed unused conversation creation logic.
- Adjusted CanvasView.tsx to determine panel visibility based on artifact mode and streaming state.
- Removed deprecated TextChatView component and its associated hook for a cleaner codebase.
- Updated MainLayout to save current chat sessions with the current artifact and reset active sessions appropriately.
- Improved CanvasView to handle new conversation creation and reset chat state, enhancing user experience.
- Added a new button in DodaiCanvasHistoryPanel for initiating new conversations, improving accessibility.
- Enhanced useDodaiCanvasHistory to support saving sessions as new and resetting active sessions, streamlining chat management.
- Added logging for better debugging and tracking of chat session states and actions.
@drewano drewano merged commit c61ff02 into main May 23, 2025
3 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant