Skip to content

Conversation

@spike-rabbit
Copy link
Member

@spike-rabbit spike-rabbit commented Nov 18, 2025

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)

groupedRows and groupRowsBy are decorator based inputs.

What is the new behavior?

groupedRows and groupRowsBy are signal inputs. A new _internalGroupedRows contains the calculated combination.

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:

groupedRows will no longer be updated, if grouped rows are calculated based on groupRowsBy.

Other information:

@spike-rabbit spike-rabbit changed the title Refactor/datatable/make rows group refactor: convert groupedRows to signal input Nov 18, 2025
@spike-rabbit spike-rabbit force-pushed the refactor/datatable/make-rows-group branch 2 times, most recently from dbdc192 to ebb5a76 Compare November 19, 2025 08:34
@spike-rabbit spike-rabbit marked this pull request as ready for review November 19, 2025 08:41
@spike-rabbit spike-rabbit requested a review from a team as a code owner November 19, 2025 08:41
@fh1ch fh1ch requested a review from Copilot November 19, 2025 11:32
Copilot finished reviewing on behalf of fh1ch November 19, 2025 11:35
Copy link

Copilot AI left a comment

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 refactors groupedRows and groupRowsBy from decorator-based @Input() properties to signal inputs, introducing a new computed signal _internalGroupedRows that consolidates the logic for calculating and sorting grouped rows. The refactoring moves sorting and grouping logic from imperative lifecycle methods into reactive computed signals.

Key changes:

  • Converted groupedRows and groupRowsBy to signal inputs
  • Introduced _internalGroupedRows computed signal to handle grouped row calculation and sorting
  • Removed manual sorting calls from ngDoCheck() and onColumnSort(), as sorting is now reactive
  • Removed the sortInternalRows() private method and _groupRowsBy field

Reviewed Changes

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

File Description
projects/ngx-datatable/src/lib/components/datatable.component.ts Converted inputs to signals, added _internalGroupedRows computed signal, removed imperative sorting logic
projects/ngx-datatable/src/lib/components/datatable.component.html Updated bindings to use _internalGroupedRows() instead of groupedRows, removed groupRowsBy binding
projects/ngx-datatable/src/lib/components/body/body.component.ts Removed unused groupRowsBy input from body component

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

@spike-rabbit spike-rabbit force-pushed the refactor/datatable/make-rows-group branch from ebb5a76 to 1adc5b9 Compare November 19, 2025 12:27
@fh1ch fh1ch added the breaking-changes Marks issues and PRs that are breaking the API label Nov 19, 2025
Converts `groupedRows` and `groupRowsBy` to signal inputs.
Introduces a new `_internalGroupedRows` which contains the combination of both inputs.

BREAKING CHANGE: Previously, the `groupedRows` input was updated by the datatable,
when `groupRowsBy` was used. This behavior was dropped. `groupedRows` will only contain
application provided values. The table calculates internal the actual `groupedRows`
without exposing them.
@fh1ch fh1ch force-pushed the refactor/datatable/make-rows-group branch from 1adc5b9 to 731df2b Compare November 19, 2025 20:19
Copy link
Member

@fh1ch fh1ch left a comment

Choose a reason for hiding this comment

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

@spike-rabbit outstanding work, thanks a bunch 🙇

LGTM 👍

@fh1ch fh1ch enabled auto-merge (rebase) November 19, 2025 20:22
@fh1ch fh1ch merged commit 30d1c7c into main Nov 19, 2025
3 checks passed
@fh1ch fh1ch deleted the refactor/datatable/make-rows-group branch November 19, 2025 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-changes Marks issues and PRs that are breaking the API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants