Skip to content

fix(core/aggrid): updated row zebra pattern - #2638

Closed
GayatriK2002 wants to merge 6 commits into
siemens:mainfrom
GayatriK2002:fix-4248/aggrid-zebra-example
Closed

fix(core/aggrid): updated row zebra pattern #2638
GayatriK2002 wants to merge 6 commits into
siemens:mainfrom
GayatriK2002:fix-4248/aggrid-zebra-example

Conversation

@GayatriK2002

@GayatriK2002 GayatriK2002 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

💡 What is the current behavior?

  • AG Grid zebra rows used incorrect base colors and the row-hover tint collapsed odd/even rows to the same color, breaking the striping on hover.

GitHub Issue Number: #
Jira Issue Number: 4248

🆕 What is the new behavior?

  • Zebra rows use the correct --theme-color-1/--theme-color-2 base colors, and hovering applies the IX hover tint as an overlay that preserves each row's distinct zebra color.

🏁 Checklist

A pull request can only be merged if all of these conditions are met (where applicable):

  • 🦮 Accessibility (a11y) features were implemented
  • 🗺️ Internationalization (i18n) - no hard coded strings
  • 📲 Responsiveness - components handle viewport changes and content overflow gracefully
  • 📕 Add or update a Storybook story
  • 📄 Documentation was reviewed/updated siemens/ix-docs
  • 🧪 Unit tests were added/updated and pass (pnpm test)
  • 📸 Visual regression tests were added/updated and pass (Guide)
  • 🧐 Static code analysis passes (pnpm lint)
  • 🏗️ Successful compilation (pnpm build, changes pushed)

👨‍💻 Help & support

Summary by CodeRabbit

  • New Features

    • Added AG Grid row-state styling, including a themed hover effect for rows.
    • Added an interactive AG Grid example showcasing selection checkboxes, tooltips, draggable rows, autosizing, and focus behavior.
  • Style

    • Updated AG Grid theme colors for backgrounds and alternating rows.
    • Standardized alternating-row styling for consistent visual results.

@netlify

netlify Bot commented Jul 2, 2026

Copy link
Copy Markdown

Deploy Preview for ix-storybook ready!

Name Link
🔨 Latest commit 9ebdeb7
🔍 Latest deploy log https://app.netlify.com/projects/ix-storybook/deploys/6a4dd8943b2de00008b10995
😎 Deploy Preview https://deploy-preview-2638--ix-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot

changeset-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9ebdeb7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates AG Grid theme color parameters, adds hover row-state styling to the IX theme, and introduces a Storybook AG Grid example with community modules, sample data, themed rendering, selection, tooltips, autosizing, and draggable rows.

Changes

AG Grid theme and Storybook example

Layer / File(s) Summary
AG Grid theme parameters
packages/aggrid/src/aggrid-ix-theme-params.ts
Updates the background and odd-row color variables and removes the incorrectly cased duplicate odd-row property.
Row-state theme styling
packages/aggrid/src/row-state.style.css, packages/aggrid/src/index.ts
Adds hover gradient styling for AG Grid cells and registers it as a custom part of the IX theme.
Storybook AG Grid example
packages/storybook-docs/package.json, packages/storybook-docs/src/stories/aggrid.stories.ts
Adds AG Grid dependencies and a configured Storybook story with sample data, themed rendering, selection, tooltips, autosizing, and draggable rows.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Storybook
  participant renderGrid
  participant createIxTheme
  participant createGrid
  Storybook->>renderGrid: render Default story
  renderGrid->>createIxTheme: create IX theme
  renderGrid->>createGrid: pass grid options, row data, and theme
  createGrid-->>Storybook: render configured AG Grid
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: AG Grid zebra-row styling updates in core/aggrid.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@GayatriK2002 GayatriK2002 changed the title updated row zebra pattern and added hover css fix(core/aggrid): updated row zebra pattern Jul 2, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates AG Grid theme parameters and introduces a new row-state stylesheet to paint the row-hover tint directly on cells, resolving zebra background inconsistencies. Feedback suggests using an inset box-shadow instead of background-image to avoid overriding custom cell background images, and setting AG Grid's built-in rowHoverColor to transparent to prevent double-hover tinting.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +17 to +22
.ag-row.ag-row-hover .ag-cell {
background-image: linear-gradient(
var(--theme-color-ghost--hover),
var(--theme-color-ghost--hover)
) !important;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Using background-image: linear-gradient(...) !important to apply the hover overlay will completely override any custom background-image (such as icons, custom gradients, or patterns) that might be set on cells by custom cell renderers or other styles.

To avoid overriding cell background images while still achieving the desired overlay effect, you can use an inset box-shadow instead. An inset box-shadow overlays on top of both background-color and background-image without replacing them.

Additionally, since we are manually painting the hover overlay on the cell, please ensure that AG Grid's built-in rowHoverColor parameter in aggrid-ix-theme-params.ts is set to transparent (or rgba(0, 0, 0, 0)) to prevent AG Grid from rendering its own hover overlay simultaneously, which would result in double-hover tinting.

.ag-row.ag-row-hover .ag-cell {
  box-shadow: inset 0 0 0 9999px var(--theme-color-ghost--hover) !important;
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

rowHoverColor is intentionally retained; it and the cell tint layer together to produce consistent hover across zebra rows. Removing it regresses odd/even consistency.
The box-shadow: inset approach produces per-cell border seams, so it's not suitable here.

@flxlst09 flxlst09 added this to the 5.2.0 milestone Jul 3, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

@GayatriK2002
GayatriK2002 marked this pull request as ready for review July 13, 2026 04:55

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/aggrid/src/aggrid-ix-theme-params.ts (2)

11-28: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Add a changeset for this aggrid theming change. This is user-facing styling, so it needs a scoped .changeset entry.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/aggrid/src/aggrid-ix-theme-params.ts` around lines 11 - 28, Add a
scoped changeset entry for the aggrid package describing the user-facing
theming/styling change shown in the aggrid theme parameters. Use the
repository’s standard changeset format and an appropriate patch-level bump.

Sources: Coding guidelines, Path instructions


21-21: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Set rowHoverColor to transparent The hover tint is already applied in row-state.style.css, so leaving rowHoverColor on var(--theme-color-ghost--hover) double-tints hovered striped rows and can wash out the odd/even backgrounds.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/aggrid/src/aggrid-ix-theme-params.ts` at line 21, Update the
rowHoverColor setting in the theme parameters to use transparent instead of the
theme ghost hover variable, leaving hover tinting to row-state.style.css and
preserving the striped row backgrounds.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/storybook-docs/src/stories/aggrid.stories.ts`:
- Around line 38-49: Update renderGrid to retain the GridApi returned by
createGrid and destroy the previously stored grid instance before creating a
replacement. Ensure cleanup occurs on each re-render while preserving the
existing container setup and grid options.

---

Outside diff comments:
In `@packages/aggrid/src/aggrid-ix-theme-params.ts`:
- Around line 11-28: Add a scoped changeset entry for the aggrid package
describing the user-facing theming/styling change shown in the aggrid theme
parameters. Use the repository’s standard changeset format and an appropriate
patch-level bump.
- Line 21: Update the rowHoverColor setting in the theme parameters to use
transparent instead of the theme ghost hover variable, leaving hover tinting to
row-state.style.css and preserving the striped row backgrounds.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9b235939-a7ec-4e75-9509-970ce14d1153

📥 Commits

Reviewing files that changed from the base of the PR and between 0648d8d and 9ebdeb7.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • packages/aggrid/src/aggrid-ix-theme-params.ts
  • packages/aggrid/src/index.ts
  • packages/aggrid/src/row-state.style.css
  • packages/storybook-docs/package.json
  • packages/storybook-docs/src/stories/aggrid.stories.ts

Comment on lines +38 to +49
function renderGrid(args: AgGridArgs) {
const container = document.createElement('div');
container.style.height = '20rem';
container.style.width = '100%';

createGrid(container, {
...args.gridOptions,
theme: getIxTheme(agGridCommunity),
});

return container;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Store grid API and call destroy() on re-render to prevent leaks.

createGrid returns a GridApi with a destroy() method. Without storing and destroying the previous instance, Storybook re-renders (arg changes, story switching) will leak grid instances — event listeners, timers, and DOM observers remain active. This degrades Storybook performance over time.

♻️ Proposed fix to add grid cleanup
+let gridApi: ReturnType<typeof createGrid> | null = null;
+
 function renderGrid(args: AgGridArgs) {
+  if (gridApi) {
+    gridApi.destroy();
+    gridApi = null;
+  }
   const container = document.createElement('div');
   container.style.height = '20rem';
   container.style.width = '100%';
 
-  createGrid(container, {
+  gridApi = createGrid(container, {
     ...args.gridOptions,
     theme: getIxTheme(agGridCommunity),
   });
 
   return container;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function renderGrid(args: AgGridArgs) {
const container = document.createElement('div');
container.style.height = '20rem';
container.style.width = '100%';
createGrid(container, {
...args.gridOptions,
theme: getIxTheme(agGridCommunity),
});
return container;
}
let gridApi: ReturnType<typeof createGrid> | null = null;
function renderGrid(args: AgGridArgs) {
if (gridApi) {
gridApi.destroy();
gridApi = null;
}
const container = document.createElement('div');
container.style.height = '20rem';
container.style.width = '100%';
gridApi = createGrid(container, {
...args.gridOptions,
theme: getIxTheme(agGridCommunity),
});
return container;
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/storybook-docs/src/stories/aggrid.stories.ts` around lines 38 - 49,
Update renderGrid to retain the GridApi returned by createGrid and destroy the
previously stored grid instance before creating a replacement. Ensure cleanup
occurs on each re-render while preserving the existing container setup and grid
options.

@nuke-ellington

Copy link
Copy Markdown
Collaborator

Fixed via #2713

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.

3 participants