Open
Conversation
|
@Maxime-J is attempting to deploy a commit to the Umami Software Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Greptile SummaryThis PR fixes a long-standing bug in the retention cohort report where visible day-columns were incorrectly capped by the number of cohort rows rather than the actual elapsed days from each cohort's start date to the report's end date. A cohort that started on the last day of a month could show impossible grey cells (e.g. Day 28 for an Aug 31 cohort), and cohort rows for websites with infrequent new visitors would be truncated early. Key changes
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[rows.map — iterate cohorts] --> B["maxDay = differenceInCalendarDays(endDate, cohortDate)"]
B --> C[days.map — iterate day columns]
C --> D{day > maxDay?}
D -- Yes --> E[return null — cell not rendered]
D -- No --> F["records.find(a => a.day === day)"]
F --> G{percentage found?}
G -- Yes --> H["Render Cell with 'X.XX%'"]
G -- No --> I[Render empty Cell]
Reviews (1): Last reviewed commit: "Fix incomplete retention report" | Re-trigger Greptile |
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.
Closes #3450.
As stated in issue, days shown per cohort are currently limited to the number of cohorts, which can skip values for websites without new visitors every day.
Moreover, grey squares are possibly shown in impossible positions, like in Day 1 of a cohort that started on the last day of the month.
Current docs example has an impossible square on Day 28 of Aug 4 cohort.
This PR fixes the incomplete issue and ensures
Cellon every possible position+ a slight code change:
find()instead offilter()[0]Note that a cohort starting the last day of the month will then appear thinner (you might want to update styling):
