refactor(characters): drive shared UI from active character
This commit is contained in:
@@ -4,7 +4,10 @@ import { createActor, fromCallback, waitFor } from "xstate";
|
||||
import type { UiMessage } from "@/stores/chat/ui-message";
|
||||
import type { ChatEvent } from "@/stores/chat/chat-events";
|
||||
import { chatMachine } from "@/stores/chat/chat-machine";
|
||||
import type { LoadMoreHistoryActorEvent } from "@/stores/chat/machine/actors/history";
|
||||
import type {
|
||||
ChatHistoryActorInput,
|
||||
LoadMoreHistoryActorEvent,
|
||||
} from "@/stores/chat/machine/actors/history";
|
||||
|
||||
import {
|
||||
createLoadHistoryCallback,
|
||||
@@ -50,7 +53,7 @@ describe("chat history flow", () => {
|
||||
actors: {
|
||||
loadHistory: fromCallback<
|
||||
ChatEvent,
|
||||
{ characterId: string }
|
||||
ChatHistoryActorInput
|
||||
>(({ sendBack }) => {
|
||||
sendBack({
|
||||
type: "ChatLocalHistoryLoaded",
|
||||
@@ -119,7 +122,7 @@ describe("chat history flow", () => {
|
||||
),
|
||||
loadMoreHistory: fromCallback<
|
||||
LoadMoreHistoryActorEvent,
|
||||
{ characterId: string }
|
||||
ChatHistoryActorInput
|
||||
>(
|
||||
({ receive, sendBack }) => {
|
||||
receive((event) => {
|
||||
@@ -198,7 +201,7 @@ describe("chat history flow", () => {
|
||||
}),
|
||||
loadMoreHistory: fromCallback<
|
||||
LoadMoreHistoryActorEvent,
|
||||
{ characterId: string }
|
||||
ChatHistoryActorInput
|
||||
>(
|
||||
({ receive, sendBack }) => {
|
||||
receive((event) => {
|
||||
@@ -260,7 +263,7 @@ describe("chat history flow", () => {
|
||||
}),
|
||||
loadMoreHistory: fromCallback<
|
||||
LoadMoreHistoryActorEvent,
|
||||
{ characterId: string }
|
||||
ChatHistoryActorInput
|
||||
>(
|
||||
({ receive }) => {
|
||||
receive(() => {
|
||||
|
||||
Reference in New Issue
Block a user