Repository navigation
fix(calendar): omit flexible dates after the window target is met - #686
Merged
Merged
Conversation
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the flexible calendar projection fix and its regression tests, including the existing web/mobile consumer's handling of scheduledDates and empty instances.
- Window-aware projection: Flexible dates use the canonical remaining-target check, while positive logged dates remain in the sorted schedule and unmet windows retain their due dates.
- Hierarchy consistency: Roots, children, and descendant visibility share the filtered projection, preserving parents needed to expose logged descendants without adding exhausted parent dates.
- Regression coverage: Exact-date assertions cover weekly/monthly targets at three hierarchy depths, skip-adjusted targets, next-window projection, and Sunday/Monday week starts. Local verification passed all 29 calendar-handler cases and 114 scheduling-service/property cases.
gpt-6.1-sol | 𝕏
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.




Flexible habits whose window target was met still projected every day in that window, so Calendario marked the remaining days missed. Filter projected dates through
IsFlexibleHabitDueOnDateand merge positive logged dates back into the existingscheduledDatesfield. A met weekly target logged Monday through Wednesday now returns those three dates only.The change lives in
src/Orbit.Application/Habits/Queries/GetCalendarMonthQuery.cs, with handler coverage intests/Orbit.Application.Tests/Queries/Habits/GetCalendarMonthQueryHandlerTests.cs. One helper applies the same rule to roots, children, and descendant visibility, preserving the exhausted parent kept for a logged child. Short windows retain due dates; DTO names and types remain unchanged. No external interface field was added or read by this change.Closes thomasluizon/orbit-tickets#903. Carry to
redesign/mainbelongs to thomasluizon/orbit-tickets#746.Test evidence
The continuation preserves the implementation at
8c29fe69. Saved logs from the preceding run establish the before/after observations:GetCalendarMonthQueryHandlerTests: 19 passed while the defect was present (/tmp/ticket-903-baseline.log). Existing coverage did not catch the met-window projection.Handle_FlexibleTargetMet_ReturnsOnlyLoggedDatesInWindowandHandle_FlexibleTargetMetWithSkip_OnlyProjectsNextWindow: 8 failures before the fix, 21 passing cases (/tmp/ticket-903-red.log). The weekly case expected only April 6 to 8 but received April 6 to 12. Monthly and nested cases also failed on extra projected dates./tmp/ticket-903-green.log), including the shortfall and exhausted-parent cases.Focused reproduction command:
dotnet test tests/Orbit.Application.Tests/Orbit.Application.Tests.csproj --filter FullyQualifiedName~GetCalendarMonthQueryHandlerTests. The saved focused logs contain the outcomes but not the original shell invocation, so its exact historical flags cannot be confirmed in this continuation.Full validation:
dotnet build Orbit.slnx: 0 errors, confirmed in/tmp/ticket-903-build.logfrom the preceding run.env -u LANG dotnet test: 7,065 passed, confirmed by the continuation and/tmp/ticket-903-test-no-lang.log.LC_ALL=en_US.UTF-8 dotnet test: run in this continuation, exit 0; 7,065 passed, 0 failed, 0 skipped./tmp/ticket-903-client-proof.log) reports a met target as 3 logged dates, 3 scheduled dates, 0 missed, and completion ratio 1. A one-log shortfall remains 1 logged date, 7 scheduled dates, 6 missed. The latest ticket decision limits required validation to the API; no client suites are required.Assumptions
Manual steps
None.