This repository was archived by the owner on Apr 14, 2026. It is now read-only.
refactor(chat): extract SendMessage interactor from ChatPanel#264
Open
91jaeminjo wants to merge 3 commits intomainfrom
Open
refactor(chat): extract SendMessage interactor from ChatPanel#26491jaeminjo wants to merge 3 commits intomainfrom
91jaeminjo wants to merge 3 commits intomainfrom
Conversation
Separates orchestration logic (thread creation, document transfer, run initiation) from UI concerns (snackbars, navigation, setState) by introducing a framework-free SendMessage interactor class. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ThreadKey is defined in document_selection.dart and no consumer imports it through selected_documents_provider.dart. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move orchestration logic (send, retry, document selection, room-change listener) into a ChatController Notifier. ChatPanel becomes a thin UI shell that delegates to the controller and handles navigation/snackbars via SendResult pattern matching. Also removes the invalidateLastViewed(WidgetRef) factory in favor of inline lambdas at both call sites. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
ChatPanel._handleSend()into a framework-freeSendMessageinteractor classDocumentSelectionabstract class andStartRuntypedef for dependency injection_Result/Ok/Errsealed class hierarchy in favor of direct try/catchCloses #208
New files
lib/core/document_selection.dartDocumentSelectionabstract class +ThreadKeytypedeflib/features/chat/send_message.dartSendMessageinteractor +StartRuntypedef +SendMessageResultrecordlib/features/chat/send_message_provider.darttest/features/chat/send_message_test.dartModified files
lib/core/providers/selected_documents_provider.dartimplements DocumentSelection, re-exportsThreadKey, addsdocumentSelectionProviderlib/features/chat/chat_panel.dartsendMessageProvider, removes_withErrorHandling/ResulttypesTest plan
SendMessageunit tests passchat_panel_test.darttests pass unchangeddart format .— 0 changesflutter analyze --fatal-infos— 0 issues🤖 Generated with Claude Code