Skip to content

Conversation

@Gykes
Copy link
Collaborator

@Gykes Gykes commented Nov 12, 2025

This PR allows the user to use a customizable slider to filter by duration similar to PH.

Currently there are 5 presets as shown in the screenshot below. I have set the current max to 2 hours but this can be modified if we feel like it needs to be higher. Just a reminder, the higher on the max we go the "longer" the slider becomes. Makes it harder for users to make smaller adjustments using the slider.

The users can modify the time in 3 ways:

  1. use the slider to set their desired time up to a max of 2 hours
  2. edit the number fields in various ways that I will describe below
  3. use the filter presets
You type Interpreted as Displays as
10 10 minutes 10:00
5:30 5 min 30 sec 5:30
1:00:00 1 hour 1:00:00
90 90 minutes 1:30:00
max 2 hours+ max

As you can see there are various ways for the user to set their desired time.

Closes: #6263

UI:
Screenshot 2025-11-12 at 11-54-03 Scenes Stash

@Gykes Gykes self-assigned this Nov 12, 2025
@Gykes Gykes added feature Pull requests that add a new feature frontend needs testing Pull requests that require testing labels Nov 12, 2025
@feederbox826
Copy link
Collaborator

IMO the presets should be a bit wider range, will try to run a sample in stash for it 🤔

@WithoutPants
Copy link
Collaborator

Testing notes:

  • max should be replaced with the maximum range suffixed with +. ie if max range is 2 hours, it should be 2+ hrs or something
  • the slider needs a debounce before updating the filter
  • I do wonder whether we need 1 minute steps for the entire range. It seems like overkill.
  • slider doesn't update when the criterion is removed via the x in the filter tag
  • I think the styling on the min range marker could be better. It should probably just be styled in the same way as the max range marker

Pornhub uses 10 minute steps, up to a maximum of 40+ minutes. I think a max range of 2+ hours is good, but I think the steps could be better. Trying to set 0 - 2 minute range is pretty fiddly.

Having steps of 0, 2 minute, 5 minute, then 5 minute intervals is what I propose, but I'm happy to discuss it. It means that the steps won't be completely one-to-one given that first 2 minute step.

@Gykes
Copy link
Collaborator Author

Gykes commented Nov 13, 2025

  1. max should be replaced with the maximum range suffixed with +. ie if max range is 2 hours, it should be 2+ hrs or something
  • Fixed by making the max now say 2+ hrs
  1. the slider needs a debounce before updating the filter
  • I set it to 300ms
  1. I do wonder whether we need 1 minute steps for the entire range. It seems like overkill.
  • I changed the steps like you recommend 0,2,5
  1. slider doesn't update when the criterion is removed via the x in the filter tag
  • Fixed, added a useEffect hook to watch and reset when needed
  1. think the styling on the min range marker could be better. It should probably just be styled in the same way as the max range marker
  • I updated the styling to match more. However, and correct me if i'm wrong, there is a limitation on dual range sliders as the min and max need to be on seperate Z-Axis to function properly. This means that one is always going to appear lighter/further in the background. I also dont have much experience with CSS so perhaps someone with more knowledge can fix it up.

@feederbox826
Copy link
Collaborator

limitation on dual range sliders

IMO the end one should be on the higher Z index (front)

@Gykes
Copy link
Collaborator Author

Gykes commented Nov 13, 2025

limitation on dual range sliders

IMO the end one should be on the higher Z index (front)

Yea, the end is 3 and min is 1 iirc

@WithoutPants
Copy link
Collaborator

Very nice work. I managed to make the max slider track transparent so that the min thumb is more visible:

image

I also added left/right align to the min and max text inputs.

I separated out the slider control into a reusable component so that it can be reused in other things. Please update #6267 once this is merged to use the new component.

Finally, I changed the debounce implementation to use our specialised useDebounce hook.

@WithoutPants WithoutPants added this to the Version 0.30.0 milestone Nov 13, 2025
@feederbox826
Copy link
Collaborator

having a look now

Copy link
Collaborator

@feederbox826 feederbox826 left a comment

Choose a reason for hiding this comment

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

Not many scenes to test with, but one UX request would be make the un-selected range greyed out compared to the selected range being in blue

@WithoutPants
Copy link
Collaborator

WithoutPants commented Nov 13, 2025

Not many scenes to test with, but one UX request would be make the un-selected range greyed out compared to the selected range being in blue

Fair point. We would have to do away with using range inputs entirely to implement this though, as far as I can determine (Pornhub appear to do this with div, span and some styling). A simpler - albeit workaround - solution may be to make the slider track a more neutral colour instead of the primary blue color.

@WithoutPants WithoutPants merged commit e3b3fbb into stashapp:develop Nov 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Pull requests that add a new feature frontend needs testing Pull requests that require testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] Custom Duration Slider

3 participants