HomeKitty icon indicating copy to clipboard operation
HomeKitty copied to clipboard

Create search filters

Open BalestraPatrick opened this issue 6 years ago • 7 comments

Since in the current database we only keep track of the price of each accessory in USD, we could start by creating a filter by pricing. The user should be able to filter for a price range. It could behave similar to the Airbnb price slider.

In the future, we may be able to add multiple currencies or maybe each accessory could contain the supported countries. Let's keep this in mind so that maybe we can reuse this filter feature even in that case. 4a62647ed2059d53102de2207f889105

BalestraPatrick avatar Sep 28 '17 06:09 BalestraPatrick

For the first version of the filters feature, we could simply have an advanced search that allows to sort by price, released date and availability.

BalestraPatrick avatar Oct 05 '17 09:10 BalestraPatrick

This is still to be done. The first step may be to simply have an "Advanced Search" page (with a button just below the current search text field in the sidebar) where we have some sliders regarding the price and some simple checkboxes to let users filter based on AirPlay 2 support, requirement of a bridge, availability and region of availability. The search results would be displayed in the same page as the current version.

BalestraPatrick avatar Jul 28 '18 17:07 BalestraPatrick

The accessory price should be changed from String to Double for better better search on price

kimdv avatar Aug 23 '18 06:08 kimdv

Yes, I agree. Right now in the production DB we also have some accessories which don't have a price yet but we still want to display, so we could transform it like this:

  • Price is -1, display N/A.
  • Price is a number different than -1, display it with the $ in front, so $29.99.

We could first do this change, deploy to staging and production and start building the feature.

BalestraPatrick avatar Aug 23 '18 06:08 BalestraPatrick

I don't like the idea of "no price" == -1. I actually prefer to have NULL.

If persons want items between 0 and 100 dollars it is more performant to do

select items where item.price < 100 than select items where item.price < 100 && item.price >= 0

kimdv avatar Aug 23 '18 07:08 kimdv

Sure, that is also a possibility, we just need to make sure to update the contribution form too then 👍

BalestraPatrick avatar Aug 23 '18 07:08 BalestraPatrick

Sure! Let's start with staging and get some experience there

kimdv avatar Aug 23 '18 07:08 kimdv