/glycerin

Google Chat Terminal User Interface

Primary LanguageJavaScriptMIT LicenseMIT

Glycerin

A Google Chat Terminal User Interface

This is a WIP. Maybe don't use this for your daily driver chat app.

Usage

Running

  • install: yarn bootstrap 1
  • run: yarn start
  • watch events go by: yarn ev

Key Bindings

  • enter - select a chat or thread
  • escape - exit a thread (blur focus on input) or exit a chat
  • h/j/up/down - navigate chats/threads
  • ctrl+e - expand thread messages
  • ctrl+r - refresh chats + threads + messages
  • ctrl+d - exit

Working

  • View Rooms, DMs
  • Send messages
  • Unread callouts
  • manually refresh rooms/threads/messages with C-r

Almost working

  • Event subscription (api.js#events and unpack/events.js)
  • Room/DM search for exsting chats (screens/search.js)
  • Create thread in a room (api.js#newThread)

Missing

  • Fetch more threads/messages
  • scrolling messages
  • User/Room search for new/non-joined (unknown)
  • Mark As Read when joining a room/dm (probably either /log or /events endpoints)

New Features I'd Like To Add

  • C-u to jump to latest unread across all chats
  • C-escape to mark all chats read
  • C-tab to switch between MRU chats
  • basic configuration customization
  • upgrade/improved rendering for neo-blessed. it's honestly kind crap.

How It Works

  • auth, grab cookies (src/lib/api/auth.js#init)
  • register to listen to events (src/lib/api/events.js)
  • bootstrap screen (index.js, src/screen.js)
  • fetch all chats (index.js, src/lib/model/chats.js#getAll, src/lib/api/get-chats.js)
  • when chat selected either:
    • (isDm) fetch chat messages (src/screens/messages.js, src/lib/api/get-chat-messages.js)
    • (!isDm) fetch chat threads (src/screens/threads.js, src/lib/api/get-chat-threads.js)
  • listen for user input (src/screens/input.js)

users are fetched/cached in lib/model/user.js

Footnotes

  1. we can't use chrome because https://support.google.com/accounts/thread/22873505?msgid=24501976