fix: incorrect header height calculation in estimated month height (#23923)

This commit is contained in:
Min Idzelis 2025-11-17 15:14:06 -05:00 committed by GitHub
parent fbaeffd65c
commit 237ddcb648
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@ export function updateGeometry(timelineManager: TimelineManager, month: MonthGro
if (!month.isHeightActual) { if (!month.isHeightActual) {
const unwrappedWidth = (3 / 2) * month.assetsCount * timelineManager.rowHeight * (7 / 10); const unwrappedWidth = (3 / 2) * month.assetsCount * timelineManager.rowHeight * (7 / 10);
const rows = Math.ceil(unwrappedWidth / viewportWidth); const rows = Math.ceil(unwrappedWidth / viewportWidth);
const height = 51 + Math.max(1, rows) * timelineManager.rowHeight; const height = timelineManager.headerHeight + Math.max(1, rows) * timelineManager.rowHeight;
month.height = height; month.height = height;
} }
return; return;

View File

@ -84,13 +84,13 @@ describe('TimelineManager', () => {
expect.arrayContaining([ expect.arrayContaining([
expect.objectContaining({ year: 2024, month: 3, height: 283 }), expect.objectContaining({ year: 2024, month: 3, height: 283 }),
expect.objectContaining({ year: 2024, month: 2, height: 7711 }), expect.objectContaining({ year: 2024, month: 2, height: 7711 }),
expect.objectContaining({ year: 2024, month: 1, height: 286 }), expect.objectContaining({ year: 2024, month: 1, height: 283 }),
]), ]),
); );
}); });
it('calculates timeline height', () => { it('calculates timeline height', () => {
expect(timelineManager.totalViewerHeight).toBe(8340); expect(timelineManager.totalViewerHeight).toBe(8337);
}); });
}); });