lukasschwab / stackit

StackOverflow queries from the command line
MIT License
314 stars 28 forks source link

reduce the question number to 4 and show the answer using less #17

Open eduOS opened 9 years ago

eduOS commented 9 years ago

Maybe 4 questions per page are enough. Using echo_via_pager I can view the entire answer and question, otherwise only the tail of the answer is shown always.

lukasschwab commented 9 years ago

@eduOS Thanks for the pull request!

I just kicked back into gear with this project, and I've been thinking hard about pagination. I think it's the most needed feature, and will probably warrant a 1.0.0 release if we can do it well.

I'm also looking at the echo_via_pager method, but I struggle somewhat with what it does to the interface (one that was designed without pagination in mind). The initial plan had two distinct interfaces (a "list view" of search results, and a "focus view" of one question in particular), both of which listen for user input (Enter m for more, a question number to select, or q to quit: or Enter b to launch browser, x to return to search, or q to quit:, respectively).

Your implementation is, I think, a really good start, and pagination is the right way to display this much information. The one struggle is associating commands with the proper context––you have to close a question before opening it in the browser, for example––and I'm not a big fan of how this fragments interaction with a given result.

As far as next steps go, I will look into how we can integrate pagination with minimal changes to the interface flow. @eduOS if you want to look into it, I think if there's a way we can listen for user input inside a pager (don't have to close a question to open in a browser, for example) that would be an ideal first step.

Next, we should look at how easy it would be to just build our own pager that will listen for user input. Could be a little annoying, and might have to go beyond Click's functionality (click.clear every time the user wants to view a new line would be bad), but would require minimal redesign.

Finally, there's a bigger question of whether the current UI flow is actually any good (hackathons are notoriously bad for this), and how we can do it better. Could be redesigned around using conventional pager.

Sorry this became such a mess, you just happen to have really good timing :smile: What do you think?

If you have an easy solution to any of the three steps here, feel free to update this pull request accordingly. This is a good place for the pagination conversation. Let me know if you want to put this down, I'll be happy to work from your start.