feat(tui): polish session tab animations (#39542)

This commit is contained in:
Kit Langton 2026-07-29 13:50:49 -04:00 committed by GitHub
commit b985d2eb8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 405 additions and 107 deletions

View file

@ -1,6 +1,11 @@
import { expect, test } from "bun:test"
import { RGBA } from "@opentui/core"
import { blendTabPulseColor, completionPulseOpacity, unreadGlowIntensity } from "../../src/component/tab-pulse"
import {
blendTabPulseColor,
completionPulseOpacity,
glowIgnitionLevel,
unreadGlowIntensity,
} from "../../src/component/tab-pulse"
import { tint } from "../../src/theme/color"
test("completion pulse rises quickly and fades over the remaining duration", () => {
@ -11,6 +16,13 @@ test("completion pulse rises quickly and fades over the remaining duration", ()
expect(completionPulseOpacity(1)).toBe(0)
})
test("glow ignition overshoots the resting level and settles back to it", () => {
expect(glowIgnitionLevel(0)).toBe(0)
expect(glowIgnitionLevel(0.3)).toBeCloseTo(1.5)
expect(glowIgnitionLevel(0.6)).toBeGreaterThan(1)
expect(glowIgnitionLevel(1)).toBe(1)
})
test("unread glow peaks behind the tab number and fades to the normal background", () => {
const intensities = Array.from({ length: 22 }, (_, index) => unreadGlowIntensity(index, 22))