Skip to content

Conversation

@spike-rabbit
Copy link
Member

@spike-rabbit spike-rabbit commented Nov 17, 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)

columns are a decorator based input.

What is the new behavior?

columns are a signal input. _internalColumns are linkedSignal to allow modifications.

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

  • Yes, but already covered in another commit
  • No

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

Other information:

This is just an intermediate solution, so that we can turn the columns into a signal input.

Since we internally mutate the columns, _internalColumns has to be a linkedSignal. We should consider alternative approaches, that only use computed.

@spike-rabbit spike-rabbit marked this pull request as ready for review November 17, 2025 09:38
@spike-rabbit spike-rabbit requested a review from a team as a code owner November 17, 2025 09:38
@fh1ch fh1ch requested a review from Copilot November 17, 2025 11:57
@fh1ch fh1ch added the enhancement New feature or request label Nov 17, 2025
Copilot finished reviewing on behalf of fh1ch November 17, 2025 11:59
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 the columns property from a decorator-based @Input to a signal-based input. To handle internal column modifications (like width changes), _internalColumns is introduced as a linkedSignal that derives from either column templates or the columns input.

Key Changes:

  • Converted columns from @Input getter/setter to input<TableColumn[]>()
  • Introduced _internalColumns as a linkedSignal to handle mutable column state
  • Updated recalculateColumns method signature to require columns parameter and return TableColumnInternal[]
  • Updated all references to _internalColumns to call it as a signal function

Reviewed Changes

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

File Description
projects/ngx-datatable/src/lib/components/datatable.component.ts Refactored columns to signal input, introduced linkedSignal for internal columns, updated method signatures and all column references
projects/ngx-datatable/src/lib/components/datatable.component.html Updated template bindings to call _internalColumns() as a signal function

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

This is just an intermediate solution, so that we
can turn the `columns` into a signal input.

Since we internally mutate the columns,
`_internalColumns` has to be a `linkedSignal`.
We should consider alternative approaches,
that only use computed.
@spike-rabbit spike-rabbit force-pushed the refactor/columns-to-linked-signal branch from 33f77f3 to d29d76a Compare November 17, 2025 13:07
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 thanks a ton for the rework, all good now 🙇

LGTM 👍

@fh1ch fh1ch merged commit 49d1760 into main Nov 17, 2025
3 checks passed
@fh1ch fh1ch deleted the refactor/columns-to-linked-signal branch November 17, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants