issue/4213/fix/timelines-treat-0s-as-number#4407
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughReplaced numerous truthiness checks with explicit nil (null/undefined) checks in chart components, altering cursor/default-timestamp selection, line/point filtering, isClosed/resolution logic, and public data construction so falsy-but-valid values (e.g., 0, "") are treated as present data. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
closes #4213 fix group timelines treating 0s as null fix similar issue in resolution of 0 treatment
19945f2 to
0172b14
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
front_end/src/components/charts/group_chart.tsx (1)
709-712: Suggest adding regression tests for zero-valued forecasts.The fix is comprehensive, but there's no test coverage for the scenario that triggered the bug: a user or CP forecast value of exactly
0. Without at least one snapshot or unit test, a future refactor could silently reintroduce the truthiness check.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@front_end/src/components/charts/group_chart.tsx` around lines 709 - 712, Add a regression test that constructs a choiceItems/forecast scenario containing a forecast value of exactly 0 and verifies the component logic (e.g., the closeTimes mapping/filtering and latestTimestamp computation) treats 0 as a valid value rather than falsy; create a unit or snapshot test that renders the GroupChart (or the function that computes closeTimes/latestTimestamp) with a choiceItems entry whose closeTime or forecast is 0, assert the output includes that zero-valued forecast and that any derived timestamp/latestTimestamp is computed correctly, and commit the test so future refactors don’t reintroduce truthiness-based filtering of zero.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@front_end/src/components/charts/group_chart.tsx`:
- Around line 709-712: Add a regression test that constructs a
choiceItems/forecast scenario containing a forecast value of exactly 0 and
verifies the component logic (e.g., the closeTimes mapping/filtering and
latestTimestamp computation) treats 0 as a valid value rather than falsy; create
a unit or snapshot test that renders the GroupChart (or the function that
computes closeTimes/latestTimestamp) with a choiceItems entry whose closeTime or
forecast is 0, assert the output includes that zero-valued forecast and that any
derived timestamp/latestTimestamp is computed correctly, and commit the test so
future refactors don’t reintroduce truthiness-based filtering of zero.
Cleanup: Preview Environment RemovedThe preview environment for this PR has been destroyed.
Cleanup triggered by PR close at 2026-02-28T01:58:46Z |
closes #4213
fix group timelines treating 0s as null
Summary by CodeRabbit