feat(chat): add local-first conversation workspace

This commit is contained in:
2026-08-13 15:55:15 +08:00
parent d1d50d722c
commit 8991f78f9f
43 changed files with 5450 additions and 592 deletions
+21
View File
@@ -0,0 +1,21 @@
import {describe, expect, test} from "bun:test";
import {
fullscreenEditorCharacterThreshold,
fullscreenEditorLineThreshold,
shouldOpenFullscreenEditor
} from "./fullscreen-editor.ts";
describe("fullscreen editor", () => {
test("keeps short messages in the compact composer", () => {
expect(shouldOpenFullscreenEditor("a".repeat(fullscreenEditorCharacterThreshold - 1))).toBe(false);
expect(shouldOpenFullscreenEditor(Array(fullscreenEditorLineThreshold - 1).fill("line").join("\n"))).toBe(false);
});
test("opens for a long single-line message", () => {
expect(shouldOpenFullscreenEditor("a".repeat(fullscreenEditorCharacterThreshold))).toBe(true);
});
test("opens for a message with many lines", () => {
expect(shouldOpenFullscreenEditor(Array(fullscreenEditorLineThreshold).fill("line").join("\n"))).toBe(true);
});
});