Skip to content

Commit 2e0a21d

Browse files
Copilotsawka
andcommitted
feat: add widgets preview component
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
1 parent d8305b0 commit 2e0a21d

3 files changed

Lines changed: 521 additions & 245 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2026, Command Line Inc.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
import { assert, test } from "vitest";
5+
import { getWidgetsMode } from "./widgets";
6+
7+
test("getWidgetsMode returns normal when the measured content fits", () => {
8+
assert.equal(getWidgetsMode(240, 225, 6), "normal");
9+
});
10+
11+
test("getWidgetsMode returns compact when normal content overflows but compact height still fits", () => {
12+
assert.equal(getWidgetsMode(240, 260, 6), "compact");
13+
});
14+
15+
test("getWidgetsMode returns supercompact when even the compact layout would overflow", () => {
16+
assert.equal(getWidgetsMode(120, 260, 6), "supercompact");
17+
});

0 commit comments

Comments
 (0)