Restore reorder-maths test coverage (D-131 / 7.13)#131
Merged
Conversation
M7 of PR #130 deleted InlineReorderGeometryTests along with the SwiftUI editor it tested, leaving the UIKit editor's drag-to-reorder geometry with zero automated coverage (the M7 commit body flagged this). Extract the pure slot-index maths out of updateDrag into a testable static `BlockEditorViewController.reorderTarget(draggedCenterY:otherCenterYs:)` — behaviour-preserving, updateDrag now calls it — and add BlockEditorReorderGeometryTests exercising the real contract: drop-target index (top/middle/bottom), the strict-`<` boundary, clamping at both ends (clamps to `count`, not `count-1`), the no-op same-slot release, and the tall wrapped-row case (real centres, not a fixed row height) that is the whole reason the maths exists. Replaces InlineReorderGeometryTests (retired SwiftUI statics). App-target only (CatchlightTests, `#if canImport(Catchlight)`), matching the file it replaces. Refs D-131, PR #130. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Considus
added a commit
that referenced
this pull request
Jul 17, 2026
The label lane picks its word from `isSnoozed ? "SNOOZED" : "OVERDUE"`, but the rewritten timeline never wired snooze through: `TimelineReadCell` didn't pass isSnoozed and `UIKitTimeline` never received the snoozed set — so every snoozed overdue Take read "OVERDUE". Snooze isn't derivable from the Take (it lives in `vm.snoozedReminderIDs`), which is exactly why the rebuild dropped it — found while re-anchoring the Feature Register after the M7 merge. Thread `snoozedIDs` from DailiesView → UIKitTimeline → the cells, with its OWN reconfigure trigger: a snooze doesn't change the Take's value, so the value-diff that reconfigures cells couldn't see it (same shape as the month-filter restyle). Diff the set instead. Owner-verified on device: a snoozed Take now reads SNOOZED, and flips the moment it's snoozed without needing another edit to that Take. (The reorder-coverage + register-anchor work from the same local pass is already on main via PR #131 — its `reorderTarget` extraction and test file are byte-identical to what that PR landed, so nothing to add here.) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.
What & why
M7 of #130 ("Pillar 2: the UIKit timeline replaces the SwiftUI one") deleted
InlineReorderGeometryTestsalong with the SwiftUI editor those statics tested, and — as the M7 commit body itself noted — left the UIKit editor's drag-to-reorder geometry with zero automated coverage. Reorder is a live gesture (the in-editor checklist and the Shot List), so a regression would only surface on a device. This restores CI coverage (D-131 / WorkPlan 7.13).Change
updateDraginto a testable static,BlockEditorViewController.reorderTarget(draggedCenterY:otherCenterYs:).updateDragnow calls it — same inputs (real view-frame centres), same result. No behaviour change.BlockEditorReorderGeometryTests(app-targetCatchlightTests,#if canImport(Catchlight), matching the file it replaces) exercising the real contract:<boundary — resting exactly on a centre stays in the slot above it (no jitter).count(the contract returnscount, notcount-1— asserted as-is).prefix(while:)-not-filter().countcontract, pinned so nobody "simplifies" it and silently changes behaviour on unsorted input.Testing
CatchlightTestsunit suite green on the iOS Simulator (iPhone 16): Executed 582 tests, 1 skipped, 0 failures — including the 9 newBlockEditorReorderGeometryTests. No behaviour change to reorder; the extraction is a straight call-through.Refs D-131, #130.
🤖 Generated with Claude Code