Skip to content

feat(filter): new TEDI-Ready component #530#629

Open
airikej wants to merge 10 commits into
rcfrom
feat/530-filter-new-tedi-ready-component
Open

feat(filter): new TEDI-Ready component #530#629
airikej wants to merge 10 commits into
rcfrom
feat/530-filter-new-tedi-ready-component

Conversation

@airikej
Copy link
Copy Markdown
Contributor

@airikej airikej commented May 18, 2026

Summary by CodeRabbit

  • New Features

    • Added new Filter and FilterGroup components supporting toggle, single-select, and multi-select filtering modes.
    • Added borderless variant to the Calendar component.
    • Improved Search component with enhanced accessibility.
  • Documentation

    • Comprehensive documentation for Filter and FilterGroup components added to the component reference.
  • Dependencies

    • Updated design system core dependency to version 6.2.0.

Review Change Stack

@airikej airikej linked an issue May 18, 2026 that may be closed by this pull request
21 tasks
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Warning

Rate limit exceeded

@airikej has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 31 minutes and 48 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d2d42981-5ae4-4595-a475-d8b3018ed0c8

📥 Commits

Reviewing files that changed from the base of the PR and between 9b283f4 and f9dffc3.

📒 Files selected for processing (4)
  • src/tedi/components/filter/filter/filter-group.tsx
  • src/tedi/components/filter/filter/filter.spec.tsx
  • src/tedi/components/filter/filter/filter.tsx
  • src/tedi/components/form/search/search.tsx
📝 Walkthrough

Walkthrough

This PR introduces the Filter component ecosystem to TEDI, adding a flexible pill-shaped toggle/dropdown filtering UI that supports single-select, multi-select, and custom content modes via FilterGroup coordination. It also adds a borderless Calendar variant and improves Search accessibility.

Changes

Filter Component & Calendar Enhancement

Layer / File(s) Summary
Dependency & Documentation Updates
package.json, skills/tedi-react/SKILL.md, skills/tedi-react/references/components.md, skills/tedi-react/references/forms.md
Bumps @tedi-design-system/core to 6.2.0 and documents Filter/FilterGroup in component and form control reference guides, including usage examples, modes, and prop details.
Calendar Borderless Variant
src/tedi/components/content/calendar/calendar.module.scss, src/tedi/components/content/calendar/calendar.tsx
Adds optional bordered?: boolean prop (default true) to Calendar; when false, removes background/border and resets border-radius via --borderless SCSS modifier applied to DayPicker and grid containers.
Filter Group Context & Component
src/tedi/components/filter/filter/filter-group-context.ts, src/tedi/components/filter/filter/filter-group.tsx
Establishes FilterGroupContext for shared selection state and implements FilterGroup component with single-select radiogroup and multi-select modes, supporting both controlled and uncontrolled state, with ARIA role semantics.
Filter Component Styles
src/tedi/components/filter/filter/filter.module.scss
Defines core tedi-filter layout, CSS variable theming, primary/secondary/large modifiers, button/text/icon/slot styling, and tedi-filter-group adjacent-chip merging with z-index elevation and border radius adjustments.
Filter Component Implementation
src/tedi/components/filter/filter/filter.tsx
Implements unified Filter component with toggle, single-select, and multi-select dropdown modes; supports controlled/uncontrolled state, search filtering, select-all checkbox, clear action, custom dropdown content, and FilterGroupContext integration.
Filter Exports & Integration
src/tedi/components/filter/filter/index.ts, src/tedi/index.ts, src/tedi/components/overlays/dropdown/dropdown.module.scss, src/tedi/providers/label-provider/labels-map.ts
Creates filter barrel export, adds Filter/FilterGroup to main library exports, updates dropdown minimum-width fallback from 10rem to max-content, and adds filter.clear-selection and filter.select-all localized labels (Estonian, English, Russian).
Filter Testing & Storybook Stories
src/tedi/components/filter/filter/filter.spec.tsx, src/tedi/components/filter/filter/filter.stories.tsx
Comprehensive test suite covering all filter modes and FilterGroup semantics; extensive Storybook stories demonstrating variants, size, states, custom content, calendar-backed date ranges, and realistic multi-filter examples with tag chips and clear-all actions.
Search Component Accessibility Enhancement
src/tedi/components/form/search/search.tsx
Adds explicit role="searchbox" to underlying input element, preserving any existing input configuration via object spread.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

  • [Filter]: New TEDI-Ready component #530: Implements the new Filter component (FilterGroup, context, styles, tests, and stories) directly addressing the "[Filter]: New TEDI-Ready component" feature.

Possibly related PRs

  • TEDI-Design-System/react#595: Both PRs modify calendar implementation—main PR adds bordered variant to support borderless use inside Filter dropdowns, while retrieved PR introduces the TEDI-Ready calendar/datefield components.
  • TEDI-Design-System/react#610: Both PRs modify src/tedi/components/form/search/search.tsx Search component behavior—main PR adds role="searchbox" to input, retrieved PR changes className application to input.
  • TEDI-Design-System/react#598: Both PRs bump @tedi-design-system/core dependency in package.json (main: 6.0.1→6.2.0, retrieved: 3.3.0→6.0.0).

Suggested reviewers

  • mart-sessman
  • ly-tempel-bitweb
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: introducing a new Filter component as a TEDI-Ready component, which aligns with the substantial changes across the codebase.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/530-filter-new-tedi-ready-component

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

❌ Patch coverage is 99.52830% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/tedi/components/filter/filter/filter.tsx 99.39% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 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 `@src/tedi/components/filter/filter/filter-group.tsx`:
- Around line 169-173: The managed filter group can render
role=('group'|'radiogroup') without an accessible name; update the FilterGroup
component to require or provide an accessible name whenever isManaged is true by
(a) accepting an ariaLabelledBy prop (or making label required for managed
groups) and (b) using it in the container: compute role as before (using
isManaged and multiselect) but if role is set then ensure aria-label or
aria-labelledby is provided (e.g., if !label and !ariaLabelledBy, throw or
console.error and return null or add a runtime prop-type/TS error); update the
role assignment and the div to pass aria-labelledby={ariaLabelledBy} when
provided and only set aria-label={label} if label exists so the container never
exposes a role without an accessible name (refer to the role variable, label
prop, and the div element rendering inside FilterGroupContext.Provider).

In `@src/tedi/components/filter/filter/filter.tsx`:
- Around line 339-345: The grouped case in the useMemo for isSelected only calls
group.isSelected(groupValue) which hides local selection changes; change the
logic in the isSelected computed value (the useMemo around isSelected) to, when
isGrouped && groupValue !== undefined, return group.isSelected(groupValue) OR
the local selection state (i.e., for multi-select check multiValues.length > 0,
for single-select check singleValue !== '', otherwise check toggleSelected) so
group-managed filters don't mask local dropdown selections; apply the same fix
to the other isSelected useMemo occurrences (the blocks around the other two
similar implementations).
- Around line 80-103: The component currently treats filters with children as
dropdown-only and never initializes or toggles the internal toggle state, so
defaultSelected and onSelectedChange don't work for custom-content filters;
modify the logic that decides toggle vs dropdown so that when children are
present but the filter is in "custom-content" mode you still initialize
innerSelected from defaultSelected (and sync with selected when controlled) and
keep using handleToggle to flip innerSelected and call onSelectedChange;
specifically update the code paths in the render/handler logic that switch
behavior based on children to (1) initialize innerSelected from defaultSelected,
(2) attach/retain handleToggle for custom-content filters even when children
exist, and (3) ensure handleToggle invokes onSelectedChange and updates
innerSelected when not controlled (symbols: innerSelected, handleToggle,
selected, defaultSelected, onSelectedChange, children).

In `@src/tedi/components/form/search/search.tsx`:
- Line 65: The prop spread currently does input: { role: 'searchbox' as const,
...input } which allows consumers to override the role; change the spread order
so the role is applied last (e.g., build the object as { ...input, role:
'searchbox' as const }) to guarantee role="searchbox" cannot be overridden —
update the object assigned to input in search.tsx (the input prop/object where
role is set) so the 'searchbox' role is merged after ...input.

In `@src/tedi/components/overlays/dropdown/dropdown.module.scss`:
- Line 7: The width declaration in dropdown.module.scss uses a CSS var() with a
fallback (var(--dropdown-min-width, max-content)) which violates the rule;
update the rule so it uses only the custom property name without a fallback by
replacing the value with var(--dropdown-min-width) on the width property in the
dropdown stylesheet.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9b995a7c-872c-4e9a-a64f-5b58e8dd2dc4

📥 Commits

Reviewing files that changed from the base of the PR and between 7285c2a and 9b283f4.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (17)
  • package.json
  • skills/tedi-react/SKILL.md
  • skills/tedi-react/references/components.md
  • skills/tedi-react/references/forms.md
  • src/tedi/components/content/calendar/calendar.module.scss
  • src/tedi/components/content/calendar/calendar.tsx
  • src/tedi/components/filter/filter/filter-group-context.ts
  • src/tedi/components/filter/filter/filter-group.tsx
  • src/tedi/components/filter/filter/filter.module.scss
  • src/tedi/components/filter/filter/filter.spec.tsx
  • src/tedi/components/filter/filter/filter.stories.tsx
  • src/tedi/components/filter/filter/filter.tsx
  • src/tedi/components/filter/filter/index.ts
  • src/tedi/components/form/search/search.tsx
  • src/tedi/components/overlays/dropdown/dropdown.module.scss
  • src/tedi/index.ts
  • src/tedi/providers/label-provider/labels-map.ts

Comment thread src/tedi/components/filter/filter/filter-group.tsx Outdated
Comment thread src/tedi/components/filter/filter/filter.tsx Outdated
Comment thread src/tedi/components/filter/filter/filter.tsx
Comment thread src/tedi/components/form/search/search.tsx Outdated
Comment thread src/tedi/components/overlays/dropdown/dropdown.module.scss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Filter]: New TEDI-Ready component

1 participant