ipfs-desktop icon indicating copy to clipboard operation
ipfs-desktop copied to clipboard

feat: show peer count in menu and tray tooltip

Open sutartmelson opened this issue 4 years ago • 2 comments

Addressing feature request from #1312. The peer count is retrieved whenever the menu is opened (all systems) and whenever the user hovers over the tray (Windows/macOS).

Fetching the information this way means the displayed peer count isn't always up to date. Depending on the OS, the number shown usually reflects the number of peers at the time of the previous menu open event.

If electron updates its API to allow dynamically editing menu labels, this feature could be improved.

In tray: PeerCountInTray

In menu: peerCountInMenu

Tray and menu when IPFS isn't running: NoPeersIPFSStopped

sutartmelson avatar Feb 14 '21 22:02 sutartmelson

@lidel, Great idea, if polling is to be avoided (which is understandable), displaying the last cached value and fetching a new one at menu open is a good compromise. The displayed peer count isn't perfectly up to date, but I don't think it needs to be. I also updated the PR description accordingly. Hopefully this last change is a step in the right direction. Thanks!

sutartmelson avatar Feb 24 '21 01:02 sutartmelson

@lidel, how is this showing on Linux atm? If it's already disabled I think we can just leave it as is for Linux until we have a fix so we're not holding this issue just for that.

For the second to-do item, I'm with you that only one "Peers" should remain.

AlexxNica avatar Jul 22 '21 06:07 AlexxNica