Addition of the search filters in a form of filters tabs#184
Conversation
Signed-off-by: gkrajniak <gkrajniak@gmail.com>
|
Warning Review limit reached
Next review available in: 35 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds a horizontally scrollable filter tab strip to ChangesFilter Tabs Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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.
Actionable comments posted: 5
🧹 Nitpick comments (1)
projects/ngx/declarative-ui/table-card/models/configs.ts (1)
52-53: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument or enforce a single default tab.
This contract currently allows multiple
default: trueentries, but the component initializes with the first match only (filterTabs().find((t) => t.default)inprojects/ngx/declarative-ui/table-card/declarative-table-card.component.ts). Tightening the API here would avoid silent misconfiguration for hosts.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@projects/ngx/declarative-ui/table-card/models/configs.ts` around lines 52 - 53, The table tab config currently allows multiple entries to set default true, but DeclarativeTableCardComponent only uses the first match via filterTabs().find((t) => t.default), which can hide misconfiguration. Tighten the Config interface in configs.ts by documenting or enforcing that only one tab may be default, and update the tab selection logic in declarative-table-card.component.ts to validate and reject multiple defaults (or otherwise surface an explicit error) instead of silently picking the first match.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/declarative-table-card.md`:
- Around line 279-280: Clarify the initial default-tab behavior in the
declarative table card docs: `activeFilterTab` is initialized from a
`FieldFilterDefinition` with `default: true`, but
`selectFilterTab()`/`filterTabChanged` only fire on user interaction. Update the
contract around `activeFilterTab`, `selectFilterTab()`, and `filterTabChanged`
so hosts know they must seed the initial dataset/query from the default tab too,
or explicitly emit the initial selection during setup.
In
`@projects/ngx/declarative-ui/table-card/declarative-table-card.component.html`:
- Around line 66-89: The filter controls in
declarative-table-card.component.html are using tab semantics for a filter UI,
which is the wrong accessibility pattern. Update the filter strip and its
buttons to use plain button/toggle semantics by removing the tablist/tab roles
and related aria-selected state from the All button and the `@for` tab buttons, or
alternatively implement the full tabs pattern with roving tabindex, keyboard
handling, and panel association. Use the existing filterStrip, isAllTabActive(),
activeFilterTab(), and selectFilterTab() references to locate the markup to
adjust.
In
`@projects/ngx/declarative-ui/table-card/declarative-table-card.component.scss`:
- Around line 96-139: The new filter tab styles in
declarative-table-card.component.scss have inline `//` comments that violate
`scss/double-slash-comment-empty-line-before`. Update the `&__filter-tabs`,
`&__filter-strip`, and `&__filter-tab` blocks so the comments have the required
blank line before them, or convert those notes to block comments, keeping the
SCSS lint-clean.
In `@projects/ngx/declarative-ui/table-card/declarative-table-card.component.ts`:
- Line 180: The callbacks passed to afterNextRender in
DeclarativeTableCardComponent are using shorthand arrows that return void
expressions, which violates the lint rule. Update the affected afterNextRender
calls to use block-bodied arrow functions and invoke recomputeScrollState() and
any other side-effect-only methods inside the block, keeping the behavior
unchanged. Locate the affected usages in DeclarativeTableCardComponent by the
afterNextRender and recomputeScrollState symbols.
- Around line 186-194: The ResizeObserver setup in afterNextRender for
DeclarativeTableCardComponent only runs once, so if filterTabs appears after the
initial render and filterStripRef is still missing, no observer is ever
attached. Move the observer attachment logic into a place that runs when the
conditional strip becomes available or is updated, using the existing
DeclarativeTableCardComponent and recomputeScrollState flow so observe() is
called once filterStripRef() exists.
---
Nitpick comments:
In `@projects/ngx/declarative-ui/table-card/models/configs.ts`:
- Around line 52-53: The table tab config currently allows multiple entries to
set default true, but DeclarativeTableCardComponent only uses the first match
via filterTabs().find((t) => t.default), which can hide misconfiguration.
Tighten the Config interface in configs.ts by documenting or enforcing that only
one tab may be default, and update the tab selection logic in
declarative-table-card.component.ts to validate and reject multiple defaults (or
otherwise surface an explicit error) instead of silently picking the first
match.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1341d0fd-944e-43ec-903b-929fdbe8e3b4
📒 Files selected for processing (7)
docs/declarative-table-card.mdprojects/ngx/declarative-ui/stories/declarative-table-card.stories.tsprojects/ngx/declarative-ui/table-card/declarative-table-card.component.htmlprojects/ngx/declarative-ui/table-card/declarative-table-card.component.scssprojects/ngx/declarative-ui/table-card/declarative-table-card.component.tsprojects/ngx/declarative-ui/table-card/models/configs.tsprojects/ngx/declarative-ui/table/declarative-table/declarative-table.component.scss
… for `DashboardI18nService` Signed-off-by: gkrajniak <gkrajniak@gmail.com>
The feature takes form of a filters fabs, All tab is added automatically whne there is any filter added as a way to clear applied filter
Summary by CodeRabbit
New Features
Bug Fixes
Documentation