Add filtered visible row count to grid totals#178
Conversation
|
Warning Review limit reached
More reviews will be available in 2 minutes and 52 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
📝 WalkthroughWalkthroughThis PR implements a live "Total rows" counter beneath the data grid that displays the count of all rows, or "Total rows | Filtered Visible" when filters are active. The feature combines grid visibility metrics, filter-change notifications, component UI synchronization, test infrastructure, and comprehensive test coverage across units, functional, and Storybook tests. ChangesRow Count Display Feature
🎯 3 (Moderate) | ⏱️ ~25 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac84af30d5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds a live row-count status underneath the Tabulator-backed data grid, including a conditional “Filtered Visible” count when either the global quick filter or header column filters are active (addresses #171).
Changes:
- Render and update a
Total rowsstatus element inDataGridComponentView, refreshing on grid changes viaonGridChanged+requestAnimationFrame. - Extend the Tabulator grid extension to expose total/visible row counts, detect active filters, and trigger grid-change notifications on filter events.
- Add/expand Jest, Storybook play, and Playwright browser coverage asserting total-row and filtered-visible behavior.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/core-ui/src/tests/grid/tabulator-duplicate-column-copy.test.js | Updates expectations for the new dataFiltered grid-change listener. |
| packages/core-ui/src/tests/grid/data-grid-component-view.test.js | Adds view tests asserting the total-row display and filtered-visible conditional rendering. |
| packages/core-ui/js/gui_components/data-grid-editor/tabulator/tabulator-helpers.js | Adds global-filter query accessors used to detect active global filtering. |
| packages/core-ui/js/gui_components/data-grid-editor/tabulator/gridExtension-tabulator.js | Implements total/visible row counting + active-filter detection and emits grid-change notifications on filtering. |
| packages/core-ui/js/gui_components/data-grid-editor/data-grid-component-view.js | Renders the total-row status element and schedules syncs on grid changes. |
| apps/web/src/tests/browser/app/functional/test-data/basic-generation.spec.js | Asserts total-row count after test data generation. |
| apps/web/src/tests/browser/app/functional/import-export/set-grid-from-text.spec.js | Asserts total-row count after import and after malformed import reset behavior. |
| apps/web/src/tests/browser/app/functional/grid-editor/row-single-select-operations/add-single-row.spec.js | Asserts total-row count updates after adding a row. |
| apps/web/src/tests/browser/app/functional/filtering-sorting/global-filter.spec.js | Asserts “Filtered Visible” behavior for global quick filtering. |
| apps/web/src/tests/browser/app/functional/filtering-sorting/column-filter.spec.js | Asserts “Filtered Visible” behavior for header column filtering (and combined with quick filter). |
| apps/web/src/tests/browser/app/abstractions/components/grid-editor.component.js | Adds page-object helpers to assert total rows and filtered-visible rows in browser tests. |
| apps/web/src/stories/data-grid-editor.stories.js | Updates Storybook play tests to wait for whenReady() and assert total-row text updates. |
Greptile SummaryThis PR introduces a
Confidence Score: 5/5Safe to merge. All changed paths are additive, cleanup is thorough, and the rAF debounce correctly coalesces double notifications that arise from Tabulator's dataFiltered event and the explicit _notifyGridChanged calls firing in the same synchronous tick. The new component follows the established MVC pattern with correct ARIA semantics, proper destroy-time cleanup (pending frame cancelled, subscription removed, summary component destroyed in the right order), and Promise propagation for async row insertion. The previously missing Storybook story for the filtered mode is now present. No unhandled edge cases or incorrect state transitions were found across the controller, view, integration, or E2E layers. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant T as Tabulator
participant GE as GridExtensionTabulator
participant DGV as DataGridComponentView
participant S as GridRowVisibilitySummary
Note over DGV,S: mount() — grid ready
DGV->>GE: onGridChanged(callback)
DGV->>S: "update({totalRowCount:0, ...})"
Note over T,DGV: User applies filter
T-->>GE: dataFiltered event
GE->>DGV: _notifyGridChanged → scheduleSyncTotalRows()
DGV->>GE: getRowVisibilitySummary()
GE-->>DGV: "{total:5, visible:2, hasActiveFilters:true}"
DGV->>S: "update({totalRowCount:5, visibleRowCount:2, hasActiveFilters:true})"
S-->>S: "render "Total rows: 5 | Filtered Visible: 2""
Note over T,DGV: User clears filters
GE->>GE: clearGlobalFilterQuery()
GE->>DGV: _notifyGridChanged → scheduleSyncTotalRows() (rAF debounced)
DGV->>GE: getRowVisibilitySummary()
GE-->>DGV: "{total:5, visible:5, hasActiveFilters:false}"
DGV->>S: "update({totalRowCount:5, visibleRowCount:5, hasActiveFilters:false})"
S-->>S: render "Total rows: 5"
Note over DGV,S: destroy()
DGV->>DGV: cancelAnimationFrame, unsubscribeGridChanged
DGV->>S: destroy()
Reviews (2): Last reviewed commit: "Add grid row visibility summary componen..." | Re-trigger Greptile |
Add filtered visible row count when the grid is filtered.
Summary
Filtered VisiblealongsideTotal rowsonly when filters are activeFixes #171
Summary by CodeRabbit