Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions webapp/src/lib/services/__tests__/transcriptBuffer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe("TranscriptBuffer", () => {
expect(text).toContain("world");
});

it("reports ready when buffer reaches 300 char threshold", () => {
it("reports ready when buffer reaches 100 char threshold", () => {
const shortResult = buffer.append("short");
expect(shortResult.ready).toBe(false);

Expand Down Expand Up @@ -58,7 +58,7 @@ describe("TranscriptBuffer", () => {

it("threshold getter returns MIN_CHARS_TO_PROCESS", () => {
expect(buffer.threshold).toBe(MIN_CHARS_TO_PROCESS);
expect(buffer.threshold).toBe(300);
expect(buffer.threshold).toBe(100);
});

it("tracks charsBuffered accurately across multiple appends", () => {
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/lib/services/transcriptBuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* are fully isolated.
*/

export const MIN_CHARS_TO_PROCESS = 300; // ~30 sec of speech
export const MIN_CHARS_TO_PROCESS = 100; // ~10 sec of speech
const CONTEXT_OVERLAP = 200; // keep last N chars on flush

export interface AppendResult {
Expand Down
8 changes: 4 additions & 4 deletions webapp/src/lib/stores/__tests__/arbitrageStore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe("arbitrageStore", () => {
streamedMarkets: [{ id: "m1" }] as never[],
latestAnalysis: { detected: true } as never,
isBuffering: true,
bufferProgress: { chars: 100, threshold: 300 },
bufferProgress: { chars: 100, threshold: 100 },
});

useArbitrageStore.getState().clearStreamedMarkets();
Expand All @@ -102,11 +102,11 @@ describe("arbitrageStore", () => {
});

it("setBuffering updates isBuffering and bufferProgress", () => {
useArbitrageStore.getState().setBuffering({ chars: 150, threshold: 300 });
useArbitrageStore.getState().setBuffering({ chars: 50, threshold: 100 });
expect(useArbitrageStore.getState().isBuffering).toBe(true);
expect(useArbitrageStore.getState().bufferProgress).toEqual({
chars: 150,
threshold: 300,
chars: 50,
threshold: 100,
});

useArbitrageStore.getState().setBuffering(null);
Expand Down