refactor(tui): modernize active status animation

This commit is contained in:
Xubin Ren
2026-08-17 20:56:10 +08:00
parent 5415e68014
commit 6eba62606c
2 changed files with 60 additions and 6 deletions
+17 -2
View File
@@ -1030,8 +1030,22 @@ describe("NanobotTui layout", () => {
await setup.renderOnce()
let frame = setup.captureCharFrame()
expect(frame).toMatch(/[] Thinking\s+0s/u)
expect(frame).toMatch(/Thinking\s+0s/u)
expect(frame).not.toMatch(/[]/u)
expect(frame).not.toContain("hidden reasoning")
const status = (app as unknown as {
status: {
content: { chunks: Array<{ fg?: { toInts(): number[] } }> }
plainText: string
}
}).status
expect(status.plainText).toMatch(/^Thinking\s+0s/u)
const shimmerColors = new Set(
status.content.chunks
.slice(0, "Thinking".length)
.map((chunk) => chunk.fg?.toInts().join(",")),
)
expect(shimmerColors.size).toBeGreaterThan(1)
app.accept({
event: "message",
@@ -1044,7 +1058,8 @@ describe("NanobotTui layout", () => {
await setup.renderOnce()
frame = setup.captureCharFrame()
expect(frame).toMatch(/[] Working\s+0s/u)
expect(frame).toMatch(/Working\s+0s/u)
expect(frame).not.toMatch(/[]/u)
expect(frame).toContain(" exec")
app.accept({ event: "turn_end", chat_id: "chat" })
})