gossip
gossip copied to clipboard
New relays section
Cloned from https://github.com/mikedilger/gossip/pull/402, now on unstable.
Items marked with 📍 are in my opinion the priorities.
Add a relay
- [ ] A1 - We should check if we can connect to the relay, show if there is a DNS error or any other type of errors, in the latter case the user should still be able to add the relay.
- [ ] A2 - If a host is added without the protocol, let's assume "wss://".
- [ ] A3 - Some invalid hosts (ex. "wss://relay.damus.io." or "wss://.relay.damus.io") pass the check, could be solved by A1.
- [x] A4 - ~~The error message "That's not a valid relay URL" should be showed inside the modal and not in the sidebar.~~ Not needed because now the check is realtime and disable the "Check" button
- [x] A5 - After adding a relay instead of filter it by name it should be placed on the top of the list in edit mode, because the user must personalize it.
- [x] A6 - ~~After adding & enabling a relay (read/write) it does not connect, no activity in the log, I have to restart gossip.~~ Moved: https://github.com/mikedilger/gossip/issues/499
- [x] A7 📍 Precompile the input with "wss://"
Edit a relay
- [x] E1 📍 When editing a relay the list refresh must be stopped.
- [x] E2 - ~~Light theme: when editing a relay the others' items background should be darker (ex. 50% opacity), like in the dark theme, to focus the edit area. Related to L5.~~
- [x] E3 - The action "Remove from personal list" does not works.
- [x] E4 - Force disconnect should be disabled (gray and without underline) if the relay is not connected.
- [x] E5 - The action "Force disconnect" does not give any feedback, could be solved by E4.
- [x] E7 - "Force disconnect" when disabled (gray) is still clickable and close the edit (2023-08-23)
All relays lists
- [x] L1 📍 Update compact/expand views as proposed.
- [x] L2 - Add a sort by name (a-z).
- [x] L3 - ~~Add a sort by add date (newer => older) and set it as a default~~ Moved: #525
- [x] L4 - Show the host without the "wss://" protocol (could be added when switching to edit/details).
- [x] L5 📍 Light theme: items background should be white.
- [x] L6 - Show a bullet in front off the relay showing the status: green => connected, gray => disconnected; yellow => penalty box (hovering over the mouse shows the remaining time).
- [ ] L7 - Change the rows background to
visuals.panel_fill
Active relays view
- [x] R1 📍 The coverage list should be moved to another view; currently if it is taller than the viewport so it is not possibile to scroll it and view the the actual relays.
I'm not able to check further due to R1.
My relays view
- [x] M1 📍 Add "Advertise" button.
- [x] M2 📍 Use blue background for "Advertise" button.
- [x] M3 📍 Remove the cloned input search
Know network view
- [x] K1 📍 Add "Hide from the view" near "Force disconnect".
Bootstrap a fresh profile
- [x] B1 - ~~Hide the "Relays" sub-menu block; when the user click the "Relays" item show "My Relays" view and immediatly open the "Add new relay" modal.~~ With the new #421 we should always have some relay, so this point is not necessary anymore.
~~Cosmetics~~
We will move them to a new specific issue.
- [x] C1 - ~~Revert light theme accent color to the original one.~~
- [x] C2 - ~~Review "Add relay" button colors/hover/spacing/font-size.~~
- [x] C3 - ~~Review "Close" button font-size.~~
- [x] E6 - ~~Make the tooltips less wide to improve readability.~~
@bu5hm4nn I'm checking the current unstable and updated the checklist.
Notes about the updates: E5 - Closing the modal is ok but would be nice to give a 5 secs delay before the reconnecting, so the user can see the gray icon; currently the reconnecting is immediate and the gray icon is visible < 1s
Notes about not updated: A1 - Is it easily applicable? Otherwise we can postpone it, the formal checks are more important. A* - Have these points been addressed somehow? I cannot activate the "That's not a valid relay URL" error message but the host formal check is not still working very well. E2 - I don't think is a priority anymore; we can review it when we will check how to manage the egui logic and incorporate it in our theme needs.
Added points: E7
For B1 I'm waiting #474 because I cannot test a new profile anymore.
The listing view optimization has been moved here: #466
So on A1, I am already doing what @mikedilger suggested which is to parse through the RelayUrl class. So I guess we could make that class stricter on how it parses strings?
The only really good way of validating I see is to try to connect to the relay and check for a successful connection. The reasoning is that if someone uses relays by IP or in a private DNS then validating them against public DNS would not do any good. Also validating against public DNS would not validate the connection port while actually connecting would validate it. And I would always give the user the option of adding it anyways but maybe with a different looking button/link.
We could also try to read the NIP-11 and display it to the user before they finally add the relay.
@bu5hm4nn test a successful connection, and maybe use it to fetch NIP-11, is a good option but is more strict, because does not cover the case of an existent relay that is currently offline (but the user should be able to add it anyway).
The DNS idea was just a way to catch misspellings, and as said, I think it can be deprioritized if it is too complicated or not so effective (ex. it hits false positives).
M1 is fixed by https://github.com/mikedilger/gossip/pull/476
@mikedilger
Please test unstable and tick A6 if working now.
I started a new profile (export GOSSIP_PROFILE="new") added a relay, it is not active:
The log is empty, zero activity. Restarting the app solve, it became green.
@bu5hm4nn on unstable [4944be51] I see a cloned input search:
Typing one field fill both.
Added M3 to the list.
I started a new profile (export GOSSIP_PROFILE="new") added a relay, it is not active:
Did you give gossip a reason to connect to it, like someone you follow that uses it? Why would adding a relay make it go green?
I do think it would be good to connect to user-added relays immediately.
- to confirm it works
- subscribing with our follow list to see if it has content for any of our followed keys (since many accounts don't publish a 10002)
@mikedilger sorry I missed the notification. I tried to add an user (myself) using only my npub (so no hints). The user has been added and metadata has been fetched; but the relay is still gray. How is it possible?
In the "Known network" now I find all my relays:
But I cannot see my notes.
If I restart I see my notes and relay.damus.io is green.
@bu5hm4nn
I do think it would be good to connect to user-added relays immediately.
I agree.
ok so it is still a bug, and not so easy to find.
@mikedilger Item "L3" from the list would require tracking the relay's add date in the db. Should we plan to support that at some point?
@bu5hm4nn on unstable [4944be5] I see a cloned input search:
Typing one field fill both.
Added M3 to the list.
I think that bug probably came through a manual merge conflict resolution
Is this finished? If not, let's mark it for milestone 0.10
I revised the checklist: A1, A2, A3 are still open. There are some cosmetic operations, but we decided to move them to a separate problem (yet to be created).
Checklist updated, only A1, A2 and A3 are still open.
