Skip to content

fix(grid): notify change detection when column state changes - #17602

Open
viktorkombov wants to merge 2 commits into
masterfrom
vkombov/fix-17598
Open

fix(grid): notify change detection when column state changes#17602
viktorkombov wants to merge 2 commits into
masterfrom
vkombov/fix-17598

Conversation

@viktorkombov

Copy link
Copy Markdown
Contributor

Closes #17598

Description

The column actions list and the toolbar action buttons read grid state
directly but never marked their own views dirty. Under zone.js every
timer and overlay callback produced a tick, so the indicators refreshed
incidentally. Zoneless recognises only markForCheck, setInput, signal
updates, listeners and attaching a dirty view - none of which a QueryList
reset or an EventEmitter is - so the views can stay stale until an
unrelated interaction checks them.

Each component now marks itself dirty from the state it renders:
column actions on columnList.changes, the pinning and hiding buttons on
columnPinned and columnVisibilityChanged, and advanced filtering on
advancedFilteringExpressionsTreeChange. The advanced filtering
subscription also gains the teardown it was missing.

Motivation / Context

Type of Change (check all that apply):

  • Bug fix
  • New functionality
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes)
  • Documentation
  • Demos
  • CI/CD
  • Tests
  • Changelog
  • Skills/Agents

Component(s) / Area(s) Affected:

How Has This Been Tested?

  • Unit tests
  • Manual testing
  • Automated e2e tests

Test Configuration:

  • Angular version:
  • Browser(s):
  • OS:

Screenshots / Recordings

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them
  • Accessibility (ARIA, keyboard navigation, focus management) has been verified

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

🟡 Changes recommended

One or more issues must be addressed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Fixes stale grid toolbar indicators in zoneless Angular Elements views.

Changes:

  • Adds change-detection notifications for column and filtering state changes.
  • Adds teardown for advanced-filtering subscriptions.
  • Adds an Elements regression test for column removal.
File summaries
File Description
projects/igniteui-angular/grids/core/src/toolbar/grid-toolbar.base.ts Updated as part of this pull request.
projects/igniteui-angular/grids/core/src/toolbar/grid-toolbar-advanced-filtering.component.ts Updated as part of this pull request.
projects/igniteui-angular/grids/core/src/column-actions/column-actions.component.ts Updated as part of this pull request.
projects/igniteui-angular-elements/src/app/custom-strategy.spec.ts Updated as part of this pull request.
Review details

Suppressed comments (1)

projects/igniteui-angular/grids/core/src/column-actions/column-actions.component.ts:206

  • ngDoCheck() already diffs grid.columnList and increments pipeTrigger when that list changes (see column-actions.component.ts:388-394). Because this callback increments it as well, every add/remove causes two trigger updates and reruns all three pure pipes twice; the callback only needs to mark the view dirty so the existing differ runs in the scheduled check.
                this.pipeTrigger++;
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread projects/igniteui-angular-elements/src/app/custom-strategy.spec.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Elements] Grid column actions indicators are not updated when column state changes

3 participants