fix(data-collection): disable row hover when no interactive elements#3550
Open
sergiocarracedo wants to merge 3 commits intomainfrom
Open
fix(data-collection): disable row hover when no interactive elements#3550sergiocarracedo wants to merge 3 commits intomainfrom
sergiocarracedo wants to merge 3 commits intomainfrom
Conversation
Rows that have no itemUrl, itemOnClick, or itemActions should not show a hover highlight, since there is nothing interactive to indicate.
Contributor
✅ No New Circular DependenciesNo new circular dependencies detected. Current count: 0 |
Contributor
📦 Alpha Package Version PublishedUse Use |
Contributor
🔍 Visual review for your branch is published 🔍Here are the links to: |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the OneDataCollection Table row styling so non-interactive rows don’t display a hover highlight, reducing misleading affordances in the Table visualization.
Changes:
- Introduces derived booleans (
showItemActions,localDisabledHover) to centralize row interactivity/hover decisions. - Updates
Rowstyling to conditionally disable hover vialocalDisabledHover. - Adds a dedicated
Rowunit test suite covering hover behavior permutations.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/react/src/experimental/OneDataCollection/visualizations/collection/Table/components/Row.tsx | Adds memoized guards for item actions visibility and hover disabling, and applies the derived hover flag to row classes. |
| packages/react/src/experimental/OneDataCollection/visualizations/collection/Table/components/tests/Row.test.tsx | Adds hover behavior unit tests for different combinations of row interactivity inputs. |
.../react/src/experimental/OneDataCollection/visualizations/collection/Table/components/Row.tsx
Outdated
Show resolved
Hide resolved
...rimental/OneDataCollection/visualizations/collection/Table/components/__tests__/Row.test.tsx
Show resolved
Hide resolved
Contributor
Coverage Report for packages/react
File Coverage
|
||||||||||||||||||||||||||||||||||||||
…ns/collection/Table/components/Row.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Rows in the Table visualization were always showing a hover highlight, even when the row had no interactive elements (no
itemUrl, noitemOnClick, and no item actions). This made non-interactive rows visually misleading.This PR introduces
localDisabledHover— a derived boolean that disables hover when none of the interactive triggers are present — andshowItemActionsto consolidate the item actions visibility check.Screenshots (if applicable)
N/A — behavioral change only.
[Link to Figma Design](Figma URL here)
Implementation details
useMemo-backedshowItemActions(replaces inlinehasItemActions && !loading && !nestedRowProps?.onLoadMoreChildrenguard)useMemo-backedlocalDisabledHover: istruewhendisableHoverprop is set, or when the row has noitemUrl,itemOnClick, and no item actionsclassNameto uselocalDisabledHoverinstead ofdisableHovershowItemActionsRow.test.tsxcovering all hover behaviour cases