Skip to content

Conversation

@pawelangelow
Copy link
Contributor

@pawelangelow pawelangelow commented Dec 17, 2025

What

Fixes React validateDOMNesting console warnings caused by invalid HTML nesting (e.g., <div> inside <p>, <p> inside <p>).

Changes

  • Text component nesting: Added component="div" or component="span" prop to Text components that wrap block-level elements, preventing invalid <p> nesting
  • VirtualTable: Fixed <div> inside <p> warning by adding component="div" to Text wrapper
  • BottomGroupMinimized: Fixed CLI/Profiler button labels by using component="span"
  • StreamEntryFields: Created InlineRow styled component with as: 'span' for inline flex layouts
  • Various stream views: Added proper component props to Text elements in GroupsViewWrapper, ConsumersViewWrapper, StreamDataViewWrapper
  • Other fixes: KeyRowName, KeyRowTTL, KeyRowSize, EditableInput, EditableTextArea, NoKeySelected, ListDetailsTable, DatabasesList, ExploreGuides, Notification, UploadWarning, RiToast

Not Fixed (Out of Scope)

The customColor prop warning on SVG elements comes from the external @redis-ui/icons_multicolor package. This would be handled in a separate PR.

There's one additional warning related to nested buttons inside RediSearchIndexesList. The @redis-ui Accordion component renders a button internally, and when we pass a button as a child, it creates invalid inside nesting. This requires refactoring on the @redis-ui side and will be addressed separately.

Testing

  1. Open the app and navigate through different pages (Browser, key details, stream views)
  2. Open browser console - no validateDOMNesting warnings should appear
  3. Verify all UI elements look and function the same as before

Closes N/A


[!NOTE]
Addresses widespread React validateDOMNesting warnings and tightens related UI/state handling.

  • Standardizes Text usage by setting component="div" or component="span" where wrapping block elements (RiToast, VirtualTable cells/placeholders, key-row Name/TTL/Size, stream views, editable inputs/areas, notifications, upload warning, success messages, bottom group labels)
  • VirtualTable: fixes <div>-in-<p> issue and simplifies empty-state rendering
  • KeyTree: opens parent nodes using functional state update and guards against empty parents; syncs open state to store
  • StreamEntryFields: adds InlineRow (as span) and adjusts inline helper/error text to prevent invalid nesting
  • ExploreGuides: centers headings/text; adds key to guide buttons
  • DatabasesList: updates selection cell to pass row explicitly for RowSelectionButton

Written by Cursor Bugbot for commit 2078473. This will update automatically on new commits. Configure here.

@pawelangelow pawelangelow force-pushed the fe/bugfix/fix-react-dom-warnings branch from 6a80c64 to 7a37365 Compare December 17, 2025 08:39
@pawelangelow pawelangelow marked this pull request as draft December 17, 2025 08:40
@pawelangelow pawelangelow force-pushed the fe/bugfix/fix-react-dom-warnings branch from 7a37365 to f234c03 Compare December 17, 2025 08:44
@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2025

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 82.86% 21105/25470
🟡 Branches 68.07% 8885/13053
🟡 Functions 78.04% 5783/7410
🟢 Lines 83.26% 20670/24827

Test suite run success

5487 tests passing in 704 suites.

Report generated by 🧪jest coverage report action from 2078473

@pawelangelow pawelangelow self-assigned this Dec 17, 2025
@pawelangelow pawelangelow marked this pull request as ready for review December 17, 2025 10:19
valkirilov
valkirilov previously approved these changes Dec 17, 2025
toastContent.message = (
<Text size="M" variant="semiBold">
<ColorText color={color}>{message}</ColorText>
<Text size="M" variant="semiBold" component="span">
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a big deal, but I would use div not span

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Valid! The toast message, however, has some wrapper already that is: <p> {everything is rendered here} </p>, so we endup with: <p><div>...</div></p> which triggers a warning.

Copy link
Contributor

Choose a reason for hiding this comment

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

There must be a simpler fix up the chain that is simpler than adding a prop to each Text component here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed a few of them, so WDT now?

valkirilov
valkirilov previously approved these changes Jan 6, 2026
@pawelangelow pawelangelow requested a review from pd-redis January 6, 2026 15:18
@pawelangelow pawelangelow marked this pull request as draft January 6, 2026 21:36
Add component prop to Text components to prevent invalid HTML nesting.
Text renders as <p> by default which cannot contain block elements.
Add key prop to mapped elements to prevent React warning.
Replace props spread with explicit row prop to prevent passing
invalid attributes to checkbox element.
@pawelangelow pawelangelow force-pushed the fe/bugfix/fix-react-dom-warnings branch from a053e9f to 5018da2 Compare January 7, 2026 09:50
@pawelangelow pawelangelow marked this pull request as ready for review January 7, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants