Skip to content

Merge the four review fixes that conflicted with main - #153

Merged
mmick66 merged 8 commits into
mainfrom
review-leftovers
Sep 30, 2026
Merged

mmick66 merged 8 commits into
mainfrom
review-leftovers

Conversation

@mmick66

@mmick66 mmick66 commented Sep 30, 2026

Copy link
Copy Markdown
Owner

The last four fixes from the September 2026 review. Orchestra finished them (their beads are closed) but could not merge them because main had moved on; each is merged here in turn with its conflicts resolved, and the tests run after each.

Fixes

  • win.1 Animated scrolls that do not move report their month. setDisplayDate(_:animated: true) never called didScrollToMonth before the first layout or for the month already on screen, since UIKit sends no end-of-animation callback when the offset stays put. SwiftUI's onScrollToMonth missed the first month this way.
  • win.8 Border colours resolve against the cell's own traits. A dynamic cellBorderColor or cellSelectedBorderColor was resolved against whatever trait collection was current during cellForItemAt. This complements win.10 (already on main), which widened when borders are reapplied; win.8 fixes what they resolve against.
  • win.3 The layout computes its content size and visible cells from the page grid. At sizes that are not a whole number of cells (a width of 258⅓ points, say) the flow layout wrapped six days to a row, the content stopped being a whole number of pages and days on screen went blank.
  • rlq.3 Right to left is mirrored in the layout, not with transforms. The collection view and every cell were scaled by -1; the layout now mirrors the week's columns and, for a horizontal calendar, the month pages, and the collection view's semanticContentAttribute follows forceLtr.

Conflict resolution worth reviewing

  • rlq.3 was ported rather than merged. It changed the old CalendarFlowLayout, which win.3 replaced. Its mirroring (flipsHorizontallyInOppositeLayoutDirection off, mirrored columns, mirroredPage) now lives in win.3's grid attributes and rect query; page offsets are measured by bounds, as win.3 does.
  • win.8 was applied to the restructured cell. rlq.7 moved the cell to a single DayCellConfiguration, so the fix is one line in applyStyle, and its test sets the style through a configuration. The test was confirmed to fail without the fix.
  • Changelog entries and tests from both sides were kept everywhere.

Checks

swift-format lint --strict, 140 tests in 7 suites, docbuild for both schemes and the example app build all pass on this head.

With this merged, every child of the bl0 and win review epics is on main. rlq.5 (public API tidy-up for 3.0) stays deferred.

🤖 Generated with Claude Code

Michael Michailidis and others added 8 commits September 30, 2026 16:26
setDisplayDate(_:animated: true) waited for scrollViewDidEndScrollingAnimation,
which UIKit does not send when the content offset does not change: before the
first layout (0 to 0) or for the month already on screen. The delegate never
heard about the month and animationTargetMonth stayed set. SwiftUI hit this
when an animated update set the display date before layout.

Such scrolls now take the non-animated path and notify at once.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…id (CalendarView-win.3)

CalendarFlowLayout moved each day into its 7x6 page but kept the flow
layout's content size and its choice of cells in a rect. At widths where
the flow wraps six days to a row (258 1/3 points, say) the content was not
a whole number of pages and days on screen were culled. The layout now
derives both from the page grid, invalidates on any size change, falls
back to horizontal for unknown directions and measures pages by bounds.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
CalendarDayCell set layer.borderColor with UIColor.cgColor, which resolves
a dynamic colour against UITraitCollection.current. applyStyle runs from
property observers during cellForItemAt, where that need not be the cell's
trait collection, so a dynamic cellBorderColor or cellSelectedBorderColor
could show the wrong appearance. Resolve them with the cell's own
traitCollection.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…darView-rlq.3)

Right to left, the view scaled its collection view by -1 and every cell by
-1 again, tracked by _isRtl. The collection view's semanticContentAttribute
now follows forceLtr and CalendarFlowLayout mirrors the day columns and, for a
horizontal calendar, the month pages. Paging maps sections to pages through
the layout. UIKit's flipsHorizontallyInOppositeLayoutDirection does not
mirror these hand-built frames, so the layout returns false for it and
answers rect queries from its own frames.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Resolved against main: kept both changelog entries and both sets of
scrolling tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…raits

Resolved against main, where win.10 widened the trait registration and
rlq.7 moved the cell to a single configuration: kept win.10's
registration, resolved the configuration's border colour against the
cell's trait collection, and set the test's style through a
DayCellConfiguration. The test fails without the fix.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… from the page grid

Resolved against main: kept both changelog entries.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…not with transforms

Ported onto win.3's page-grid layout, which replaced the code rlq.3
changed: the mirroring (flipsHorizontallyInOppositeLayoutDirection off,
mirrored columns, mirroredPage for a horizontal calendar) now lives in
the grid's own attributes and rect query, page offsets are measured by
bounds, and cellForItemAt no longer sets a transform. The collection
view and header are non-optional since rlq.6.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@mmick66
mmick66 merged commit 2c1b4a3 into main Sep 30, 2026
2 checks passed
@mmick66
mmick66 deleted the review-leftovers branch September 30, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant