Skip to content

refactor: split chat store into focused stores and extract streaming service#6

Merged
voidcommit-afk merged 10 commits intomainfrom
dev
Mar 22, 2026
Merged

refactor: split chat store into focused stores and extract streaming service#6
voidcommit-afk merged 10 commits intomainfrom
dev

Conversation

@voidcommit-afk
Copy link
Owner

Summary

  • extract chatStoreUtils pure helpers/constants
  • split monolithic chat state into useMessageStore and useConversationStore
  • update useChatStore orchestration/proxy behavior to align with split stores
  • extract networking/SSE protocol logic into chatService
  • update chat store tests for split-store architecture
  • fix store-target consistency for selectedLevel updates
  • harden renameConversation with Supabase error checks and optimistic rollback
  • sync dev with latest main

Validation

  • npm run test -- --run src/stores/useChatStore.test.ts
  • npm run type-check

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 22, 2026

Deploying knowbear with  Cloudflare Pages  Cloudflare Pages

Latest commit: bed8077
Status: ✅  Deploy successful!
Preview URL: https://1edd91c6.knowbear.pages.dev
Branch Preview URL: https://dev.knowbear.pages.dev

View logs

Buffer Socratic stream output, apply existing question-cap/dedup constraints, and re-yield constrained chunks.
Add regression coverage for dedupe + max-3 questions + guidance line in streaming mode.
Reset streaming store tests via resetStore, ensure retry sends fresh request IDs, preserve assistant placeholder replacement, and map duplicate-in-progress errors to retry guidance text expected by tests.
@voidcommit-afk voidcommit-afk merged commit e734c96 into main Mar 22, 2026
5 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