Skip to content

feat: add filter tags to data dictionary (#529)#536

Merged
NoopDog merged 1 commit into
mainfrom
fran/529-dd-filter-tags
Jun 18, 2025
Merged

feat: add filter tags to data dictionary (#529)#536
NoopDog merged 1 commit into
mainfrom
fran/529-dd-filter-tags

Conversation

@frano-m

@frano-m frano-m commented Jun 18, 2025

Copy link
Copy Markdown
Contributor

Closes #529.

This pull request introduces several updates to the DataDictionary component, focusing on layout adjustments, filter handling, and the addition of new reusable components. The changes aim to improve maintainability, simplify styles, and enhance user experience.

Layout and Spacing Updates:

Filter Handling Enhancements:

  • src/components/DataDictionary/hooks/UseMeasureFilters/hook.ts: Introduced a new hook, useMeasureFilters, to dynamically measure filter dimensions and update layout spacing accordingly. ([src/components/DataDictionary/hooks/UseMeasureFilters/hook.tsR1-R27](https://github.com/DataBiosphere/findable-ui/pull/536/files#diff-74979e6eb8a395908378523a335cd29b69b7014b12bab00d85b81cba2fec062eR1-R27))
  • src/components/DataDictionary/dataDictionary.tsx: Integrated the useMeasureFilters hook to adjust entity spacing based on filter dimensions and added fade animations for smoother transitions. ([[1]](https://github.com/DataBiosphere/findable-ui/pull/536/files#diff-b7171f2e8195fd9d15fa09d40aa102ece57386601f9fc46fecac60534af27723R36-R42), [[2]](https://github.com/DataBiosphere/findable-ui/pull/536/files#diff-b7171f2e8195fd9d15fa09d40aa102ece57386601f9fc46fecac60534af27723R51-R71))

New Components:

  • src/components/Filter/components/FilterCountChip/filterCountChip.tsx: Added a reusable FilterCountChip component for displaying filter counts with customizable styles. ([src/components/Filter/components/FilterCountChip/filterCountChip.tsxR1-R21](https://github.com/DataBiosphere/findable-ui/pull/536/files#diff-1615ba1f1e9d57171a779e09c4c105580eba091d665cc7d695afa7a30d0b9b18R1-R21))
  • src/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.tsx: Introduced ColumnFilterTags to display active column filters with a "Clear all" button for easy reset. ([src/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.tsxR1-R33](https://github.com/DataBiosphere/findable-ui/pull/536/files#diff-71b4afc5f0450278fd9eb3d6b5811961a2111c5d496f5a961b80b87036c6c1d4R1-R33))

Style Adjustments:

These changes collectively improve the usability and maintainability of the DataDictionary component while introducing reusable patterns for filter management and layout adjustments.

image

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.

Pull Request Overview

This pull request enhances the DataDictionary component by adjusting layouts, improving filter handling, and introducing reusable filter-related components. Key changes include refactoring layout components using forwardRef for better integration, integrating a new hook to measure filter dimensions, and adding a reusable FilterCountChip component.

Reviewed Changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/components/Table/components/TableFeatures/ColumnFilter/columnFilter.styles.ts Added conditional styling for the button when filters are open.
src/components/Filter/components/FilterCountChip/* Added a reusable chip component along with updated types, styles, and stories.
src/components/DataDictionary/hooks/UseMeasureFilters/* Introduced a hook to measure filter dimensions.
src/components/DataDictionary/dataDictionary.tsx Integrated new hook and fade animations based on measured heights.
src/components/DataDictionary/components/Layout/* Refactored layout components to use forwardRef and simplified spacing calculations.
Other files Minor style adjustments and constants updates to support layout and filter enhancements.

count,
...props /* MuiChipProps */
}: FilterCountChipProps): JSX.Element | null => {
if (!count) return null;

Copilot AI Jun 18, 2025

Copy link

Choose a reason for hiding this comment

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

Using '!count' may inadvertently skip rendering the chip when count is 0, which might be a valid value. Consider checking explicitly for null or undefined (e.g., count == null) to ensure 0 is displayed.

Suggested change
if (!count) return null;
if (count == null) return null;

Copilot uses AI. Check for mistakes.

@NoopDog NoopDog left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

💯

@NoopDog NoopDog merged commit 30c368d into main Jun 18, 2025
2 checks passed
@NoopDog NoopDog deleted the fran/529-dd-filter-tags branch July 8, 2025 05:28
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.

Add filter tags to data dictionary

3 participants