Skip to content

Comments

feat: add headerRowColor, oddRowColor, evenRowColor style properties to TableWidgetV2#41551

Open
salevine wants to merge 6 commits intoreleasefrom
feat/tablerowcolor
Open

feat: add headerRowColor, oddRowColor, evenRowColor style properties to TableWidgetV2#41551
salevine wants to merge 6 commits intoreleasefrom
feat/tablerowcolor

Conversation

@salevine
Copy link
Contributor

@salevine salevine commented Feb 11, 2026

Add widget-level row color style properties that allow users to customize header, odd, and even row background colors via the Style tab color pickers. Colors are applied via CSS classes on the TableWrapper styled component, with correct priority below selected-row/hover/cell-level overrides.

Description

Alternate row colors on tables

Fixes #8923
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

/ok-to-test tags="@tag.All"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/22078556344
Commit: 5f7961b
Cypress dashboard.
Tags: @tag.All
Spec:


Mon, 16 Feb 2026 23:08:48 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

Release Notes

  • New Features

    • Table widgets now support custom row and header colors. Users can configure header row background, header text, odd row background, and even row background colors for enhanced visual customization.
  • Refactor

    • Optimized table row styling logic and removed unused code expressions.

…to TableWidgetV2

Add widget-level row color style properties that allow users to customize
header, odd, and even row background colors via the Style tab color pickers.
Colors are applied via CSS classes on the TableWrapper styled component,
with correct priority below selected-row/hover/cell-level overrides.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

Walkthrough

Adds optional color customization for table header and rows by introducing RowColorStyles (headerRowColor, headerTextColor, oddRowColor, evenRowColor) and propagating those props through types, widget config, components, and styled wrappers. Also cleans up an unused expression and refactors row className computation.

Changes

Cohort / File(s) Summary
Constants & Public Types
app/client/src/widgets/TableWidgetV2/constants.ts, app/client/src/widgets/TableWidgetV2/component/types.ts
Added exported RowColorStyles (four optional color props). Extended TableWidgetProps / TableProps to include row color props. Removed unused TableProviderProps.
Widget API & Config
app/client/src/widgets/TableWidgetV2/widget/index.tsx, app/client/src/widgets/TableWidgetV2/widget/propertyConfig/styleConfig.ts
Exposed new color props in widget rendering (evenRowColor, headerRowColor, headerTextColor, oddRowColor). Added four COLOR_PICKER entries to styleConfig for those props.
Component Surface & Memoization
app/client/src/widgets/TableWidgetV2/component/index.tsx
ReactTableComponentProps now extends RowColorStyles; forwards new props to Table and includes them in the React.memo comparison.
Rendering & Styling
app/client/src/widgets/TableWidgetV2/component/Table.tsx, app/client/src/widgets/TableWidgetV2/component/TableStyledWrappers.tsx, app/client/src/widgets/TableWidgetV2/component/TableBodyCoreComponents/Row.tsx
Removed a no-op expression, passed color props into TableWrapper, added odd/even CSS classes and header color/text hooks, and refactored row className using classNames with parity/selection/new-row flags.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🎨 Rows take turns in gentle shades and light,
Headers and text set just so, calm and bright.
Odd and even march in tidy array,
A smaller step to read long rows today.

🚥 Pre-merge checks | ✅ 4 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (20 files):

⚔️ Dockerfile (content)
⚔️ app/client/docker/templates/nginx-app.conf.template (content)
⚔️ app/client/jest.config.js (content)
⚔️ app/client/package.json (content)
⚔️ app/client/public/index.html (content)
⚔️ app/client/src/ce/configs/index.ts (content)
⚔️ app/client/src/ce/configs/types.ts (content)
⚔️ app/client/src/ce/constants/messages.ts (content)
⚔️ app/client/src/pages/Editor/HelpButton.tsx (content)
⚔️ app/client/src/pages/common/SearchBar/HomepageHeaderAction.tsx (content)
⚔️ app/client/src/widgets/TableWidgetV2/component/Table.tsx (content)
⚔️ app/client/src/widgets/TableWidgetV2/component/TableBodyCoreComponents/Row.tsx (content)
⚔️ app/client/src/widgets/TableWidgetV2/component/TableStyledWrappers.tsx (content)
⚔️ app/client/src/widgets/TableWidgetV2/component/index.tsx (content)
⚔️ app/client/src/widgets/TableWidgetV2/component/types.ts (content)
⚔️ app/client/src/widgets/TableWidgetV2/constants.ts (content)
⚔️ app/client/src/widgets/TableWidgetV2/widget/index.tsx (content)
⚔️ app/client/src/widgets/TableWidgetV2/widget/propertyConfig/styleConfig.ts (content)
⚔️ app/client/yarn.lock (content)
⚔️ scripts/deploy_preview.sh (content)

These conflicts must be resolved before merging into release.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main feature being added: new row color style properties (headerRowColor, oddRowColor, evenRowColor) to TableWidgetV2.
Linked Issues check ✅ Passed The PR successfully implements the feature requested in #8923: adding alternating row color support via new color properties (headerRowColor, oddRowColor, evenRowColor) accessible through Style tab color pickers.
Out of Scope Changes check ✅ Passed All changes align with the feature scope. The refactoring to use classnames library for row class construction is a supporting implementation detail, not out-of-scope.
Description check ✅ Passed PR description includes issue reference, automation tag, passing test results, and DevRel communication decision, but lacks detailed motivation, context, and dependencies.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/tablerowcolor
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch feat/tablerowcolor
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the Enhancement New feature or request label Feb 11, 2026
@salevine
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/21889061048.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 41551.
recreate: .

@github-actions
Copy link

Deploy-Preview-URL: https://ce-41551.dp.appsmith.com

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tomjose92
Copy link
Contributor

/build-deploy-preview skip-tests=true

@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/21904907756.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 41551.
recreate: .

@github-actions
Copy link

Deploy-Preview-URL: https://ce-41551.dp.appsmith.com

…s to TableWidgetV2

Expose rowIndex broadly at the row level and to JS Objects:
- Per-row background/text color via expressions (string or string[])
- hoveredRowIndex meta property with throttled hover handlers
- hoveredRow derived property for accessing hovered row data
- rowIndices derived property for accessing row indices from JS

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@salevine
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/21911371114.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 41551.
recreate: .

@github-actions
Copy link

Deploy-Preview-URL: https://ce-41551.dp.appsmith.com

…owIndices to TableWidgetV2"

This reverts commit c5d68d0.
@salevine
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/21913708102.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 41551.
recreate: .

@github-actions
Copy link

Deploy-Preview-URL: https://ce-41551.dp.appsmith.com

@salevine salevine marked this pull request as ready for review February 11, 2026 16:52
@salevine salevine requested a review from a team as a code owner February 11, 2026 16:52
@salevine salevine requested review from vivek-appsmith and removed request for a team February 11, 2026 16:52
@salevine salevine added the ok-to-test Required label for CI label Feb 11, 2026
@salevine salevine requested a review from ashit-rath February 11, 2026 16:55
@salevine salevine added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Feb 11, 2026
@ashit-rath ashit-rath changed the title feat: add headerRowColor, oddRowColor, evenRowColor style properties … feat: add headerRowColor, oddRowColor, evenRowColor style properties to TableWidgetV2 Feb 12, 2026
Comment on lines 80 to 88
const rowClassName = [
"tr",
props.row.index % 2 === 0 ? "odd-row" : "even-row",
isRowSelected && "selected-row",
props.className,
isAddRowInProgress && props.index === 0 && "new-row",
]
.filter(Boolean)
.join(" ");
Copy link
Contributor

Choose a reason for hiding this comment

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

Use classnames library

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok.. Did that

cachedTableData: Array<Record<string, unknown>>;
}

export interface TableProviderProps extends TableProps {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did we removed this? Is it not being used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This removal was intentional -- TableProviderProps in this file was a dead duplicate.

There are two definitions of TableProviderProps in the codebase:

  • types.ts (removed) -- only had children and currentPageIndex
  • TableContext.tsx (kept) -- has those same two fields plus 13 more (pageCount, pageOptions, isHeaderVisible, headerGroups, prepareRow, etc.)

The TableContext.tsx version is the one that's actually used everywhere. No file in the codebase ever imported TableProviderProps from types.ts -- the only import is from TableContext.tsx (in Actions.test.tsx).

Infinite scroll is not affected. The endOfData and cachedTableData properties live on TableProps, which was not changed here. They still flow through the full component chain:

widget/index.tsxcomponent/index.tsxTableProvideruseInfiniteScroll

So this just removes dead code -- no functionality is impacted.

@vivek-appsmith vivek-appsmith removed their request for review February 12, 2026 05:37
…ction

Replace manual array filter/join with the classnames library,
as suggested in code review.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🤖 Fix all issues with AI agents
Verify each finding against the current code and only fix it if needed.


In
`@app/client/src/widgets/TableWidgetV2/component/TableBodyCoreComponents/Row.tsx`:
- Around line 117-127: The cell className construction in the Row component uses
template literals; update it to use the shared classNames helper for consistency
by replacing the current conditional/template logic (references: Row component,
columns, cellIndex, StickyType.RIGHT) with a classNames call that applies "td"
and "hidden-cell" when columns[cellIndex].isHidden, and conditionally adds
"sticky-right-modifier" when the prior column is sticky RIGHT and hidden; keep
identical boolean conditions and class names but centralize via classNames for
consistency with the rest of the codebase.
🧹 Nitpick comments (1)
🤖 Fix all nitpicks with AI agents
Verify each finding against the current code and only fix it if needed.


In
`@app/client/src/widgets/TableWidgetV2/component/TableBodyCoreComponents/Row.tsx`:
- Around line 117-127: The cell className construction in the Row component uses
template literals; update it to use the shared classNames helper for consistency
by replacing the current conditional/template logic (references: Row component,
columns, cellIndex, StickyType.RIGHT) with a classNames call that applies "td"
and "hidden-cell" when columns[cellIndex].isHidden, and conditionally adds
"sticky-right-modifier" when the prior column is sticky RIGHT and hidden; keep
identical boolean conditions and class names but centralize via classNames for
consistency with the rest of the codebase.
app/client/src/widgets/TableWidgetV2/component/TableBodyCoreComponents/Row.tsx (1)

117-127: Optional: cell className could also use classNames for consistency.

The cell className construction here still uses template literals. Consider migrating to classNames for uniformity, but no rush — it's existing code.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/client/src/widgets/TableWidgetV2/component/TableBodyCoreComponents/Row.tsx`
around lines 117 - 127, The cell className construction in the Row component
uses template literals; update it to use the shared classNames helper for
consistency by replacing the current conditional/template logic (references: Row
component, columns, cellIndex, StickyType.RIGHT) with a classNames call that
applies "td" and "hidden-cell" when columns[cellIndex].isHidden, and
conditionally adds "sticky-right-modifier" when the prior column is sticky RIGHT
and hidden; keep identical boolean conditions and class names but centralize via
classNames for consistency with the rest of the codebase.

@github-actions
Copy link

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request ok-to-test Required label for CI Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants