Pager Feature #9
Labels
No Label
bug
compatibility
documentation
duplicate
enhancement
future release
help wanted
invalid
non-code
question
refactor
testing
this release
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cmccabe/linkulator2#9
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If a menu needs to display 500 links, let the user page through them at, say, 20 links per page.
I have been thinking about this one, working like:
An example would be that upon starting the application, the first 5 categories are shown because we calculate that only those 5 will fit. A command to view the next page can be used to show the next 5 categories.
Should items be numbered from 1 onwards each page? So each page shows 5 links, numbered 1 to 5. Or should the numbering continue on?
I think 1-5, 6-10, ..., is best because the user may want to back up, and the non-repeating numbers would be an indicator of how deep (far back) they've gone.
The one challenge I would see to the non-repeating numbers is if the application data were refreshed in mid-use, because that could throw off the sequence. Of course this is only a problem if there were many concurrent users of linkulator, which is not a problem now.
I'm not sure that would be a problem @cmccabe . Since an individual user using linkulator works off of an in memory version of the data. Realtime data would not be seen by them from the time they start the program.
Good point @sloum, I guess I was misremembering that the data reloaded when the user added a link. But actually, even if that were so, they would not be in the pager feature at that time, so it wouldn't matter.
Any new items - categories, links or replies - will be displayed in the client as soon as they are made. This is only for items you have added though, it doesn't currently check for things that other people might have added.
Having 1-5, then 5-10 and so on, does help with understanding page progression. On the down side, it means by page 3, choosing a link means pressing one more key.
We can try either way, probably starting with whichever is easiest.
I have a basic model of this in the pager branch. Menu screens will only print what currently fits in the terminal window, splitting contents to pages.
Navigation can be done between next and previous pages, as well as forward and back in the menu heirarchy (categories -> category details -> thread_details). I don't know that this works, and have found two axes of control a bit confusing.
This new implementation seems complicated so I'm looking to simplify it as much as possible.
edit: i don't think this is the right approach. it's a lot of page control mixed in with menu logic, mostly to avoid having to do lower-level terminal control. the actual experience seems a bit unweildy and I feel like scrolling through a list rather than changing pages would be more intuitive. Plus page changes use an escape code to clear the screen which messes with the user's terminal buffer.
going to think about #16 instead. seeing how rendering works in bombadillo makes me think curses or manual terminal control would be a much less complicated approach.
The pager branch now uses curses to display content. You can use it to view content only at the moment.
The controls are very similar to bombadillo:
j
/k
or up/down arrow to scroll a pageb
to go backq
to quit:
or space to open a prompt, where you can enter numbers to navigate or commands like q, quit, exit or whatever.Still a work in progress, a bit of a mess. It uses a big nested class thing for the menu so you end up with massive variable names. Need to think of nicer ways to handle this. Also this is my first time with curses, so am not entirely sure i have it right. Screen output is also similar to bombadillo as I wasn't sure how the curses scrolling was meant to work entirely.
Still working on this one, it's getting closer to being feature complete. Will be asking for some initial feedback.