The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import { describe, expect, it } from "vite-plus/test"; |
| 2 | |
| 3 | import { |
| 4 | clampThreadSidebarWidth, |
| 5 | resolveInitialThreadSidebarWidth, |
| 6 | resolveThreadSidebarMaximumWidth, |
| 7 | resolveThreadSidebarMinimumWidth, |
| 8 | } from "./threadSidebarWidth"; |
| 9 | |
| 10 | function renderedWidth(sidebarWidth: number, viewportWidth: number): number { |
| 11 | const minimumWidth = resolveThreadSidebarMinimumWidth(0); |
| 12 | return clampThreadSidebarWidth( |
| 13 | sidebarWidth, |
| 14 | minimumWidth, |
| 15 | resolveThreadSidebarMaximumWidth(viewportWidth, minimumWidth), |
| 16 | ); |
| 17 | } |
| 18 | |
| 19 | describe("thread sidebar width", () => { |
| 20 | it("restores the stored width when the viewport widens after a narrow startup", () => { |
| 21 | const sidebarWidth = resolveInitialThreadSidebarWidth(350); |
| 22 | expect(renderedWidth(sidebarWidth, 840)).toBe(208); |
| 23 | expect(renderedWidth(sidebarWidth, 1638)).toBe(350); |
| 24 | }); |
| 25 | |
| 26 | it("restores the default width when the viewport widens after a narrow startup", () => { |
| 27 | const sidebarWidth = resolveInitialThreadSidebarWidth(null); |
| 28 | expect(renderedWidth(sidebarWidth, 840)).toBe(208); |
| 29 | expect(renderedWidth(sidebarWidth, 1638)).toBe(256); |
| 30 | }); |
| 31 | }); |