fix(documents): keep four tiles across a 1440 px window with the day strip docked

This commit is contained in:
Marc-André Bombeck committed 2026-10-09 20:21:10 +02:00
1 parent 3becc235ae
commit e6a2429df9
4 files changed
+16 -4

No files matched your search

@@ -62,6 +62,9 @@ describe("columnsForWidth", () => {
expect(columnsForWidth(1024 - 48)).toBe(3);
// 1440 viewport: the shell caps the container at 1280 minus its gutters.
expect(columnsForWidth(1280 - 48)).toBe(4);
// 1440 with the sidebar and the day strip docked: about 1 040 px left,
// still four tiles of about 240 px.
expect(columnsForWidth(1040)).toBe(4);
});
it("never asks for a fifth column", () => {
@@ -16,7 +16,7 @@ import { DocumentCard } from "./document-card";
/** Measured grid width → tiles per row. */
export function columnsForWidth(width: number): number {
if (width >= 1100) return 4;
if (width >= 1000) return 4;
if (width >= 760) return 3;
if (width >= 330) return 2;
return 1;