SvenWerlen / moulinette-tiles

Moulinette Forge submodule which provides capabilities for importing and managing tiles
https://www.patreon.com/moulinette
MIT License
2 stars 4 forks source link

using search is permanently limiting number of results #4

Closed TPlemur closed 3 years ago

TPlemur commented 3 years ago

I am going to start by saying that this module is amazing. on to the bug: When I first installed the moulinette suit if I went into one of my asset packs and scrolled down it would load a new set of images every time I reached the bottom. However I used one search query and now scrolling to the bottom of the assets causes nothing to happen. Details: moulinette installed though foundry's module handler, URL links to this GitHub server is run on a Linux box, connected to through LAN from windows 10 foundry version: 0.7.9 I have about 28000 images in around 15 packs (largest is 8000) no errors in the console, only "Foundry VTT | Rendering MoulinetteForge" when launching the forge

things that do not solve the issue: re-indexing the tiles reloading the page reloading the world restarting the server removing and re-adding the moulinette suit removing all modules other than moulinette

I have looked around for some config or setting, but I can't find anything. Let me know if you have any other questions and I will answer to the best of my ability.

Edit: I just noticed, but resizing the moulinette forge window seems to fix the issue. It consistently will not load more assets if it is more than 6 assets wide, but does not consistently load more below that. The narrower the window the more consistent it is though.

TPlemur commented 3 years ago

I no longer seem able to replicate this bug

SvenWerlen commented 3 years ago

This might be related to the browser. The logic behind the lazy loading is based on calculating if the scrollbar reached the end. It could happen that browser react differently depending on size.

Can I close this issue or is there something I should investigate?

TPlemur commented 3 years ago

Given that it seems to be an intermittent bug I would close the issue.

brother-oak commented 3 years ago

I seem to have this issue when using Moulinette. I think I always have (I thought it was a feature!). I use Moulinette locally, using the Foundry app. Whenever I do a search, it only displays a limited number of results (I think it seems to stop at 100). When I scroll to the bottom of this list, nothing happens - no more results are displayed. I have tested this with the latest version and it always happens. It also happens if I connect via a browser (rather than directly in the app). There are no errors in the console.

brother-oak commented 3 years ago

Given your comment above that the lazy loading is based on the scrollbar reaching the end, I played around a bit...

I seem to be able to force it to load more images if I resize the moulinette search window (it only resizes in the horizontal direction, not in the vertical, but that's ok).

So if I search (or select a pack with, say 200) images in the tile browser, it displays only 100 images and wont display more. By default it seems to be showing 8 images in each row. If I resize to, say, show 6 images in a row, it makes no difference - it still shows only the first 100 results. If however, I make it narrower, so it displays 5 images per row, it then displays all 200 images.

I have to resize the window each time I invoke it, as its width setting doesn't persist and when I bring the search window up again the problem of limiting images is still there.

Further playing shows that it seems to be a little variable how narrow I need to make the window for it to start working - with a different asset pack it DID work when I narrowed it to show 6 per row. It also worked when expanding to show 9 per row.

FWIW I am running on Windows 10. in 1920 x 1200 resolution, but have tested it at higher resolutions (my display is 3000x2000 but I run in lower resolution when using Foundry for performance reasons!) and the problem still occurs

SvenWerlen commented 3 years ago

Ok, I'll need to improve this behavior. When I implemented it, I saw people mentioning that browsers behave differently and the logic to check if scrollbar reached the bottom might not work for all. I guess, I'll have to detect if scrollbar is at ~90% down rather than 100%. Unfortunately, it's more complicated to implement because I must avoid that it gets triggered multiple times (91%, 92%, ...) as you keep scrolling down.

SvenWerlen commented 3 years ago

Version v-1.6.3 should fix this. Moulinette now loads another 100 results when the scrollbar reaches almost the bottom (-20px). Even if your browser doesn't return the right position, this offset should make it. Let me know if this is the case, such I can close the issue.

brother-oak commented 3 years ago

Works for me now (1.6.3). Many thanks!!

SvenWerlen commented 3 years ago

Great! Happy that it fixes it