Repository navigation
Fix layout edge cases and load less work - #10
Merged
Merged
Conversation
Layout: - HourFit no longer clips a short event late in the evening: after shrinking the hours to fit it, it only shows earlier hours as far as every event still fits, and shows the whole day when nothing else works. Degenerate inputs (an empty or infinite range) stay finite. - Event extents are never negative, and a day shows at most one column per 12 points, so heavy overlap does not produce invalid frames. - The all-day and timed split leaves room for the day titles, so in a short calendar the all-day row no longer pushes content off the bottom. - Reversing direction between weeks slides both weeks the same way: the direction is committed before the week changes. Performance: - Bursts of calendar change notifications reload once, after 0.3 s. - Events are loaded for the visible week and today only, not every week in between. - The week is arranged once per update instead of inside the geometry reader. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the layout-maths and performance findings from the code review. Each BlotterKit fix comes with a regression test.
Layout
HourFitclipped late events. It shrank the hour height so a late event would fit, then moved the start earlier to fill the space below midnight, which pushed that event off the bottom. Reproduced: a 15-minute event at 23:30–23:54 in a 528pt grid overflowed by 2–17pt. The start now moves only as far as every event still fits, and the rest stays empty below midnight. When no hour height can fit the events, the whole day is shown. Degenerate inputs (a24...24working range, infinite height) now give finite results. Tests cover 23:30, 23:36, 23:45 and 23:54, and the degenerate cases.horizontalExtentreturned negative widths when the gaps were wider than the column, at width 0 during transitions or with many overlapping events. It now clamps.DayColumnpassesmaximumColumns(one per 12pt), so heavy overlap shares columns instead of producing 0–1pt slivers. A test sweeps small widths and column counts.PaneLayoutsplit the full height between all-day and timed events, but the week view also reserves 32pt for day titles. In a short calendar the all-day row took everything, and its "+N more" line was clipped. The split now subtracts the title height. Tested.CalendarState.navigate(to:)now commits the direction first. When the direction flips, the week changes on the next run loop pass.Performance
EKEventStoreChangednow debounces for 0.3s before the full reload. iCloud and CalDAV syncs post bursts of these notifications.Schedule.arrangeruns once per update instead of inside theGeometryReader.🤖 Generated with Claude Code