feat: add typing mode controls

This commit is contained in:
Peter Steinberger
2026-01-07 21:58:54 +00:00
parent 430662f6ef
commit bac1608933
14 changed files with 307 additions and 20 deletions

View File

@@ -52,6 +52,21 @@ describe("typing controller", () => {
expect(onReplyStart).toHaveBeenCalledTimes(3);
});
it("does not start typing after run completion", async () => {
vi.useFakeTimers();
const onReplyStart = vi.fn(async () => {});
const typing = createTypingController({
onReplyStart,
typingIntervalSeconds: 1,
typingTtlMs: 30_000,
});
typing.markRunComplete();
await typing.startTypingOnText("late text");
vi.advanceTimersByTime(2_000);
expect(onReplyStart).not.toHaveBeenCalled();
});
it("does not restart typing after it has stopped", async () => {
vi.useFakeTimers();
const onReplyStart = vi.fn(async () => {});