feat: improve mobile board experience

This commit is contained in:
ajnart committed 2026-08-14 11:32:09 +02:00
1 parent 6f4cd7522f
commit 46898cd0ea
28 files changed
+979 -258

No files matched your search

@@ -0,0 +1,44 @@
import { describe, expect, test } from "vitest";
import { resolveMobileItemPresentation } from "./mobile-presentation";
describe("resolveMobileItemPresentation", () => {
test("renders apps as eager compact tiles", () => {
expect(resolveMobileItemPresentation({ kind: "app", height: 8 }, undefined)).toMatchObject({
width: 1,
height: 1,
eager: true,
supportsDetails: false,
});
});
test("defaults widgets to full width and clamps desktop height", () => {
expect(resolveMobileItemPresentation({ kind: "calendar", height: 8 }, undefined)).toMatchObject({
width: 2,
height: 3,
eager: false,
supportsDetails: true,
});
});
test("prefers explicit presentation metadata", () => {
expect(
resolveMobileItemPresentation(
{ kind: "clock", height: 3 },
{
width: 1,
height: 1,
supportsCompactSummary: true,
supportsDetailView: false,
eager: true,
},
),
).toEqual({
width: 1,
height: 1,
displayMode: "mobileSummary",
supportsDetails: false,
eager: true,
});
});
});