antfu-collective / taze

🥦 A modern cli tool that keeps your deps fresh
MIT License
2.83k stars 86 forks source link

feat: make long list scrollable for interactive mode #89

Closed a1mersnow closed 11 months ago

a1mersnow commented 11 months ago

Description

In interactive mode, if our terminal is too short or our deps are too many, we cannot see all deps. When we use arrow keys to move the selection, the user experience is not good. Especially, when the selection is in the start part, everytime I move the selection, the terminal just scroll back to the bottom, and I can't see the selection anymore. So I have to drag to enlarge the terminal area. But what if our deps are so many that whole screen cannot embrace them or we just don't want to do the drag.

So I made the pr. The method I use is: only render a part of output lines if there is no enough space.

Linked Issues

There is no issue about this now. Feel free to reject this if you consider it not appropriate.

antfu commented 11 months ago

Awesome, thanks!