refactor(tui): organize source by feature boundaries (#5975)

* refactor(tui): group source files by feature

* refactor(tui): split app and gateway responsibilities
This commit is contained in:
chengyongru authored and GitHub committed 2026-09-29 16:57:36 +08:00
1 parent b7abbcd70b
commit f18423800e
73 files changed
+6401 -6006

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
import { expect, test } from "bun:test"
import { branchPoints } from "./branch-menu"
test("branch points preserve absolute user indices from paginated history", () => {
expect(branchPoints([
{ role: "user", content: "question" },
{ role: "assistant", content: " first\nreply ", forkIndex: 11 },
{ role: "activity", content: "read_file" },
{ role: "assistant", content: "second", forkIndex: 12 },
])).toEqual([
{ beforeUserIndex: 11, preview: "first reply" },
{ beforeUserIndex: 12, preview: "second" },
])
})