feat: support bulk actions via summary row directive#653
feat: support bulk actions via summary row directive#653chintankavathia wants to merge 1 commit intosiemens:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new DataTableBulkActionsRowComponent to the ngx-datatable library, providing a sticky row for displaying bulk action controls when table rows are selected. The changes include the creation of the new component, its integration into the datatable's body and main component, and updates to the public API. A new demo component, BulkActionsSelectionComponent, has been added to showcase this functionality, along with corresponding Playwright E2E tests and a visual snapshot. Feedback suggests improving the styling of the bulk actions row to avoid tight coupling with summary row styles and converting the selected property in the demo component to an Angular Signal for consistency and to leverage modern Angular practices.
2356e3e to
89b9ce1
Compare
spike-rabbit
left a comment
There was a problem hiding this comment.
What is difference between this and the summary row?
summary row is designed to render same number of cells as defined by columns config. user needs to pass |
spike-rabbit
left a comment
There was a problem hiding this comment.
I had chat with @fh1ch we both don't like to call it bulk actions, as technically this "row" is not restricted to some element pattern.
What this PR provides is basically still a summary, just column independent.
So renaming the directive to ngx-datatable-summary-row and reusing the existing classes, would be better.
c1177a5 to
2054520
Compare
There was a problem hiding this comment.
Pull request overview
This PR extends the datatable’s existing “summary row” feature to support a custom, sticky template (used to implement a bulk-actions bar shown when rows are selected), and wires it into the demo app and Playwright coverage.
Changes:
- Add
ngx-datatable-summary-rowdirective and plumb itsTemplateReffromDatatableComponent→DataTableBodyComponent→DataTableSummaryRowComponent. - Update
DataTableSummaryRowComponentto render custom template content (and add sticky styling/tests). - Add a new selection demo route + Playwright e2e coverage and snapshot for the bulk actions example.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/app/selection/selection-bulk-actions.component.ts | New demo showing a bulk actions bar rendered via the summary-row template when selection is non-empty. |
| src/app/app.component.html | Adds nav link to the new bulk actions selection demo. |
| src/app/app-routing.module.ts | Registers a lazy-loaded route for the new bulk actions selection demo. |
| projects/ngx-datatable/src/public-api.ts | Exposes the new summary-row directive as part of the public API. |
| projects/ngx-datatable/src/lib/ngx-datatable.module.ts | Makes the new directive available via NgxDatatableModule. |
| projects/ngx-datatable/src/lib/components/datatable.component.ts | Adds a content query for the new directive so the template can be passed down. |
| projects/ngx-datatable/src/lib/components/datatable.component.html | Passes the queried template into the body component. |
| projects/ngx-datatable/src/lib/components/body/summary/summary-row.directive.ts | Introduces the ngx-datatable-summary-row directive for providing a custom summary-row template. |
| projects/ngx-datatable/src/lib/components/body/summary/summary-row.component.ts | Adds template-based rendering path + sticky class behavior to the summary row component. |
| projects/ngx-datatable/src/lib/components/body/summary/summary-row.component.spec.ts | Adds unit tests asserting template rendering and sticky class behavior. |
| projects/ngx-datatable/src/lib/components/body/summary/summary-row.component.scss | Adds sticky positioning styles for the template-based summary row. |
| projects/ngx-datatable/src/lib/components/body/body.component.ts | Renders the summary row when either computed summary is enabled or a template is provided; forwards the template input. |
| playwright/e2e/selection.spec.ts | Adds e2e coverage ensuring the bulk actions bar is hidden/shown based on selection and runs visual/a11y checks. |
| playwright/snapshots/e2e/selection.spec.ts-snapshots/bulk-actions-selection--bulk-actions-single-selection-chromium-linux.png | Adds a snapshot for the bulk actions selection state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2054520 to
2619890
Compare
Add `DatatableSummaryRowDirective` (`[ngx-datatable-summary-row]`) that allows rendering a bulk actions bar in the summary row position. When rows are selected, users can project action controls (e.g. delete, export) that appear as a sticky row at the top of the datatable body. The directive reuses the existing summary row infrastructure, extending it with a template input that bypasses per-column computation and renders the provided content directly. Usage: ```html <ngx-datatable [rows]="rows" selectionType="checkbox" [(selected)]="selected"> @if (selected.length) { <ng-template ngx-datatable-summary-row> <span>{{ selected.length }} selected</span> <button (click)="delete()">Delete</button> </ng-template> } </ngx-datatable> ```
2619890 to
b8f7ea1
Compare
Add
DatatableSummaryRowDirective([ngx-datatable-summary-row]) that allows rendering a bulk actions bar in the summary row position. When rows are selected, users can project action controls (e.g. delete, export) that appear as a sticky row at the top of the datatable body.The directive reuses the existing summary row infrastructure, extending it with a template input that bypasses per-column computation and renders the provided content directly.
Usage:
What kind of change does this PR introduce? (check one with "x")
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")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: