Skip to content

TPS-1482: KPI Comparison component - #434

Merged
miguelopezv merged 6 commits into
mainfrom
TPS-1482
Oct 1, 2026
Merged

miguelopezv merged 6 commits into
mainfrom
TPS-1482

Conversation

@miguelopezv

@miguelopezv miguelopezv commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Why is this pull-request needed?

here are some inconsistencies with the values of the KPI Comparison Component, also behaving the same way when the previous period has a null value and it has a 0 (intentional) value.

Main changes

Changes to the KPI Comparison component.

Test Evidence

Component before changes:

Screenshot 2026-09-25 at 12 32 59

Component after changes:

Screenshot 2026-09-25 at 15 15 04

Summary by CodeRabbit

  • Bug Fixes
    • KPI charts now handle missing values and comparisons without showing misleading change indicators.
    • A comparison value of zero is treated as a real value, not as missing data.
    • Percentage mode avoids displaying infinite or invalid percentages when the comparison is zero, and shows the formatted absolute difference instead.

@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 7e9ee05e-652d-4c9c-bc4a-5164fd2265e4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 2ab5dacb-b2e1-4363-8328-ca464cdd61ae

📥 Commits

Reviewing files that changed from the base of the PR and between 6fa9db0 and 7aa3c7f.

📒 Files selected for processing (6)
  • .changeset/kpi-null-comparison-fix.md
  • src/components/charts/kpis/KpiChart.test.tsx
  • src/components/charts/kpis/KpiChart.tsx
  • src/components/charts/kpis/KpiChart.types.ts
  • src/components/charts/kpis/components/KpiChartChange.test.tsx
  • src/components/charts/kpis/components/KpiChartChange.tsx

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

KPI charts now accept null values and distinguish null comparison values from numeric zero. Comparison sections are omitted when the main value is null. Percentage mode uses the formatted absolute difference when the comparison value is zero.

Changes

KPI comparison handling

Layer / File(s) Summary
Nullable KPI values
src/components/charts/kpis/KpiChart.types.ts, src/components/charts/kpis/KpiChart.tsx, src/components/charts/kpis/KpiChart.test.tsx
value and comparisonValue accept null. KpiChart does not render the comparison section when value is null. Tests cover nullable inputs and zero comparisons.
Comparison value handling
src/components/charts/kpis/components/KpiChartChange.tsx, src/components/charts/kpis/components/KpiChartChange.test.tsx, .changeset/kpi-null-comparison-fix.md
KpiChartChange shows the no-previous-data state for a null comparison. With a zero comparison, it uses the formatted absolute difference instead of percentage output. Tests and the changeset describe these cases.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Suggested reviewers: mad-raccoon

Merge Risk: ⚪ Minimal · up to 7aa3c

The nullable comparison behavior is consistent with the supplied tests and release note; no identified issue blocks merging after normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 5…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title identifies the KPI Comparison component and the related ticket. It is broad but clearly related to the changes.
Description check ✅ Passed The description includes the required Why, Main changes, and Test Evidence sections. The main changes section is brief, and the test evidence uses screenshots without listing automated test results, b…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

sonarqubecloud Bot commented Oct 1, 2026

Copy link
Copy Markdown

@miguelopezv
miguelopezv merged commit d66fcec into main Oct 1, 2026
4 checks passed
@miguelopezv
miguelopezv deleted the TPS-1482 branch October 1, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants