File picker freezes in a directory with too many entries
Closed this issue · 2 comments
MinecraftPublisher commented
Describe the bug
File picker freezes in a directory with too many entries
To Reproduce
Steps to reproduce the behavior:
- Make a folder or if you already have a qualifying one skip to step 3
- Populate the said folder with a shit ton of files and folders
- Set current directory to the folder from step 1
- Now try to navigate it and enjoy the freezes!
Bonus: If you try this but the step 1 folder is actually ..
, The app will actually freeze.
Expected behavior
No freezing! It would be lovely.
Solutions:
- Do not re-render the screen each time a choice is made (if this is being done)
- Slice the choices array to
[start: MAX(0, i - 20), end: MIN(choices.length, i + 20)]
to limit visible choices at any time to 41 (best option)
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. Linux Mint]
- Version [e.g. v1.0.3] (tip: open the settings in GriddyCode to check)
MinecraftPublisher commented
Alright