voyager icon indicating copy to clipboard operation
voyager copied to clipboard

Allow customizing the list of default instances

Open 0xCmdrKeen opened this issue 2 years ago • 5 comments

Is your feature request related to a problem? Please describe. When logging in to an account, Voyager currently shows a list of only 3 default instances, with the option to manually type the URL/domain for a custom instance you'd like to use on a per-case basis (see first screenshot).

Describe the solution you'd like What I'd like to see is an option in the settings to customize the list of default instances, so you can permanently add your preferred instances to the list. Lunar currently does this very elegantly (see second screenshot).

In Lunar, you can access this screen from the top level settings menu via an entry called "Manage Instances", but it could certainly also be placed within one of the existing categories in Voyager's settings menu (e.g. "General") if that seems preferable. The advantage of that would mainly be not having to come up with an appropriate icon choice.

Basically, the entire list is editable (meaning you can remove any of the default instances if you'd like), but you can always get the default list back using the "Reset Instances List" button. It probably isn't necessary for the list to also support re-ordering by dragging and dropping if that means a lot of extra work (it's not orderable in Lunar either), since one can always just remove and re-add instances in the order desired.

Describe alternatives you've considered Not giving users a simple and accessible way to add custom instances will likely contribute to increased centralization in the fediverse by driving more traffic to the "big 3", since manually typing a custom instance name gets old rather quick, and people are naturally lazy.

Additional context

Voyager Lunar

0xCmdrKeen avatar Dec 01 '23 22:12 0xCmdrKeen

I did some work on this and I was able to code a "Manage instances" page that looks and functions exactly like that from Lunar (second screenshot). Newly added servers are validated (similarly to the process used in the Login component) before they are added to the list to prevent users from adding random junk.

Happy to contribute a PR, however, I'm currently only keeping the server list in local state. Would need some advice on how to best wire it into the app to make it persistable. It doesn't look like the ability to store a custom server list currently exists anywhere in the app.

0xCmdrKeen avatar Dec 02 '23 00:12 0xCmdrKeen

@0xCmdrKeen You may want to use db or localStorage ?

80avin avatar Dec 02 '23 19:12 80avin

@80avin yes I do, my question was more about which one do I use and where do I put it?

I'm thinking most likely it should go into the Redux state. There already is an instancesSlice in there, but I'm not entirely sure what its current purpose is. It only seems to store known instances at the moment and caches them in the db.

Since this is configuration item, perhaps it should go into the settingsSlice instead, which seems to automatically persist itself to localStorage. In that case, I would need to know if there are some implicit rules here about organization — appears that the structure of the slice reflects the structure of the settings menu, which makes sense. If that assumption is correct, I would then need to answer the question whether this should be a top level item in the settings or whether it should go into one of the submenus.

@aeharding, may I borrow a minute of your time to get your thoughts on this?

0xCmdrKeen avatar Dec 02 '23 21:12 0xCmdrKeen

Hi! So this is something I'm interested in adding.

While it doesn't need to be addressed in this specific work, it would also be nice if the user could browse anonymously while having accounts in the account switcher. Again, that's a separate bit of work, but worth taking under consideration when implementing.

This issue is also possibly a duplicate of https://github.com/aeharding/voyager/issues/116

aeharding avatar Dec 03 '23 15:12 aeharding

@aeharding excellent, glad to hear that, and happy to contribute to what is currently one of my favorite apps!

I already sent a PR with my current attempt at a solution. It probably still has some flaws and issues that need to be addressed, but it does work, and should at least be a good starting point for a possible solution.

Happy to hear your feedback there and address any issues with the current implementation.

As for #116, I think my PR does address this as well, as the custom server list WILL be used on the LoggedOut screen's instance selector.

0xCmdrKeen avatar Dec 03 '23 22:12 0xCmdrKeen