Skip to content

fix: render both label and value for DISPLAYTEXT feedback - #14

Merged
nnkogift merged 2 commits into
mainfrom
fix/feedback-display-dropped-value
Aug 2, 2026
Merged

nnkogift merged 2 commits into
mainfrom
fix/feedback-display-dropped-value

Conversation

@nnkogift

@nnkogift nnkogift commented Aug 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • RuleFeedbackList (playground) rendered only content for DISPLAYTEXT feedback, silently dropping the rule's computed data/value whenever a rule set both a static label and dynamic data.
  • The shared FormFeedback components (dhis2-ui, mantine, mui) had the mirror-image bug — rendering only value, dropping content. mui's was worst-hit: a value-less DISPLAYTEXT rule (the common case, just a static message) rendered a completely empty, invisible alert.
  • All four now render content alone when there's no dynamic value, or content: value when there is, matching the intended DISPLAYTEXT semantics already covered by utils/rules/src/evaluate.test.ts.

Test plan

  • pnpm exec vitest run utils/rules — 21/21 pass, unchanged (data contract untouched)
  • tsc --noEmit clean on dhis2-ui, mantine, mui, and apps/playground
  • prettier -c clean on all four changed files
  • Manual check in a running playground against a live DHIS2 instance with a DISPLAYTEXT rule that sets data — not verified in this environment (no reachable instance/credentials)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved feedback display consistency across the application.
    • Feedback items with an available value now show their content alongside that value.
    • Feedback items without a value now display only their content, preventing incorrect or unexpected fallback text.
    • Updated feedback presentation across supported interface components and the playground.

RuleFeedbackList (playground) and the shared FormFeedback components
each rendered only one half of a DISPLAYTEXT rule's feedback (content
or value, never both), so rules that combine a static label with
computed data silently dropped one side. The mui FormFeedback was
worst-hit, rendering a completely empty alert for value-less
DISPLAYTEXT rules.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@nnkogift, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 00a2c69f-5f1b-452d-8ca9-8d9e5c51a43a

📥 Commits

Reviewing files that changed from the base of the PR and between 75afcba and f07d9b3.

⛔ Files ignored due to path filters (1)
  • apps/playground/public/dhis2-app-icon.png is excluded by !**/*.png
📒 Files selected for processing (3)
  • apps/playground/d2.config.js
  • apps/playground/i18n/en.pot
  • apps/playground/package.json
📝 Walkthrough

Walkthrough

Feedback rendering now checks whether item.value is truthy. Valued items show content with the value. Other items show content only across the playground, DHIS2 UI, Mantine, and MUI components.

Changes

Feedback rendering

Layer / File(s) Summary
Value-based feedback rendering
apps/playground/src/components/rules/RuleFeedbackList.tsx, components/*/src/components/FormFeedback.tsx
The feedback components removed item.type checks. They now show the content and value when item.value is truthy, or the content alone otherwise.

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

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: rendering both the label and value for DISPLAYTEXT feedback.
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.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/feedback-display-dropped-value

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.

❤️ Share

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

cursor[bot]
cursor Bot approved these changes Aug 2, 2026 •

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Cursor Security Agent completed successfully with no findings requiring human review; Cursor Bugbot was not present on this PR. No reviewers assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@nnkogift
nnkogift merged commit 4c5e4ad into main Aug 2, 2026
13 checks passed
@nnkogift
nnkogift deleted the fix/feedback-display-dropped-value branch August 2, 2026 14:13
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.

1 participant