You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(forms): render the properties count tag as an inline element - #4417
Carbon's Tag renders a <div> by default. In PropertiesField and IndexedValuesField the count tag is part of the field title, which FieldWrapper renders inside the <label> and inside the toggletip <p>, so React warned about <div> inside <p>. The tag is now rendered with as="span". .cds--tag is inline-flex either way, so the layout doesn't change.
Added a test to PropertiesField.test.tsx and a new IndexedValuesField.test.tsx that check no <div> is rendered inside the label or the toggletip paragraph (both fail without the fix). Ran yarn workspace @kaoto/forms test src/fields, lint and typecheck.
I have added tests that prove my fix or feature works.
Summary by CodeRabbit
Bug Fixes
Property and indexed-value counts now appear inline beside their field labels, with consistent spacing. This keeps count indicators aligned with their titles instead of placing them in separate block elements.
Improved rendering consistency across both field types, so their labels and counts follow the same layout.
Review was skipped as selected files did not have any reviewable changes.
Files ignored due to path filters: 2
packages/ui/src/pages/Metadata/__snapshots__/MetadataPage.test.tsx.snap is excluded by !**/*.snap
packages/ui/src/pages/PipeErrorHandler/__snapshots__/PipeErrorHandlerPage.test.tsx.snap is excluded by !**/*.snap
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: eeeb6c74-99f6-4420-ad9a-548f8dcbf405
Commits
Reviewing files that changed from the base of the PR and between 7569d63 and d93a472.
Files ignored due to path filters: 2
packages/ui/src/pages/Metadata/__snapshots__/MetadataPage.test.tsx.snap is excluded by !**/*.snap
packages/ui/src/pages/PipeErrorHandler/__snapshots__/PipeErrorHandlerPage.test.tsx.snap is excluded by !**/*.snap
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.
Walkthrough
Both PropertiesField and IndexedValuesField now render their count tags as spans and add a separating space after the title. Tests cover the rendered titles, counts, and markup.
Changes: Inline count tags
Layer / File(s)
Summary
Field markup and tests packages/forms/src/fields/PropertiesField/*, packages/forms/src/fields/IndexedValuesField/*
Both field components render the count tag as a span with a separating space. Tests check the label content and verify that neither labels nor paragraphs contain a div.
The count tags now render as inline spans, which removes the invalid HTML nesting warning. No layout change is expected, and no merge-blocking risk remains.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title accurately describes the primary HTML-rendering fix in PropertiesField. It does not mention the equivalent IndexedValuesField change, but the title need not cover every detail.
Linked Issues check
Issue #4414 requires inline rendering for the count tags in PropertiesField and IndexedValuesField to prevent invalid <div> nesting. The diff sets Tag as="span" in both fields. The added tests…
Out of Scope Changes check
The pull request changes only the two fields named by issue #4414 and adds focused regression tests for both fields. The changes support the stated fix and do not show unrelated scope.
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Linked Issues check
Explanation
Issue #4414 requires inline rendering for the count tags in PropertiesField and IndexedValuesField to prevent invalid <div> nesting. The diff sets Tag as="span" in both fields. The added tests check that neither the label nor the toggletip paragraph contains a div. The count text and title remain unchanged.
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 4 files.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
A rabbit checks the fields with care, A count now wears a span to share. A little space divides the two, The tests confirm the markup too. Then off it hops through clover green.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: b015fd1f-9384-4196-82b1-e39a1dc9661c
Commits
Reviewing files that changed from the base of the PR and between 232110f and 131cad6.
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Hello! Thanks for working on this issue. Could you update the tests snapshots, please? To do so, just run the kaoto tests with the -u flag. Feel free to ping me once that's done to re-review it please. Apart from that, the rest looks good :)
@PVinaches Snapshots updated in 7569d63: the two ui page snapshots (MetadataPage, PipeErrorHandlerPage) now show the count tag as a <span>. Ready for another look.
Carbon's Tag renders a <div> by default, which ended up inside the
field <label> and the info toggletip <p>. Render it as a <span> in
PropertiesField and IndexedValuesField.
ClosesKaotoIO#4414
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
rebaseThis PR branch is out of date and needs a rebase.
2 participants
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.
Description
Carbon's
Tagrenders a<div>by default. InPropertiesFieldandIndexedValuesFieldthe count tag is part of the field title, whichFieldWrapperrenders inside the<label>and inside the toggletip<p>, so React warned about<div>inside<p>. The tag is now rendered withas="span"..cds--tagisinline-flexeither way, so the layout doesn't change.Fixes #4414
Type of Change
How Has This Been Tested?
Added a test to
PropertiesField.test.tsxand a newIndexedValuesField.test.tsxthat check no<div>is rendered inside the label or the toggletip paragraph (both fail without the fix). Ranyarn workspace @kaoto/forms test src/fields,lintandtypecheck.Checklist
Summary by CodeRabbit