A small UX improvement such that a browsers Back buttons maintain filtering.
See above.
When I have a number of changes to make to multiple Products I get quite annoyed. For large hubs this becomes unweildy quite quickly as there are often sizeable changes to make and I can't make them on the Products page.
bug-s4: it's annoying, but you can use it
Hi @lin-d-hop, I think this is related to this issue: https://github.com/openfoodfoundation/openfoodnetwork/issues/4338
This PR addresses the request in that issue https://github.com/openfoodfoundation/openfoodnetwork/pull/4342
I think ultimately not forcing a new window and maintaining the filter state when navigating back is a nicer solution - but I just wanted to alert you to the overlap in case you missed it.
I think ultimately not forcing a new window and maintaining the filter state when navigating back is a nicer solution
exactly @JacksonBates ! That's what I think too.
I think the solution for that is to have a URL so the browser can track filter changes as regular navigation and keep track of it in the browser history. I personally lean towards doing so in the backend rather than in the frontend using Angular JS routing (I have no experience with it). It feels less complex to implement. Thoughts? @luisramos0 @kristinalim @mkllnk @Matt-Yorkley
Also, this same filtering logic will need to be implemented in other pages as well.
Given @JacksonBates change, we might have bigger priorities than this one.
I'm wondering about the idea workflow here.
Now that I read again my proposal I see the problem you mention. If we implement that URL in the backend we require reloads and I understand it wouldn't be the best experience for the user. So perhaps is better on the frontend.
As for scenario 3 you mention. It feels to me like reinventing the wheel for something browsers already do and I'm afraid going down that path would bring in more maintenance costs.
I feel we need to be careful about this one. On other projects where the filters are kept I see lots of bugs happening and related to this need.
For example: how long are those filters kept? As long as the user doesn't leave the edit page? Disconnect?
In case of multiple tab open and filtering which tab has the correct info? The latest?
Another approach would be to open all products edit pages from the product list by righ-clicking on the edit button. It would save having to switch tabs as we do currently. But you would need to know that right-clicking opens in a new tab without switching to this new tab....
Last thing: the issue title is about the browser back button, and the issue about back buttons from our UI. Which is the correct scope: both?
If I am not mistaken, scenario 1 has been implemented.
Looking at this, the better solution would be something like Scenario 2 as proposed by @mkllnk but with the following steps :
Having the browser back button behave the same way would require to update the url when filter are applied on the product page, which I think should be doable.
I am going to look at this, unless anyone has any reservation ?
We can then apply the same solution for #4207
@rioug hello :) are you still working on this one?
@RachL yes still looking at this one. I didn't have time to work on it last week, but I will be later this week.
Quick update on this one, I have a working solution but I still need to clean up my code. I was hoping to finish this today but I am still leaning on how to navigate around the code base. I'll finish this next week.
As mentioned in the Pull Request, my proposed solution has some limitation:
On the product edit page, using any of the links under the "Product Details" will result in the filter parameters being lost.
This should be easily fix by passing the filter parameters around to the various page, I just want to make sure people are happy with the proposed solution before going around and fixing the issue.
Feel free to open a draft pull request so we can give feedback and see potential complexities @rioug
Sounds good, I started working fixing the limitations, I'll update when I have something ready.
So, I extended the solution for the various "product variants" pages, as you can see in this commit : https://github.com/rioug/openfoodnetwork/commit/b8b22ee8eae4c371964ecf33776e5e2c73dde7c2
I'll have to do the same for images, product properties, group buy options and search pages.
I am not a big fan on passing the parameters along, as they are not relevant to the various product related page. What do people think ? is it an acceptable solution ? our should we be looking at other alternatives ?
@sauloperez @luisramos0
Thanks a lot @rioug
You can move the PR to code review and we will have a look and provide feedback :+1:
I started working on extending the solution to the product related pages, as well as covering the changes suggested by Luis. Hopefully it won't take me too long to finish.
Done, I just updated the PR with my latest changes.