Issue generated from Tuleap's migration script.
Originally submitted by: Jerome Oufella (jero)
It has been common and quite standard in many chat clients (and in unix terminals) being able to clear the screen using the Ctrl-L key combo. It would be nice having that feature in the RING chat view, as there is no easy way to hide the viewable portion of the chat log.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
How should this be imlemented in terms of its effect on the actual chat history? Right now all chat is saved in JSON format locally. And we (try) to load each conversation in its entirety when clicking on contact. Should clearing the chat clear it for the rest of the session (and then load it next time Ring is opened). Should the history not be loaded (displayed) at all, or only the last few messages by default. This would mean potentially adding a button (a la Skype) to display previous messages, or else display them dynamically as the user tries to scroll up (google hangouts). Either way, in the current chat implementation this feature would be a "facade" as the conversation is entriely loaded into memory since we have to read the whole JSON file to parse it.
Another question is whether or not chat should be saved by default... maybe this should be an option...
The idea would be to keep the behaviour we are all used to in various terminal emulators and chat clients. Clearing the screen just clears the display. The history is not impacted (try it in your favourite terminal).
OK, I see, so just "scroll down" so that the previous messages are not visible on screen.
As a side note, some terminal emulators act differently to others. For example rxvt will actually delete the output of certain commands when you clear, eg: it will keep the output of commands such as 'cat' and 'ls', but 'echo' and 'ps' gets completely deleted...
That being said, in a chat client (e.g. empathy, xchat, pidgin, ...) the window buffer is cleared and the window history too. The disk logging is handled separately, in the sense that if conversation logging is enabled, every new message is appended to the conversation log, and loaded at creation time.
So to recap that's the basic expectation:
Opening a new chat session with someone will display the conversation history only if (logging is enabled) (blank if not)
Clearing the screen (Ctrl-l) will clear the window contents and the window buffer. Log is not impacted
Any new message will be appended to the log if (logging is enabled).
The Clear action should also be available as a user-interactive menu. Many users have no idea about Ctrl-l behaviour. For example in GNOME Empathy, it is available additionally to Ctrl-l, through the Conversation > Clear menu item, as well as Right Click > Clear. Hexchat (I guess xchat too) has a Right Click > Window > Clear text menu item.
OK. What you describe is what I initially imagined was the desired behaviour, but testing with gnome-termnial and rxvt-unicode produces the "scroll down" on Ctrl+L / 'clear' behaviour that I described... at least that seems to be their default on Ubuntu.
Mmmm, but if we're still saving the history, but simply clearing the display, it would seem counterintuitive to not be able to restore it. Mostly because then the only way for the user to restore it would be to restart the Ring client... so in effect we would be forcing the user to restart Ring just to see an old chat message. I think that unless the user has opted out of saving the chat (which is not currently possible) and Ctrl + L doesn't actually delete the messages, there should be a way to (re)load it in the interface.
Bonjour ! Beginner here, feel free to tell me if what I'm saying if off.
I have three main thoughts about this :
First, is the RAM occupation problem dealt with in Ring ? I mean some people have *very* long conversations or copy paste things, eventually that might occupy a lot of RAM (also think of CLI clients server side in screen instances that are never shut down). Having a shortcut to clear that manually might be useful. But an automated solution (like dynamic loading at scroll) would be better for average user. Why not both ?
It would be coherent with the log idea. Window content is cleared and you want to read logs ? Go read logs (presumably in permanent storage).
If I'm not mistaken, Ctrl-l is just one of the shortcuts of GNU bash. Why not implement common others : Alt-f,b,d ; Ctrl-w,u,k,a,e,f,b, etc. ?