Skip to content

refactor: extract coordinators from ChatView (1463 → 791 lines)#110

Open
ProfSynapse wants to merge 2 commits into
mainfrom
refactor/chatview-extract-coordinators
Open

refactor: extract coordinators from ChatView (1463 → 791 lines)#110
ProfSynapse wants to merge 2 commits into
mainfrom
refactor/chatview-extract-coordinators

Conversation

@ProfSynapse
Copy link
Copy Markdown
Owner

Summary

  • Extract 4 focused coordinators from the monolithic ChatView, reducing it from 1463 to 791 lines (46% reduction)
  • ChatSessionCoordinator (249 lines): Conversation loading, selection, welcome state
  • ChatSendCoordinator (361 lines): Message sending, context compaction, streaming lifecycle
  • ChatBranchViewCoordinator (305 lines): Branch navigation, header rendering, subagent display
  • ChatSubagentIntegration (229 lines): Subagent wiring, tool execution delegation
  • ChatView retains layout, lifecycle, and event binding as the thin orchestration layer

Test plan

  • TypeScript compiles cleanly
  • 9 new unit tests pass across all 4 coordinators
  • Manual: Verify chat conversation loading and switching
  • Manual: Verify message send + streaming works
  • Manual: Verify branch navigation (subagent flows)

🤖 Generated with Claude Code

ProfSynapse and others added 2 commits April 7, 2026 09:01
- Redesign migration to two-stage: first boot copies in background
  while using legacy paths; second boot cuts over to plugin-data
- Route cache.db path through storage plan so SQLite opens at the
  correct location per migration state
- Copy cache.db after sync/rebuild completes (not during migration)
  to avoid stale snapshot without sync state
- Add setDbPath() to SQLiteCacheManager for pre-init path updates
- Add init logging at all key milestones for startup debugging
- Add user-facing Notice for migration progress
- Await storage adapter ready before embedding init

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract four focused coordinators from the monolithic ChatView:
- ChatSessionCoordinator: conversation loading, selection, welcome state
- ChatSendCoordinator: message sending, compaction, streaming lifecycle
- ChatBranchViewCoordinator: branch navigation, header, subagent display
- ChatSubagentIntegration: subagent wiring, tool execution delegation

ChatView retains layout, lifecycle, and event binding. Each coordinator
has unit tests covering its core workflows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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