{"action":"created","issue":{"url":"https://api.github.com/repos/algolia/instantsearch.js/issues/1360","repository_url":"https://api.github.com/repos/algolia/instantsearch.js","labels_url":"https://api.github.com/repos/algolia/instantsearch.js/issues/1360/labels{/name}","comments_url":"https://api.github.com/repos/algolia/instantsearch.js/issues/1360/comments","events_url":"https://api.github.com/repos/algolia/instantsearch.js/issues/1360/events","html_url":"https://github.com/algolia/instantsearch.js/pull/1360","id":180137772,"number":1360,"title":"fix(pagination): reset on other filter + no toggle","user":{"login":"bobylito","id":393765,"avatar_url":"https://avatars.githubusercontent.com/u/393765?v=3","gravatar_id":"","url":"https://api.github.com/users/bobylito","html_url":"https://github.com/bobylito","followers_url":"https://api.github.com/users/bobylito/followers","following_url":"https://api.github.com/users/bobylito/following{/other_user}","gists_url":"https://api.github.com/users/bobylito/gists{/gist_id}","starred_url":"https://api.github.com/users/bobylito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobylito/subscriptions","organizations_url":"https://api.github.com/users/bobylito/orgs","repos_url":"https://api.github.com/users/bobylito/repos","events_url":"https://api.github.com/users/bobylito/events{/privacy}","received_events_url":"https://api.github.com/users/bobylito/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-09-29T19:18:00Z","updated_at":"2016-09-30T15:34:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/algolia/instantsearch.js/pulls/1360","html_url":"https://github.com/algolia/instantsearch.js/pull/1360","diff_url":"https://github.com/algolia/instantsearch.js/pull/1360.diff","patch_url":"https://github.com/algolia/instantsearch.js/pull/1360.patch"},"body":"The bug is caused by the use of two conflicting semantics\r\nwith the same set of changes. Previously we had \"if the value for the\r\npage, reset the page number\", which led to reseting the pager to 0\r\nif we were selecting the same page (the toggle effect). I previously\r\nremoved this behaviour, but it introduced the impossibility to reset\r\nthe pager to 0 when changing any other filter (setting the value was\r\nthe trigger).\r\n\r\nIn order to fix this issue I introduce a new type of value to\r\nexpress the intent of using the same value without changing the page.\r\nThis way we have two distinctly defined intents and values:\r\n - same value as numbers -> reset to 0\r\n - value with isSamePage flag -> change to page value\r\n\r\nIt relies on `valuesOf`, which is not that nice and introduces the use\r\nof the dreaded `==`. At least, I can say that I found a legit use case\r\nfor it. Bottom line, I'm open to suggestion here :)"},"comment":{"url":"https://api.github.com/repos/algolia/instantsearch.js/issues/comments/250776555","html_url":"https://github.com/algolia/instantsearch.js/pull/1360#issuecomment-250776555","issue_url":"https://api.github.com/repos/algolia/instantsearch.js/issues/1360","id":250776555,"user":{"login":"vvo","id":123822,"avatar_url":"https://avatars.githubusercontent.com/u/123822?v=3","gravatar_id":"","url":"https://api.github.com/users/vvo","html_url":"https://github.com/vvo","followers_url":"https://api.github.com/users/vvo/followers","following_url":"https://api.github.com/users/vvo/following{/other_user}","gists_url":"https://api.github.com/users/vvo/gists{/gist_id}","starred_url":"https://api.github.com/users/vvo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvo/subscriptions","organizations_url":"https://api.github.com/users/vvo/orgs","repos_url":"https://api.github.com/users/vvo/repos","events_url":"https://api.github.com/users/vvo/events{/privacy}","received_events_url":"https://api.github.com/users/vvo/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T15:34:36Z","updated_at":"2016-09-30T15:34:36Z","body":"reading the PR and the previous implementation I wonder if we are going the right direction.\r\n\r\nBasically the need is to reset page to 0 on most refines. So why would the pagination widget be responsible for that? This circles back to how the helper does it to me.\r\n\r\nWhat if the various widgets were made responsible for the page to show and not the pagination connector itself.\r\n\r\nWouldn't it make things obvious and remove the need for \"transitionState\" API (which only exists because of that page: 0 need). Not very DRY but explicit and simple, before we find a good API to express that (if there's the need, I am not sure)."}}
{"actor":{"display_login":"vvo"}}