-
-
Notifications
You must be signed in to change notification settings - Fork 827
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
Default Filter for Links & Details #4036
Conversation
Well, it looks like it slows down the main page for me pretty hefty when opened first. Everything else is performant, I think it has something to do with cache getting confused? All the long taking parts are from index.js... I really don't know how to debug this, its javascript and not a rendering issue, any ideas? EDIT: The only Information I am pretty sure about is that it depends on the amount of elements on the start page, they seem to sequentially start something and take about two seconds on my not too shabby laptop. For 8 Elements thats 16 seconds of freezing after everything is rendered. |
As adressed in Discord, I will put this on hold until the saved_filter refactor is done either by me or WithoutPants, as I'm pretty sure that this problem will not persist if the according filters are not catched from graphql and distributed by apollo, but simply fetched and saved at app start together with the rest of the settings. From there I can fetch the contexts without useeffect, useref or similar asynchronous stuff... |
I think the approach described here is probably not the correct one. For sub-page views, the default filtering and view options should be persisted in the UI options - they aren't relevant elsewhere, and utilising the default filter is the incorrect approach. This should address all of the related issues. The clickable tags is a separate issue and should be addressed in separate PR. However, I don't think that we should use the default filter for these either. For the clickable tags, I think the better approach is to modify the current filter to add whatever was clicked. For example, you are viewing scenes with a filter set to only show from studio |
@WithoutPants Ok, I can do that, however for both scenarios I still have a question/issue before I can do that. Sub-Pages View: Should this then be made an option in the options->Interface Panel? If so, how would it look like? Thing is, while you could give a drop-down of existing filters there, again I can't see the advantage over taking simply the default filter, beside being customizable (which again, I can't really think of an scenario where you wouldn't expect your default view to be applied). Or do you want it to be a button in the filter drop-down, like the "set default"? Maybe there is something I'm missing? Clickable Tags: Sounds interesting, but is not really easy implement that way and by itself very incomplete. For example, no (additional) filter, and therefore no view, would be set this way when coming from the start page, when clicking in the scene details page on galleries associated with performer etc. Sorry if I got something wrong, but while I'm willing to adjust the strategy, I'm just not sure that these proposals are going in the right direction. |
As mentioned in #2573 - the Default Filter in its current incarnation determines only what is displayed initially when the user clicks on the applicable top-level link - Scenes, Movies etc. I don't think it's expected or desired that whatever that initial view is is applied to sub-page views. For example, my current default filter for scenes is for rating > x, and sorted randomly. This would not be a desirable filter to apply to sub-page views. In the past, the sub-page view options would be persisted at least in the browser, so that at least the views would be consistent when navigating to different performer pages, for example. I notice that this is not currently the case - except for galleries which appear to at least persist the view mode. If there's a desire for default view options and filtering applied to sub-pages, then I think it needs to be developed in concert with, or followed by the changes described here: #3880 (comment). Otherwise, we'd need to undo the filter hook adjustments when saving the filter. In terms of how I'd see this working: I think something similar to how it works in the top-level views is probably fine. Instead of saving the default filter, it would save a default filter for the applicable sub-page view in the UI settings. I do think this will be non-trivial to accomplish with the way that the item lists are structured currently, and there probably needs to be a refactor of the item list code first. |
It is not intended to use the default filter filters at all. Only the view options (grid/wall/list, Sorting Order, zoom) are applied, because I agree that an additional, default filter would render many subpage views then useless by default. However, for example, if you approach your scenes randomly by default (even if you use it together with another filter per default), you'd probably appreciate being presented with an everchanging order in the subpage view as well (however, the gallery page is taken out precisely because of this, here a separate structure according to the gallery would be expected). To be honest, I think this part is the more debatable, while I would say that this is an expected behavior, I find the view mode (wall/grid) to be more distracting than the sorting if not taken from the default, so we could also restrict it to that... The Problem with this way of doing it is that I simply can't think of a way to present this option in a way that is intuitively understandable. I think this problem is on its own something that can be felt as wrong (as the different issues seem to highlight), which is why I think we should at the very least have a better default behavior, with maybe the option to adjust it on your own, so that whats happening is what is expected intuitively. It just feels like bad design to adjust your views to a default so the data is presented in a pleasing way, clicking on a link and having all of this ignored, the same for subpages. |
#4137 is another candidate to be closed with that. |
…he code around that
… filter, UI Only option, cleanup
@WithoutPants Alright, lets try again. I have fixed the performance issues and bugs I encountered along the way, so from my point of view this is ready for review again. |
…Filter, fixed that
I don't think most people would understand the difference between "default for link" and "default for site". I'm not sure this is the best approach.
Again, this is a piece of UI that needs an extensive explanation that I'm not sure people would understand. If this route is chosen there needs to be an easy way to see what content is negatively impacted by the filter, so the user can revert the change if they want to. What about setting these details-level options in the Interface settings, and providing similar context (with long explanations, if necessary) there? |
@sleetx I agree that a better explanation would be a good addition. Not quite sure how to explain it though, probably because I'm too deep in the technicalities... I'd appreciate feedback here greatly. It is not placed in the settings because realizing it there would be even more convoluted: You'd need a way to apply filters, search terms, sorting and view options in the settings view, once for every view, and you wouldn't get any feedback on what this view might include and how it looks like. So I don't think that this would be helpful, as the settings of default always had the advantage that you could anticipate what you could expect. Although a further filter will be added in subview/link, this is, generally speaking, still the case. |
The two "Set default" buttons is pretty confusing, and I'm not clear on why exactly they would be needed. It seems like the simpler method would be to just go with the more specific option (the one that will be applied in the most limited/restricted scenario). This means the user might have to apply the default multiple times in several places, but how often would people be changing the default? It's a bit more work when you do want to change it everywhere, but it avoids the confusion of having two options and would avoid the frustration of accidentally applying a filter somewhere you don't actually want it. |
@WeedLordVegeta420 I started out with one button doing both, but that was not how @WithoutPants liked it. |
I've hacked together a proof of concept - modified from your branch - of my preferred approach for the default filter for sub-views functionality. Note that the link behaviour stuff is not included here; as stated, that behaviour should be separated into another PR. I believe that, instead of adding the default filter to every single link, a better approach would be to add a parameter to the link to load and append the default filter, and this can be handled in the URL parsing code. https://github.com/WithoutPants/stash/tree/prs/4036 It adds default filters for each view in the system. We don't want to store these in the There are a few things that need to be addressed elsewhere before this can go through however. It is becoming increasingly apparent that the UI settings are becoming ungainly, and working with viper is a tremendous pain due to the way it mangles object keys. I think we need to change where the UI settings are saved. A possibility is a separate file, but I'm leaning more towards a database table. This could eventually hold user preferences. The other major hang up is the way that the sub-views add criteria to the filter. In the PoC, it's not stripping these out, so they get saved in the default filter. Obviously needs to be addressed, but it might need refactoring of the item list code to not end up doing it in a hacky way. |
EDIT: @WithoutPants Thanks for your effort! I can think of three solutions here:
Of course I tend to the first one, especially as the problems there seem to be the only ones that can be ironed out completely, while the others lock us in a certain design. If you have another solution or an addition we can of course also go another route. |
@WithoutPants Alright, sorry for the WoT, now the filter from subviews is removed by default. I used the filterhooks that add the according subviewfilter to determine and remove all view-set subviewfilters. It is written to be broadly compatible with more complex filters to be excluded as well. Thank you again for your help, I will look into the link setting in a different PR. |
f7176ee
to
0799769
Compare
There hasn't been any movement here in the last 8 months. It still resolves a much requested problem. Could this request therefore be reevaluated for implementation? |
I have a branch of work that adapts the work in this branch. I plan to get it into 0.27 and will close this PR when I submit my own. |
Awesome, thanks for the heads up! |
Closing in favour of #4962 |
This Commit is aiming at the fact that the saved default filter is not taken into consideration outside of the main page its associated with. This is specifically relevant for two types of scenarios, and both are adressed in this commit:
The details page of Performer, Tag or Studio
Links provided from Cards of all kinds in all places, as well as clickable tags
Both right now will give you the view stash delivers as default, combined with the associated filter. This commit reads the default filter of the according type and applies all view-related settings (this means further filters from default as well as searchterms are ignored).
This seems to me much more intuitive, and it has been requested in several ways multiple times from what I can tell:
#4010 #3079 #2573 #1938
However, it was far more complicated than anticipated, if someone more adapt with react sees a way to streamline this more I would be open for that, although I think this solution is not really bad, its just a bit widespread in the code...
I have tested several scenarios and they all work, however we are talking about dozends of scenarios so anyone willing to test it further is welcomed.
Lastly, this commit changes the behavior of stash in a not insignificant way. This raises the question whether it should be made optional. I personally don't think this is necessary, as I cannot think of a user that would not expect the sorting and viewtype (grid/wall) to be identical in details pages, the default main page and when clicking on a tag or other link to a filtered view. But maybe I'm just lacking imagination here.