melloc / node-iamb Goto Github PK
View Code? Open in Web Editor NEWA terminal chat client
A terminal chat client
Mattermost uses Markdown for making text bold/italicized/underlined, and more, like rendering code and tables. iamb
will need to render these in an appropriate fashion in the terminal.
To do this, we'll probably want to either enhance the node-termdraw LogBox
implementation, or create a special Markdown variant.
When focusing on a room, if there are any typing notifications for it, then we should display something in the bottom bar displaying them.
The ~
keypress will toggle case, and in visual mode u
and U
will make the selected text lower or upper case respectively. gu<movement>
and gU<movement>
allow you to use a movement to change case in normal mode.
By default in vim, pressing ~
will change the case of just the character immediately under the cursor, and move the cursor to the next character. If you run :set tildeop
, then ~
will take a movement to specify what text to manipulate. It might be nice to support both modes of operation.
To prevent having to store my password in a plaintext config file, it would be nice to enter the account password into a command prompt when the client starts.
In vi
, you can split the screen horizontally with :sp
and vertically with :vsp
. It would be nice if iamb
allowed something similar, so that people could layout conversations next to each other as they'd like. You could then resize/cycle/navigate through them with the ^W
vi commands.
The current release on npm is just a placeholder that doesn't do much useful. I'm going to publish 0.0.2
so that there's something useful that can actually be installed from npm.
Users should be able to press q<k>
to start recording a new named macro. I don't know just how useful macros will be for editing messages, but being able to support @:
would be nice.
Users can currently join rooms and DMs that they're already in, but they can't start a brand new DM, or join a brand new conference room.
It would be nice to be able to undo/redo changes made on the editing line using u
and ^R
. It would also be good to make REPLACE mode actually returned replaced characters when backspacing.
?
and /
should allow searching through the scrollback.
Pressing up/down in the command bar should move backwards and forwards through the command bar history.
iamb should allow people to attach files to messages they send. The best way to do this might be to have a :attach
command that attaches it to the message currently being edited (and presumably indicates that there's an attachment by updating the line somehow). There could also be a :send
command that allows sending a file in the chat instead of attaching it to the message. This may work better with some chat systems, where files get sent directly instead of as part of a message. (I believe IRC and XMPP work this way.)
Vim has a visual mode that allows one to visually select a range of text and extend the selection using the movement keys. It would be nice to also support it when editing in iamb.
The changes in 2.0.0
of "termdraw"
will allow displaying wide characters (like Emoji) that appear in chat, and also adds some new interfaces to help simplify existing iamb UI logic (and remove the suspend/shell code that reaches into private termdraw
fields).
In vim, ^I
and ^O
allow you to move around the jumplist, which contains recent locations in the file and other files. A similar feature for jumping to recently viewed rooms would be nice. To make it easy to toggle between views.
You can open up a direct chat currently with :dm
, but that doesn't work for conference rooms. There should be a :join
command to allow joining conference rooms (and possibly group chats?).
I'd like to use the Cueball agent instead of the normal node.js one. Cueball also allows enabling TCP keep-alives on the socket before handing it off to restify, which will allow us to better handle dead connections.
Basic Vi editing functionality is currently implemented, but it's just the character movements currently. The next thing that should probably be implemented:
w
, W
, e
, E
, b
, and B
)f
and t
)It would be nice to be able to autocomplete commands and arguments in the command bar with ^D
and tab (^I
), and complete usernames in the text bar with ^N
/^P
.
Vim's text objects are really nice (see :help text-objects
), and some of them would be especially handy when editing a message (or code once multiline is supported). There are two styles of text object movements:
Vim's supported text objects are:
w
) and WORDS (W
)s
)p
)[
or ]
)(
, )
, or b
)<
or >
){
, }
or B
)"
)'
)`
)If I accidentally press enter when nothing's been typed, I shouldn't send an empty message.
iamb should support writing multiline messages. Thinking about it, I believe the best way to do this is by treating enter in INSERT
mode as entering another line, and in NORMAL
mode as submit. We should also add support for the o
and O
keys.
In vi, pressing dot (.
) will repeat the last editing action.
When scrolling back through a room, it would be good to load older messages.
Once #3 is implemented, that logic can be used to implement delete (d
), yank (y
), change (c
), and paste (p
) functionality.
To make it more obvious when behaviour is unimplemented, we should try to warn in all of the places where we should probably do something but don't. This is done for unhandled keys in normal mode, but not done when you enter a microstate, like after pressing d
.
Users should be able to provide a series of keywords to use to notify them of relevant messages. It would be nice if they could be configurable so that they don't have to be global, but could be defined per-room, per-account, or even by the user who says them. Maybe this could be done using node-ldap-filter, or a simple DSL?
When I initially wrote much of the user interface, I placed calls to Draw#redraw()
inside the controls after redoing the Region
. After writing up some examples for node-termdraw
, I'm now convinced that this should be done outside of them, so that there's a cleaner heirarchy of UI controls which need little knowledge about the rest of the program.
Now that we can join conference rooms, the fact that we only load usernames for users we have DMs with is more obvious. We should load all users at program startup, and cache their information, and also listen for notifications over the websocket that new users have been created (the user_added
message type, I believe).
It'd be nice to have a status bar that shows what mode you're in (e.g. INSERT
or REPLACE
).
In vim, you can visually select a range of characters to replace, and then replace them with text from a register using p
/P
(both behave the same).
The simple keybindings that vim allows in the command bar allow replacing characters after pressing the Insert
key. This puts it into a REPLACE
-like mode, and allows you to return to the standard insertion mode by pressing Insert
again. (Unlike REPLACE
mode though, backspacing does not restore overwritten characters.)
When backspacing in replace mode, any text that had been replaced gets restored. This is nice when you accidentally replace further than what you wanted, or need to fix a mistake.
To start off, there needs to be some basic functionality:
As part of #29, some of the more Mattermost specific logic will need to be moved out of iamb, and into the client library (see melloc/iamb-mattermost#6). Both the Mattermost and Matrix client libraries will present the same interface to iamb, allowing this repository to remain largely ignorant of how the two different chat systems work.
The TextBox#refresh()
method shouldn't be exposed to consumers, but should instead be called whenever internal state changes such that the editor line needs to be redrawn. Additionally, TextBox
shouldn't override the Region#resize()
method but should instead just listen to the "resize"
event and call TextBox#_refresh()
then.
It'd be useful to have some documentation on getting started, keyboard shortcuts, starting conversations/joining rooms, etc.
I'd like to get initial support for Matrix going. This will require figuring out what multiple account support looks like. It should be implemented in such a way that multiple accounts of the same type (i.e., three separate Matrix accounts, or two separate Mattermost accounts, etc.) can be supported.
When using the simple keybindings for command-line mode, you can delete words using ^W
.
Highlighting misspelled words as they're typed would be useful. Users could then interact with the spellchecker through:
zg
, add word under cursor to dictionaryzG
, temporarily add word under cursor to dictionary]s
and [s
, move to next or previous misspelled wordA declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.