Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/standardize property filters #71

Merged
merged 10 commits into from
Mar 26, 2024

Conversation

aswallace
Copy link
Contributor

@aswallace aswallace commented Mar 20, 2024

Description of Changes

This moves the file properties that were previously in the FileMetadataSearchBar into the filter side bar to make their behavior/appearance more consistent with the other annotation filters. 3 new filter form types are also added: date range, regular numerical range, and a search box. The search box is primarily intended for text-type annotations that can't provide selectable values from the file explorer API (e.g., file name, file path). I also left the ListPicker component in place for numerical/date annotations where there are few enough options that it's not significantly easier to use a range.

Also removed the FileMetadataSearchBar from the UI and deleted the component + its tests

How to Review

Aside from the new form components, the changes are mostly to annotation and filter logic -- mainly, when file properties are included as part of the annotation lists and when they aren't. My main concern is how extensible this solution will be (especially for Sean's csv work), since it's still pretty specific and hardcoded to handling file properties.

Testing

Tested manually and with unit tests.

Screenshots of new UI components

Search box filter
Search box filter

Numerical range filter
Numerical range filter

Date range filter
Date range filter

closes #54

packages/core/components/DateRangePicker/index.tsx Outdated Show resolved Hide resolved
packages/core/components/FileMetadataSearchBar/index.tsx Outdated Show resolved Hide resolved
packages/core/components/RangePicker/index.tsx Outdated Show resolved Hide resolved
packages/core/components/RangePicker/index.tsx Outdated Show resolved Hide resolved
packages/core/components/AnnotationFilterForm/index.tsx Outdated Show resolved Hide resolved
packages/core/components/AnnotationFilterForm/index.tsx Outdated Show resolved Hide resolved
packages/core/components/SearchBoxForm/index.tsx Outdated Show resolved Hide resolved
packages/core/components/RangePicker/index.tsx Outdated Show resolved Hide resolved
@SeanLeRoy
Copy link
Contributor

So excited for this!

My main concern is how extensible this solution will be (especially for Sean's csv work), since it's still pretty specific and hardcoded to handling file properties.

This seems fine! I think what would be ideal here is to have this get approved and merged into main then I'll build a branch off this work that wraps up the conversion of file properties into generic annotations. Generally we should be okay special casing the display of top level file properties and their filtering options, but should opt towards making their filtering and overall inclusion to the metadata blocks of state as blended as possible.

@aswallace aswallace requested a review from SeanLeRoy March 25, 2024 17:58
Copy link
Contributor

@pgarrison pgarrison left a comment

Choose a reason for hiding this comment

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

Looks good!

packages/core/components/AnnotationFilterForm/index.tsx Outdated Show resolved Hide resolved
packages/core/state/metadata/selectors.ts Outdated Show resolved Hide resolved
extractValuesFromRangeOperatorFilterString(currentRange?.value).minValue ?? overallMin
);
const [searchMaxValue, setSearchMaxValue] = React.useState(
extractValuesFromRangeOperatorFilterString(currentRange?.value).maxValue ?? overallMax
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like it would be nice if FileFilter could store a Range object with min and max fields instead of just a string, but that's probably beyond the scope of this PR

/* display: none; <- Crashes Chrome on hover */
-webkit-appearance: none;
margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be great to see screenshots to review changes with substantial CSS work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will add! In this case though this is just re-use of other css modules elsewhere in the codebase

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added screenshots to PR description!

@aswallace aswallace merged commit e343558 into master Mar 26, 2024
3 checks passed
@aswallace aswallace deleted the feature/standardize-property-filters branch March 26, 2024 18:35
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.

Make file property filters more normal
3 participants