Skip to content

fix(forms): render the properties count tag as an inline element - #4417

Merged
PVinaches merged 2 commits into
KaotoIO:mainfrom
dodoshell:fix/issue-4414-tag-nesting-in-toggletip
Nov 12, 2026
Merged

PVinaches merged 2 commits into
KaotoIO:mainfrom
dodoshell:fix/issue-4414-tag-nesting-in-toggletip

Conversation

@dodoshell

@dodoshell dodoshell commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

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.

Fixes #4414

Type of Change

  • Bug fix
  • New feature
  • Improvement
  • Documentation update
  • Other (please describe)

How Has This Been Tested?

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.

Checklist

  • I have read the Contributing Guidelines.
  • I have followed the coding style and conventions of the project.
  • I have tested my changes and ensured that they work as expected.
  • I have updated any relevant documentation.
  • 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.

@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

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.

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

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: pvinaches

Merge Risk: Minimal · previous review 131ca

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: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 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 Passed 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 Passed 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 Passed 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 &lt;div&gt; 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.

Share

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.

Files selected for processing: 4

  • packages/forms/src/fields/IndexedValuesField/IndexedValuesField.test.tsx
  • packages/forms/src/fields/IndexedValuesField/IndexedValuesField.tsx
  • packages/forms/src/fields/PropertiesField/PropertiesField.test.tsx
  • packages/forms/src/fields/PropertiesField/PropertiesField.tsx

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@PVinaches PVinaches left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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 PVinaches added the rebase This PR branch is out of date and needs a rebase. label Nov 11, 2026
@dodoshell

Copy link
Copy Markdown
Contributor Author

@PVinaches Snapshots updated in 7569d63: the two ui page snapshots (MetadataPage, PipeErrorHandlerPage) now show the count tag as a <span>. Ready for another look.

@codecov

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.57%. Comparing base (e22df00) to head (d93a472).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4417      +/-   ##
==========================================
- Coverage   84.84%   84.57%   -0.28%     
==========================================
  Files         872      919      +47     
  Lines       35144    35667     +523     
  Branches     7440     7572     +132     
==========================================
+ Hits        29819    30166     +347     
- Misses       3637     3791     +154     
- Partials     1688     1710      +22     
Flag Coverage Δ
forms 85.15% <ø> (+0.32%) ⬆️
ui 87.09% <ø> (ø)
vscode 78.18% <ø> (ø)
web 65.58% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PVinaches PVinaches left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the updated code! I am approving and merging the changes.

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.

Closes KaotoIO#4414
@PVinaches
PVinaches force-pushed the fix/issue-4414-tag-nesting-in-toggletip branch from 7569d63 to d93a472 Compare November 12, 2026 07:42
@sonarqubecloud

Copy link
Copy Markdown

@PVinaches
PVinaches merged commit d1b421f into KaotoIO:main Nov 12, 2026
26 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rebase This PR branch is out of date and needs a rebase.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(forms): invalid HTML nesting (<div> inside <p>) in the FieldWrapper info toggletip for properties fields

2 participants