ipfs / ipfs-gui

Creating standards and patterns for IPFS that are simple, accessible, reusable, and beautiful
105 stars 17 forks source link

Settings page: add UI controls for common settings from config file #15

Open lidel opened 6 years ago

lidel commented 6 years ago

I had an opportunity to talk with enthusiastic non-technical person and she asked interesting question: "sounds cool, but after I install it, how can I control how much disk space IPFS can use?".

AFAIK right now one can set StorageMax via commandline or by editing JSON at http://127.0.0.1:5001/webui/#/config:

screen shot 2017-12-18 at 23 16 16

I think we can agree that editing JSON by hand is.. not the best UX :) There is a real need for simplified and intuitive UI for setting selected configuration keys, StorageMax being the most obvious one, Gateway port being another one. Less is more. It is ok to have UI only with a few settings, leaving the rest to commandline or "Advanced Mode".

Open Questions

hacdias commented 6 years ago

This is a great point!

Just throwing an idea to the air: what if we developed some kind of system that transformed a JSON into a form so we could have every option in a more "usable" way?

Although, I recognize that that idea may not be the best because the form could get really complicated due to the nesting level we can find on the configuration.

Should we leave option to edit full config in JSON format?

I think so, and just like you said, it could be hidden under a button saying "Advanced Mode" or even "More Configuration". The user could even enable that mode by default checking a checkbox for example.

lidel commented 6 years ago

I was thinking about "Advanced Mode" and I realized that personally, I would rather edit raw JSON than edit a huuge nested form. For some reason raw JSON feels like a less of a cognitive load to me, but maybe I just can't imagine a good HTML form for this :)

I am not saying this can't be done "right" at some point in future, but I feel we should focus on "Basic Mode" first, which will be displayed by default.

Some related thoughts:

olizilla commented 6 years ago

https://hjson.org/ has been mentioned as a lib for letting humans edit a friendlier json-like thing.

olizilla commented 6 years ago

WebUI allows you to modify the IPFS node config.

Desktop and Companion have to deal with app specific settings and also let the user modify the IPFS node config as well.

We need to think about how that comes across to the user. We can keep app settings and node config separate, but we should aim to present them as sections of the same page in the UI.

Companion calls it "Open preferences", while Desktop calls it "Settings". WebUI referes to the Node Config. We should agree the naming, and review the settings that each provide.

hacdias commented 6 years ago

I think Desktop and Companion could simply link to WebUI's page to edit the settings. And yes, we should define a name.

lidel commented 6 years ago

I'm leaning towards naming it "Settings" screen (a subset of entire "Configuration").

While we can delegate a lot, each app will always have a small set of app-specific settings that do not belong to WebUI. For example: control if Desktop autostarts with system, customize default public gateway used by Companion etc.

At the end of "Settings" screen, after app-specific things there should be button to "Open IPFS Node Settings". It could just link to WebUI screen that enables user to change selected node settings via dedicated UI (or just let user to edit raw Config directly, like it does now).

This way there is no duplication of Settings, there is always one place to change specific setting.

ps. here is a flowchart from old Android Design Guidelines on what becomes a setting and what doesn’t:

1 nygsps923t8c-zwhph1rdg

akrych commented 6 years ago

@lidel I love this flowchart. I have to keep it for future! <3

I think Desktop and Companion could simply link to WebUI's page to edit the settings. And yes, we should define a name.

I think that every application should have its own settings. Some small settings can be specific only for this application :)

Companion calls it "Open preferences", while Desktop calls it "Settings". WebUI referes to the Node Config. We should agree the naming, and review the settings that each provide.

About the name - "Settings" will be the best and the least confusing.

Perhaps we could simply improve "Advanced Mode" (raw config JSON editor) by introducing syntax highlighting? I feel it will be a good compromise for now.

Strongly agree, it will be good for the start and name "Advanced Mode" in my opinion will be the most recognizable by users.

At the end of "Settings" screen, after app-specific things there should be button to "Open IPFS Node Settings". It could just link to WebUI screen that enables user to change selected node settings via dedicated UI (or just let user to edit raw Config directly, like it does now).

Like it! 👍

We should compile a list of things that should have UI elements in "Basic Mode" StorageMax in gigabytes (as input type number?) (We don't have API for this, but it would be extra cool if we knew how much space is left on a partition used for IPFS storage and made it impossible to set more than that, or even display a resizable bar like in partitioning software)

StorageMax in gigabytes - In my opinion an intuitive interface for this is our "must-have". This option is the first that I will be searching after open application. I would also add a reference to this on the node info page where the Repo Size will be shown. (small icon (i) or sth.)

alanshaw commented 6 years ago

For app specific "settings" most apps I have installed on my macOS have gone with "Preferences"

screen shot 2018-03-27 at 17 03 39 screen shot 2018-03-27 at 17 03 49 screen shot 2018-03-27 at 17 04 49

I suspect there will be app specific settings to the WebUI as well. We could add a hook to allow wrappers like desktop/companion to add their app specific settings below/above WebUI settings?

I suggest that "Node Configuration" is one of the items on our WebUI settings page.

Following the lead of Atom/Sublime etc. I'm in favour of pulling out common/beginner friendly node config options into easy to update and validate HTML form elements and having a button that opens up "advanced mode" edit-the-JSON for pros.

In addition to @lidel's list of options to expose we should consider checkboxes for enabling the experiments.

olizilla commented 6 years ago

@akrych I think what we want is

Simple controls for:

And then:

... right now Set repo size quota in MB is difficult, as it's only a hint to ipfs, and if garbage collection is disabled, the repo (i believe) will grow beyond that value. Also I'm not aware of any web api to get the users total available disk space, so we can't offer any sensible max value for that control, until we can get the ipfs api to tell us.

@lidel is that about right? We should think about

Gateway and Api as URL fields (probably similar to UI we have in IPFS Companion)

I think we want webui to be something we can point at different ipfs instances, so we need to think about the different use cases "i want to point my webui at that remote ipfs node" and "i want to update the api and gateway config of the ipfs node I'm currently using" as the latter would need special handling... changing the API address when the webui is using the API.

lidel commented 6 years ago

Some additional thoughts on what is currently technically possible:

olizilla commented 6 years ago

MDNS Discovery

If we phrase this as "Find IPFS peers on your local network" then it'd be more comprehensible

Providing user with a list of predefined Profiles

Good idea. I think the profiles available right now are pretty niche interest. It'd rad to figure out some profiles for the travelling laptop based dev, and the low spec local library desktop.

lidel commented 6 years ago

There is a discussion about controlling content reproviding setting via browser extension. See https://github.com/ipfs-shipyard/ipfs-companion/issues/507 for context and sample use cases.

I feel uses raised there are important enough to provide this as one of Simple Controls in WebUI as well.

olizilla commented 6 years ago

See also:

olizilla commented 6 years ago

Settings page design proposal (pulled from https://projects.invisionapp.com/share/AVGRKKJ75KT#/screens/302169242_Settings_screen

ipfs-webui-settings-page

bleonard252 commented 6 years ago

I was working on a script to map a checkbox to a JSON element, but I'm not finished yet. I'll publish it on Gist when I'm finished.

Jump down

bleonard252 commented 6 years ago

Settings page design proposal (pulled from https://projects.invisionapp.com/share/AVGRKKJ75KT#/screens/302169242_Settings_screen

The one problem I have with this is the "What is IPFS?" box. You could instead fit a second column of settings.

bleonard252 commented 6 years ago

Current state of my script: https://gist.github.com/bleonard252/528acbc7f954603c192f8745c5e5abda

The demo saves to local storage, but for some reason no updates are made (testing on Firefox). In this situation you would configure the "January" attribute to the configuration element. If there are problems with my script, please let me know in its comments.

jessicaschilling commented 4 years ago

Proposing we wake this discussion up and make it real ...