face-hh/griddycode

File picker freezes in a directory with too many entries

Closed this issue · 2 comments

Describe the bug
File picker freezes in a directory with too many entries

To Reproduce
Steps to reproduce the behavior:

  1. Make a folder or if you already have a qualifying one skip to step 3
  2. Populate the said folder with a shit ton of files and folders
  3. Set current directory to the folder from step 1
  4. 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:

  1. Do not re-render the screen each time a choice is made (if this is being done)
  2. 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)

Duplicate of #8