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

Avoid to always round the range in connectRange #2498

Merged
merged 10 commits into from
Oct 18, 2017

Conversation

samouss
Copy link
Contributor

@samouss samouss commented Oct 18, 2017

Summary

In the connectRange we always round the range even with a precision greater than 0. Now we round the range only for a precision of 0 and leave the original value in the other case.

Result

You can play with the RangeInput on dev-novel.

Before:

screen shot 2017-10-18 at 11 48 02

After:

screen shot 2017-10-18 at 11 40 49

@algobot
Copy link
Contributor

algobot commented Oct 18, 2017

Deploy preview ready!

Built with commit 9df4656

https://deploy-preview-2498--algolia-instantsearch.netlify.com

@@ -100,8 +100,8 @@ export default function connectRange(renderFn) {
}

return {
min: Math.floor(min),
max: Math.ceil(max),
min: precision === 0 ? Math.floor(min) : min,
Copy link
Contributor

@bobylito bobylito Oct 18, 2017

Choose a reason for hiding this comment

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

What does it mean for a precision of 1 and there 3 digits after the . or ,? Wouldn't it be more consistent if we were to apply the same logic based on precision?

Copy link
Contributor Author

@samouss samouss Oct 18, 2017

Choose a reason for hiding this comment

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

When I begin to implement it, I thought it was a bit overkill so I remove it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well Isn't the purpose to bring consistency? And in this case, we only have consistency for precision = 0, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

But then I might not have a good idea of the complexity...

Copy link
Contributor Author

@samouss samouss Oct 18, 2017

Choose a reason for hiding this comment

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

Right, I will update it 🙃

Copy link
Contributor

@bobylito bobylito left a comment

Choose a reason for hiding this comment

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

👍 🎉 💃

@bobylito bobylito merged commit d4df45d into feat/2.3 Oct 18, 2017
@bobylito bobylito deleted the fix/connect-range-floor-range branch October 18, 2017 14:46
iam4x added a commit that referenced this pull request Oct 24, 2017
<a name=2.3.0-beta.2></a>
# [2.3.0-beta.2](v2.2.1...v2.3.0-beta.2) (2017-10-24)

### Bug Fixes

* **connectHierarchicalMenu:** do not return if facet not set ([#2521](#2521)) ([26e99fb](26e99fb))
* **MenuSelect:** switch from react to preact-compat ([#2513](#2513)) ([06aa626](06aa626))
* **range-slider:** add option  ([#2502](#2502)) ([e78399d](e78399d)), closes [#2501](#2501)

### Features

* **breadcrumb:** Add the breadcrumb widget ([#2451](#2451)) ([11d78f0](11d78f0)), closes [#2299](#2299)
* **connectRange:** round the range based on precision ([#2498](#2498)) ([d4df45d](d4df45d))
* **rangeInput:** add rangeInput widget ([#2440](#2440)) ([7916d16](7916d16))
bobylito pushed a commit that referenced this pull request Nov 13, 2017
<a name=2.3.0-beta.4></a>
# [2.3.0-beta.4](v2.2.4...v2.3.0-beta.4) (2017-11-13)

### Features

* **core:** InstantSearch hot remove/add widgets ([#2384](#2384)) ([cfc1710](cfc1710))

<a name=2.3.0-beta.3></a>
# [2.3.0-beta.3](v2.3.0-beta.2...v2.3.0-beta.3) (2017-10-25)

### Bug Fixes

* **connectors:** export  as well ([0b78d75](0b78d75))

### Features

* **refinementList:** add escapeFacetHits parameter ([#2507](#2507)) ([9b1b7ee](9b1b7ee))

<a name=2.3.0-beta.2></a>
# [2.3.0-beta.2](v2.2.1...v2.3.0-beta.2) (2017-10-24)

### Bug Fixes

* **connectHierarchicalMenu:** do not return if facet not set ([#2521](#2521)) ([26e99fb](26e99fb))

### Features

* **breadcrumb:** Add the breadcrumb widget ([#2451](#2451)) ([11d78f0](11d78f0)), closes [#2299](#2299)
* **connectRange:** round the range based on precision ([#2498](#2498)) ([d4df45d](d4df45d))
* **rangeInput:** add rangeInput widget ([#2440](#2440)) ([7916d16](7916d16))
bobylito pushed a commit that referenced this pull request Nov 16, 2017
<a name=2.3.0-beta.5></a>
# [2.3.0-beta.5](v2.2.4...v2.3.0-beta.5) (2017-11-16)

### Features

* **core:** InstantSearch hot remove/add widgets ([#2384](#2384)) ([cfc1710](cfc1710))

<a name=2.3.0-beta.3></a>
# [2.3.0-beta.3](v2.3.0-beta.2...v2.3.0-beta.3) (2017-10-25)

### Bug Fixes

* **connectors:** export  as well ([0b78d75](0b78d75))

### Features

* **refinementList:** add escapeFacetHits parameter ([#2507](#2507)) ([9b1b7ee](9b1b7ee))

<a name=2.3.0-beta.2></a>
# [2.3.0-beta.2](v2.2.1...v2.3.0-beta.2) (2017-10-24)

### Bug Fixes

* **connectHierarchicalMenu:** do not return if facet not set ([#2521](#2521)) ([26e99fb](26e99fb))

### Features

* **breadcrumb:** Add the breadcrumb widget ([#2451](#2451)) ([11d78f0](11d78f0)), closes [#2299](#2299)
* **connectRange:** round the range based on precision ([#2498](#2498)) ([d4df45d](d4df45d))
* **rangeInput:** add rangeInput widget ([#2440](#2440)) ([7916d16](7916d16))
bobylito pushed a commit that referenced this pull request Nov 20, 2017
<a name=2.3.0-beta.7></a>
# [2.3.0-beta.7](v2.2.5...v2.3.0-beta.7) (2017-11-20)

<a name=2.3.0-beta.6></a>
# [2.3.0-beta.6](v2.3.0-beta.5...v2.3.0-beta.6) (2017-11-16)

### Bug Fixes

* **connectors:** prefer wrappers over bind ([#2575](#2575)) ([f8e0e00](f8e0e00))

<a name=2.3.0-beta.5></a>
# [2.3.0-beta.5](v2.2.4...v2.3.0-beta.5) (2017-11-16)

### Features

* **core:** InstantSearch hot remove/add widgets ([#2384](#2384)) ([cfc1710](cfc1710))

<a name=2.3.0-beta.3></a>
# [2.3.0-beta.3](v2.3.0-beta.2...v2.3.0-beta.3) (2017-10-25)

### Bug Fixes

* **connectors:** export  as well ([0b78d75](0b78d75))

### Features

* **refinementList:** add escapeFacetHits parameter ([#2507](#2507)) ([9b1b7ee](9b1b7ee))

<a name=2.3.0-beta.2></a>
# [2.3.0-beta.2](v2.2.1...v2.3.0-beta.2) (2017-10-24)

### Bug Fixes

* **connectHierarchicalMenu:** do not return if facet not set ([#2521](#2521)) ([26e99fb](26e99fb))

### Features

* **breadcrumb:** Add the breadcrumb widget ([#2451](#2451)) ([11d78f0](11d78f0)), closes [#2299](#2299)
* **connectRange:** round the range based on precision ([#2498](#2498)) ([d4df45d](d4df45d))
* **rangeInput:** add rangeInput widget ([#2440](#2440)) ([7916d16](7916d16))
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.

4 participants