cabal-club / cabal-cli

Terminal client for Cabal, the p2p chat platform.

Home Page:https://cabal.chat

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deemphasize seeders in peer name list UI

nikolaiwarner opened this issue · comments

If there is a way to tell if connected peers are seeders, it would be nice to change the color of their nick or place them at the end of the list so that real user nicks are more prominent.

Yeah! I'm not interested in seeing seeder's names though. But I really care about who's online at the moment. I think it would be really cool to just show a count of the seeders to give the user some confidence. Then in another screen, show a named list of seeders and also their uptime.

It also would be interesting if there was an indicator shown when coming back online telling you that there were no seeders around when you were gone... to give you a clue that there may be gaps in your history.

That's a great point! I'm with you.

What about showing an icon or symbol along with the name indicating if a peer is a seeder or regular peer?

I suppose my real goal here is inform the user if another peer has a human behind it who can respond. A set of symbols could also be useful to identify bots when we get to that 🤖

If anyone is interested in working on this, I'd be happy to help mentor! Here's the TODOs I see:

  • in cabal-cli, pass argv.seed into cabal-client
  • in cabal-client, pass that seed variable into cabal.swarm()
  • in cabal-core, edit the initial handshake hypercore extension to include whether the peer is a seed
  • in cabal-core, edit the _addConnection() function to accept something like opts.isSeed and emit that in the peer-added event
  • back into cabal-client, edit that event listener in src/cabal-details.js to set something like user.seed = true if it's a seeding peer
  • back into cabal-cli, edit views.js's renderNicks function to check for user.seed and render a sigil next to their name
  • bonus: sort seeds to the bottom of the online peers list! this is in util.js's cmpUser

At a high level, it's

  1. thread the --seed argument down to cabal-core, and then
  2. thread the user.seed property back up the stack to the frontend so it can be displayed