Skip to content

fix(table): make hover state visible on striped rows - #1701

Open
AbdulNafay42 wants to merge 1 commit into
themesberg:mainfrom
AbdulNafay42:fix/table-striped-hover
Open

AbdulNafay42 wants to merge 1 commit into
themesberg:mainfrom
AbdulNafay42:fix/table-striped-hover

Conversation

@AbdulNafay42

@AbdulNafay42 AbdulNafay42 commented Nov 3, 2026 •

Copy link
Copy Markdown

Fixes #543

Summary
On a striped table with hoverable, the hover color was hover:bg-gray-50, which is the same color as the even striped rows (even:bg-gray-50). Hovering over those rows showed no visible change.

This changes the hovered row color to hover:bg-gray-100 (light mode). Dark mode stays dark:hover:bg-gray-600, which was already distinct from the striped colors. This follows the approach suggested in the issue discussion.

Changes

  • Table/theme.ts: hovered is now hover:bg-gray-100 dark:hover:bg-gray-600
  • Table.test.tsx: updated the hover test and added a test for striped plus hoverable rows
  • Added a changeset (patch)

Breaking changes
None. This is a color-only change in the default theme. Anyone using a custom hovered theme is not affected.

Summary by CodeRabbit

  • Bug Fixes
    • Hovering over rows in striped tables now displays a visible hover background without overriding the stripe pattern.

@vercel

vercel Bot commented Nov 3, 2026

Copy link
Copy Markdown

@AbdulNafay42 is attempting to deploy a commit to the Bergside Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6340da3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
flowbite-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The table row’s light-mode hover background changes from bg-gray-50 to bg-gray-100. Tests cover hoverable rows and the combination of striped and hoverable rows. The dark-mode hover class remains unchanged.

Changes: Table row hover styling

Layer / File(s) Summary
Update row hover styling
packages/ui/src/components/Table/theme.ts, packages/ui/src/components/Table/Table.test.tsx, .changeset/calm-rows-hover.md
The light-mode hover class changes to hover:bg-gray-100. Tests verify the class on hoverable rows, including striped rows, and retain the dark-mode expectation. A patch changeset records the update.

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

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: sutusebastian

Merge Risk: Minimal · up to 6340d

The change distinguishes hovered rows from striped backgrounds while leaving dark-mode hover styling unchanged. No actionable merge-blocking risk is identified.

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 clearly and concisely describes the main change: making the table hover state visible on striped rows.
Linked Issues check Passed Issue #543 (direct, open) reports that <Table striped={true} hoverable={true}> shows hover behavior but not striping. Code at the reviewed head shows that striping is emitted. TableRow applies `th…
Out of Scope Changes check Passed The whole-PR diff (merge base to head) changes three files. packages/ui/src/components/Table/theme.ts changes only the light-mode hover class of the default tableTheme.row.hovered. `packages/ui/sr…
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 #543 (direct, open) reports that &lt;Table striped={true} hoverable={true}&gt; shows hover behavior but not striping. Code at the reviewed head shows that striping is emitted. TableRow applies theme.striped (odd:bg-white even:bg-gray-50 odd:dark:bg-gray-800 even:dark:bg-gray-700) when the table context sets striped, and this is unchanged from the merge base. The collision is in tableTheme.row.hovered. At the merge base it was hover:bg-gray-50, the same color as even:bg-gray-50, so hovering an even row showed no change. At the head it is hover:bg-gray-100 dark:hover:bg-gray-600 in theme.ts, which differs from both stripe colors. The new test in Table.test.tsx checks that a striped and hoverable row keeps even:bg-gray-50, uses hover:bg-gray-100, and does not use hover:bg-gray-50. The issue body is brief, and the issue discussion referenced by the PR is not in the supplied evidence. The mapping from the reported symptom to the hover collision therefore rests on the PR description and the objectives summary.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff (merge base to head) changes three files. packages/ui/src/components/Table/theme.ts changes only the light-mode hover class of the default tableTheme.row.hovered. packages/ui/src/components/Table/Table.test.tsx updates the hover expectation and adds a striped and hoverable test that directly covers the reported interaction. .changeset/calm-rows-hover.md adds a patch changeset for the same fix. No file outside the Table component and its changeset is changed. No public API or prop signature changes. All changes connect to issue #543.

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 2 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/ui/src/components/Table/Table.test.tsx

Oops! Something went wrong! :(

ESLint: 8.57.0

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Failed to load plugin 'tailwindcss' declared in '--config': Package subpath './resolveConfig' is not defined by "exports" in /.eslint-tmp/node_modules/tailwindcss/package.json
Referenced from: /packages/ui/.eslintrc.cjs
at exportsNotFound (node:internal/modules/esm/resolve:315:10)
at packageExportsResolve (node:internal/modules/esm/resolve:663:9)
at resolveExports (node:internal/modules/cjs/loader:754:36)
at Module._findPath (node:internal/modules/cjs/loader:821:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1557:27)
at wrapResolveFilename (node:internal/modules/cjs/loader:1118:27)
at defaultResolveImplForCJSLoading (node:internal/modules/cjs/loader:1142:10)
at defaultResolve (node:internal/modules/cjs/loader:1199:20)
at nextStep (node:internal/modules/customization_hooks:189:26)
at resolve (file:///.eslint-tmp/.coderabbit-resolver.mjs:11:14)

packages/ui/src/components/Table/theme.ts

ESLint skipped: the matched ESLint configuration already failed (plugin-compatibility).

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 651e4818-2c55-406b-a246-8a2d9346eb92
Commits

Reviewing files that changed from the base of the PR and between 699cbcf and 6340da3.

Files selected for processing: 3
  • .changeset/calm-rows-hover.md
  • packages/ui/src/components/Table/Table.test.tsx
  • packages/ui/src/components/Table/theme.ts

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

This branch has not been deployed

No deployments
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.

Table striped={true} not working

1 participant