Skip to content

Calendar: per-day event slices recomputed on every layout pass #160

Description

@jjalangtry

Deferred from PR #158 (CodeRabbit round one).

Week grid. hasAllDayEntries calls allDayEntries(on:) for all seven days,
allDayLane calls it again per day, and inside GeometryReader the grid runs
timed(on:) + TimelineLayout.place(...) per day. Each scans the whole
store.events array, and GeometryReader bodies re-evaluate on every geometry
change. With seven WeekTimelineView pages alive in the TabView that is ~14
full scans plus sorts per pass.

Month grid. events(on:)/tasks(on:) filter the whole array per cell —
O(cells x events) across ~42 cells, on the scroll path.

Invalidation. AnyHashable(events) / AnyHashable(tasks) rehash the full
arrays on every SwiftUI update; a revision token or counts would invalidate
without rehashing.

All three want the same shape of fix: a [Date: [...]] bucket built once
alongside the data dependency.

Deferred from the 0.9.3 promotion — these are refactors of the paths the feature
is built on, and riskier to change unreviewed than to leave.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions