feat(frontend): build chronological activity timeline
This commit is contained in:
@@ -22,7 +22,7 @@ test("opens an EventSource and feeds NAMED events to the store", () => {
|
||||
expect(useSessionStore.getState().pendingWidget?.id).toBe("u1");
|
||||
});
|
||||
|
||||
test("feeds named activity_delta events to the model activity store", () => {
|
||||
test("feeds named activity_delta events to the thinking activity timeline", () => {
|
||||
renderHook(() => useSessionStream("s1"));
|
||||
const es = FakeEventSource.instances[0];
|
||||
|
||||
@@ -30,7 +30,30 @@ test("feeds named activity_delta events to the model activity store", () => {
|
||||
es.emitNamed("activity_delta", { type: "activity_delta", text: "Analizzo le ambiguità" })
|
||||
);
|
||||
|
||||
expect(useSessionStore.getState().activity.at(-1)?.text).toBe("Analizzo le ambiguità");
|
||||
expect(useSessionStore.getState().activityLog.at(-1)).toMatchObject({
|
||||
kind: "thinking",
|
||||
text: "Analizzo le ambiguità",
|
||||
});
|
||||
});
|
||||
|
||||
test("feeds named activity_event events to the tool activity timeline", () => {
|
||||
renderHook(() => useSessionStream("s1"));
|
||||
const es = FakeEventSource.instances[0];
|
||||
|
||||
act(() =>
|
||||
es.emitNamed("activity_event", {
|
||||
type: "activity_event",
|
||||
activity: { kind: "tool", toolCallId: "t1", toolName: "bash", status: "running" },
|
||||
})
|
||||
);
|
||||
|
||||
expect(useSessionStore.getState().activityLog).toContainEqual({
|
||||
kind: "tool",
|
||||
phase: null,
|
||||
text: "bash",
|
||||
toolCallId: "t1",
|
||||
status: "running",
|
||||
});
|
||||
});
|
||||
|
||||
test("also feeds UNNAMED (default message) events to the store", () => {
|
||||
|
||||
Reference in New Issue
Block a user