Skip to content

Commit 237ddcb

Browse files
authored
fix: incorrect header height calculation in estimated month height (#23923)
1 parent fbaeffd commit 237ddcb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

web/src/lib/managers/timeline-manager/internal/layout-support.svelte.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function updateGeometry(timelineManager: TimelineManager, month: MonthGro
1212
if (!month.isHeightActual) {
1313
const unwrappedWidth = (3 / 2) * month.assetsCount * timelineManager.rowHeight * (7 / 10);
1414
const rows = Math.ceil(unwrappedWidth / viewportWidth);
15-
const height = 51 + Math.max(1, rows) * timelineManager.rowHeight;
15+
const height = timelineManager.headerHeight + Math.max(1, rows) * timelineManager.rowHeight;
1616
month.height = height;
1717
}
1818
return;

web/src/lib/managers/timeline-manager/timeline-manager.svelte.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ describe('TimelineManager', () => {
8484
expect.arrayContaining([
8585
expect.objectContaining({ year: 2024, month: 3, height: 283 }),
8686
expect.objectContaining({ year: 2024, month: 2, height: 7711 }),
87-
expect.objectContaining({ year: 2024, month: 1, height: 286 }),
87+
expect.objectContaining({ year: 2024, month: 1, height: 283 }),
8888
]),
8989
);
9090
});
9191

9292
it('calculates timeline height', () => {
93-
expect(timelineManager.totalViewerHeight).toBe(8340);
93+
expect(timelineManager.totalViewerHeight).toBe(8337);
9494
});
9595
});
9696

0 commit comments

Comments
 (0)