Open rafaelrinaldi opened 8 years ago
Let me ask you something, i can't see any flags or variables which control the visited items, do you think if we can implement a key named visited:boolean
which controls the behaviour of each entry?
Another idea is on keypress
event, we may change text of the selected node. Maybe it should work, but i have a concern if user add the option --keep-alive
, when the display update, we may lose all visited entries.
@erickbelfy Yeah, we currently have no way to tell what item was previously visited but I was thinking about a flag on the cache
object or even an array with the id of visited items. Not sure. Just keep in mind that the data should be immutable and we should try to avoid local state at all costs. Object.assign()
can be our friend :+1:
Also, the feature should behave the same either or not the user runs the program with --keep-open
.
I also am not sure about the UI. As I said, maybe a bullet •
or even a text underline should do it. We shouldn't rely on colors though, since I want to support non xterm-256
users as well.
@erickbelfy Also, we can even add a feature to persist read items in the future :bulb:
Hey @rafaelrinaldi I would like to ask you something, you've mentioned about avoid local state at all costs, and use the cache
object to store the visited items, do you think about use a package , like node-cache
or you suggest use the cache API
Having previously visited stories marked as read would be nice. Maybe a symbol or even through text decoration should do it.