Skip to content

fix: ensure custom sort icons become applied#704

Merged
spike-rabbit merged 1 commit into
siemens:mainfrom
spliffone:fix/header-column-sort-icons
Jun 10, 2026
Merged

fix: ensure custom sort icons become applied#704
spike-rabbit merged 1 commit into
siemens:mainfrom
spliffone:fix/header-column-sort-icons

Conversation

@spliffone

@spliffone spliffone commented Jun 9, 2026

Copy link
Copy Markdown
Member

ensure consumers can provide multiple classes for a single sort direction

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

What is the new behavior?

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

@spliffone spliffone requested a review from a team as a code owner June 9, 2026 17:45

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request refactors DataTableHeaderCellComponent to return a space-separated string for sortClass instead of an array of strings, and adds unit tests to verify custom sort icons. A review comment points out that accessing this.cellContext() in calcSortClass introduces an unnecessary dependency on the cellContext computed signal, which can trigger redundant re-evaluations when row selection changes. It is recommended to directly access this.column().sortable instead.

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.

@fh1ch fh1ch added the bug Something isn't working label Jun 10, 2026
@fh1ch fh1ch requested a review from Copilot June 10, 2026 05:12

Copilot AI 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.

Pull request overview

This PR fixes sort icon class application in DataTableHeaderCellComponent so consumers can provide multiple CSS classes for a given sort direction (e.g., "icon up") and have them applied correctly to the sort indicator element.

Changes:

  • Change sortClass/calcSortClass to return a space-delimited string suitable for [class] binding (instead of a string[]).
  • Add unit tests verifying that custom multi-class sort icon values are applied for ascending/descending toggles.
  • Update spec TS config typings to include Vitest browser typings used by the new tests.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
projects/ngx-datatable/tsconfig.spec.json Adds Vitest browser typings needed by browser-context test utilities.
projects/ngx-datatable/src/lib/components/header/header-cell.component.ts Fixes sort indicator class binding by emitting a single class string.
projects/ngx-datatable/src/lib/components/header/header-cell.component.spec.ts Adds coverage to ensure multi-class custom sort icon inputs are applied.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@spike-rabbit spike-rabbit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

Ensure consumers can provide multiple classes for a single sort direction.
@spike-rabbit spike-rabbit force-pushed the fix/header-column-sort-icons branch from 54f8c49 to eb705a5 Compare June 10, 2026 10:48
@spike-rabbit spike-rabbit enabled auto-merge June 10, 2026 10:48
@spike-rabbit spike-rabbit added this pull request to the merge queue Jun 10, 2026
Merged via the queue into siemens:main with commit 008b011 Jun 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants