Skip to content

Conversation

@spike-rabbit
Copy link
Member

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

Imperatively updating the table dimensions and related property by manually calling a function and setting the values.

What is the new behavior?

Moving the dimensions into a signal and using computed for depending values.

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:

There is more potential for optimization. I will do this in another PR to keep the changes small.
The long-term goal is to update the dimensions using a ResizeObserver.

@spike-rabbit spike-rabbit force-pushed the refactor/use-signals-for-dimensions branch 3 times, most recently from 6be19ab to 36e2e9c Compare November 20, 2025 07:51
@spike-rabbit spike-rabbit marked this pull request as ready for review November 20, 2025 07:55
@spike-rabbit spike-rabbit requested a review from a team as a code owner November 20, 2025 07:55
@fh1ch fh1ch added the enhancement New feature or request label Nov 20, 2025
@fh1ch fh1ch requested a review from Copilot November 20, 2025 09:04
Copilot finished reviewing on behalf of fh1ch November 20, 2025 09:07
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 dimensions management in the datatable component to use Angular signals instead of imperative property updates. The changes move _innerWidth and bodyHeight from regular properties to computed signals, and introduce a new dimensions signal to store the component's width and height.

Key changes:

  • Converted _innerWidth and bodyHeight to computed signals derived from a new dimensions signal
  • Simplified recalculateDims() to only update the dimensions signal
  • Updated template to invoke the computed signals as functions

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

File Description
datatable.component.ts Refactored dimensions properties to use signals: introduced dimensions signal, converted _innerWidth and bodyHeight to computed signals, and simplified recalculateDims() method
datatable.component.html Updated template bindings to invoke _innerWidth() and bodyHeight() as signal functions
*.png (snapshots) Updated visual regression test snapshots reflecting minor rendering differences

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

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.

LGTM 👍

@fh1ch fh1ch force-pushed the refactor/use-signals-for-dimensions branch from 36e2e9c to 353619a Compare November 20, 2025 09:10
@fh1ch fh1ch enabled auto-merge (rebase) November 20, 2025 09:10
@fh1ch fh1ch merged commit bffcbec into main Nov 20, 2025
3 checks passed
@fh1ch fh1ch deleted the refactor/use-signals-for-dimensions branch November 20, 2025 09:14
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