-
-
Notifications
You must be signed in to change notification settings - Fork 36
Fix Multi-day Ongoing #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Added regression coverage in tests/icalUtils.test.ts:84 ensuring multi-day events only repeat across their span when showOngoing is enabled, and stay isolated to the start day when it’s off. - Reworked shouldIncludeOngoing in src/icalUtils.ts:171 to compare normalized day boundaries, skip the already-added start day, include interior days, and include the end day only when the event actually continues into it. The new test regression now passes.
WalkthroughThe Changes
Sequence DiagramsequenceDiagram
participant Filter as Event Filter
participant shouldInclude as shouldIncludeOngoing()
participant Logic as Day Logic
Filter->>shouldInclude: dayToMatch, event
rect rgb(200, 220, 255)
Note over Logic: Day Normalization
shouldInclude->>Logic: normalize dayToMatch to start of day
end
rect rgb(220, 240, 220)
Note over Logic: Boundary Checks
Logic->>Logic: is dayToMatch >= event start day?
Logic->>Logic: is dayToMatch <= event end day?
end
rect rgb(255, 240, 200)
Note over Logic: Inclusion Rules
alt Between start and end
Logic->>Logic: Include day strictly between
else On end day
Logic->>Logic: Include if event continues past start
else On start day
Logic->>Logic: Exclude (guard: skip initial)
end
end
shouldInclude-->>Filter: boolean result
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes The changes modify core filtering logic with day-based boundary handling and introduce a guard condition that requires careful verification of edge cases (start day, end day, multi-day events). The new test adds confidence but the logic density and impact on event inclusion filtering warrant focused review. Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (2)src/icalUtils.ts (1)
tests/icalUtils.test.ts (1)
🔇 Additional comments (2)
Comment |
Summary by CodeRabbit