Merged
Conversation
Contributor
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Contributor
There was a problem hiding this comment.
2 issues found across 8 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/twenty-front/src/modules/page-layout/widgets/graph/utils/sortTwoDimensionalChartPrimaryAxisDataByFieldOrManually.ts">
<violation number="1" location="packages/twenty-front/src/modules/page-layout/widgets/graph/utils/sortTwoDimensionalChartPrimaryAxisDataByFieldOrManually.ts:54">
P1: This change will break the existing unit test `should sort by FIELD_ASC` in `sortTwoDimensionalChartPrimaryAxisDataByFieldOrManually.test.ts`. The test expects data to be sorted but the function now returns it unchanged. Either update the test to expect unchanged data (since sorting is done elsewhere per the PR description), or verify the code change is correct.</violation>
</file>
<file name="packages/twenty-front/src/modules/page-layout/widgets/graph/utils/compareDimensionValues.ts">
<violation number="1" location="packages/twenty-front/src/modules/page-layout/widgets/graph/utils/compareDimensionValues.ts:10">
P1: The `parseDate` function can throw if the string is not a valid date format, but it claims to return `null` for invalid inputs. Since this is used in a comparison function for sorting, throwing here would crash the entire sort operation. Wrap the parsing in a try-catch to return `null` on failure.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
...ayout/widgets/graph/utils/sortTwoDimensionalChartPrimaryAxisDataByFieldOrManuallyIfNeeded.ts
Show resolved
Hide resolved
packages/twenty-front/src/modules/page-layout/widgets/graph/utils/compareDimensionValues.ts
Show resolved
Hide resolved
Contributor
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:59344 This environment will automatically shut down when the PR is closed or after 5 hours. |
ehconitin
reviewed
Jan 8, 2026
packages/twenty-front/src/modules/page-layout/widgets/graph/utils/compareDimensionValues.ts
Show resolved
Hide resolved
ehconitin
reviewed
Jan 8, 2026
...idgets/graph/utils/__tests__/sortTwoDimensionalChartPrimaryAxisDataByFieldOrManually.test.ts
Outdated
Show resolved
Hide resolved
ehconitin
reviewed
Jan 8, 2026
...ayout/widgets/graph/utils/sortTwoDimensionalChartPrimaryAxisDataByFieldOrManuallyIfNeeded.ts
Show resolved
Hide resolved
|
Hey @bosiraphael! After you've done the QA of your Pull Request, you can mark it as done here. Thank you! |
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.
I introduced a bug in the chart sorting in this PR: #16794
This PR fixes this.
The sorting on the first axis is already done by the group by for FIELD_ASC and FIELD_DESC. It is sorted also for the second axis but in each group.
For instance, if I create a graph that displays the amount of sales on each day of the week grouped by vendor
I can have for:
Monday: Vendor B, Vendor C
Tuesday: Vendor A, Vendor B
Wednesday: Vendor A, Vendor C
...
Inside each day the order of the vendor is correct, but by looking at only one day, I can't know the order of all the vendors.
That is why we always need to sort the second axis.