Repository navigation
Conversation
The API returns null for days that have not happened yet, but the chart turned every null into 0, so the current line dropped to zero from tomorrow until the end of the cycle. Pass the value through unchanged so the line ends at today.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Description
In a cycle that is still running, the burndown chart draws the "Current work items" line straight down to zero from tomorrow until the end of the cycle. A cycle with three open work items looks as if nothing will be left the next day.
The API already says these days are unknown:
burndown_plotreturnsnullfor every date after today. For the cycle in the recording, the response had 4 numbers (Nov 12 to 15, all3) and 11nullvalues.ProgressChartthen turned eachnullinto0withdistribution[key] ?? 0, so the chart plotted them as real zeros.This change passes the value through as it is. Recharts leaves a gap for
null, so the current line ends at today and the ideal line still runs to the end of the cycle. The chart data type is narrowed fromTChartData<string, string>toTChartData<"name", "current" | "ideal">because the wide form does not allownullin a series.ProgressChartis used in two places, the active cycle card on the Cycles page and the Progress section of the cycle side panel. Both are fixed by this one change.flowchart TD A[API sends null for days after today] --> B{ProgressChart builds the current series} B -->|Before| C[null becomes 0 and the line drops to zero] B -->|After| D[null is kept and the line ends at today]Type of Change
Screenshots and Media (if applicable)
Narrated recording, before then after (sound on):
evidence.mp4
The recording is the web app (
react-router dev) running locally against the dev API container, first onpreviewand then on this branch, with the same workspace and the same steps (Home, the project, Cycles).Test Scenarios
Steps to reproduce on
preview: create a cycle that started a few days ago and ends in the future, add work items to it, open the project's Cycles page and look at "Work item burndown".Edge cases and unchanged behaviour checked. All of these were checked in the running app on this branch and are in the recording:
Also checked in the running app but not in the recording: on a future day the tooltip lists only the ideal value, and the current series has 4 plotted points where the ideal series has 15.
Not covered:
apps/webhas no unit test runner, so there is no automated test for this. Cycles that use estimate points go through the same line of code but I did not set up estimates to try them. I could not set up a completed cycle with work items to compare, because work items cannot be added to a cycle that has already ended. Completed cycles have nonullvalues, so this change should not affect them.Checks run locally:
pnpm run check:typesinapps/web: passes. It failed with the one-line change alone (nullis not assignable toTChartData<string, string>), which is why the type is narrowed.oxfmt --checkandoxlinton the changed file: no errors, no warnings.pnpm checkacross the monorepo or the backend tests. The change is one frontend file.References
I did not find an existing issue or pull request for this. #9968 touches the same file for the tooltip precision of the ideal line and does not change this behaviour.
AI assistance (Claude Code) was used to find, fix and record this.
🤖 Generated with Claude Code
Summary by CodeRabbit