jackline icon indicating copy to clipboard operation
jackline copied to clipboard

Separate UI from state / network engine

Open cfcs opened this issue 10 years ago • 3 comments

I think we should move towards having jackline communicate with the user using an IPC protocol for emitting and receiving UI events.

This would enable users to make their own UIs for jackline, and make customizing the UI easier. Some such a change would make possible:

  • being able to use jackline as the engine for "bots"
  • rapid prototyping of new protocols or UI features
  • graphical clients
    • offloading the majority of the UI work to someone else who likes writing UI code
    • variable-width fonts; more text on screen
    • inclusion in Tails and the like targeting "regular people"
    • prettier notifications since we can detect if the X window is currently in focus in the WM)
    • running the UI in an execution context that doesn't have network access (IMHO accidentally clicking links in the terminal is a bit annoying)

Making this change would require identifying the UI interaction primitives we currently rely on. The ones I can remember off the top of my head:

  • Update window contents (user chat history, status window)
    • Scroll events (the UI should take care of linewrapping; not us)
  • Prompt for / receive user for input
    • OTR SMP
    • Chat message input
    • Account creation dialogs
  • Change configuration / contact settings
  • Presence notifications

Thoughts?

cfcs avatar Nov 13 '15 13:11 cfcs

not yet in scope. there are more pressing issues. but src contains UI-independent code, whereas cli has a command-line interface.

hannesm avatar Nov 13 '15 14:11 hannesm

There's huge progress being done in this direction (by switching to notty terminal library which just landed in master)... still not separate libraries, though.

hannesm avatar Feb 07 '16 14:02 hannesm

I forgot message notifications as discussed here: https://github.com/hannesm/jackline/issues/118

cfcs avatar Feb 10 '16 00:02 cfcs