feat: add filter tags to data dictionary (#529)#536
Merged
Conversation
Contributor
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #529.
This pull request introduces several updates to the
DataDictionarycomponent, 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:
src/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.ts: Simplified the top padding calculation by removing the dependency on constants likeTITLE_HEIGHTandFILTERS_HEIGHT. ([src/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.tsL8-R13](https://github.com/DataBiosphere/findable-ui/pull/536/files#diff-f3e827a591f228340594a3b2c5cfc8b44384fe6007ad09b30d9e805c06c0fa09L8-R13))src/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.tsx: RefactoredEntitiesLayoutto useforwardReffor better integration with parent components and added support forspacingprops. ([src/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.tsxL1-R16](https://github.com/DataBiosphere/findable-ui/pull/536/files#diff-8fe669c46d496bbde05826f77728283e1cc10c33857369559b19d9329f2a97adL1-R16))src/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.styles.ts: Added a grid layout with a gap of12pxfor better spacing between filters. ([src/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.styles.tsR14-R15](https://github.com/DataBiosphere/findable-ui/pull/536/files#diff-6d6fecfa620cc0d7fdf58c38b6c0584afd309de352f2c59070d13ac0d822e68bR14-R15))src/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.tsx: RefactoredFiltersLayoutto useforwardReffor consistent styling and integration. ([src/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.tsxL1-R16](https://github.com/DataBiosphere/findable-ui/pull/536/files#diff-f58e40f044692d7f6246e284eefa75c0e4b1e965539c9f4c070d550c52e8efb1L1-R16))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 theuseMeasureFiltershook 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 reusableFilterCountChipcomponent 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: IntroducedColumnFilterTagsto 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:
src/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.styles.ts: Added styles forStyledGridto ensure proper spacing for filter tags. ([src/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.styles.tsR1-R8](https://github.com/DataBiosphere/findable-ui/pull/536/files#diff-2f7e3047fec11845737a29d2f2eb9f924d9c7968c50a01f31af4cb39dab410edR1-R8))src/components/Table/components/TableFeatures/ColumnFilter/columnFilter.styles.ts: Updated button styles to indicate active states when filters are open. ([src/components/Table/components/TableFeatures/ColumnFilter/columnFilter.styles.tsR1-R33](https://github.com/DataBiosphere/findable-ui/pull/536/files#diff-c5f5148e401bd71f0230c3afffd22130e660e5ed9499c04907061c5106b47717R1-R33))These changes collectively improve the usability and maintainability of the
DataDictionarycomponent while introducing reusable patterns for filter management and layout adjustments.