Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New UI for Backend Control #491

Closed
5 of 11 tasks
lidel opened this issue Jun 1, 2018 · 9 comments
Closed
5 of 11 tasks

New UI for Backend Control #491

lidel opened this issue Jun 1, 2018 · 9 comments
Assignees
Labels
kind/discussion Topical discussion; usually not changes to codebase kind/enhancement A net-new feature or improvement to an existing feature status/ready Ready to be worked topic/design-ux UX strategy, research, not solely visual design topic/design-visual Visual design ONLY, not part of a larger UX effort
Milestone

Comments

@lidel
Copy link
Member

lidel commented Jun 1, 2018

Tasks

  • define what is missing and what elements need to be added to UI
  • design drop-down and toggle (browser_action)
  • design backend list editor (Preferences) – see notes below
  • implement changes
  • migrate existing settings to a new item in "backend list"
  • close all issues in related milestone

Background

Click to expand historical notes on why this change was proposed

Right now we have a simple toggle between Embedded node (browserified js-ipfs) and External node (usually go-ipfs at IP and port defined in Preferences, accessed over HTTP API):

screenshot_7

Limitations

  • No obvious one-click to "enable/disable" what IPFS Companion does.
    • Multiple users raised the need for "off" switch.
    • Removal of all redirects of IPFS paths and window.ipfs object during web development requires going over multiple checkboxes in Preferences or disabling the entire extension via Addon Manager (was the case when troubleshooting CORS bugs).
    • No clear indication when "power-user ipfs mode" (with local node, API and window.ipfs) is enabled, and when "vanilla public" (no API) gateway is used. This makes troubleshooting of various issues harder than necessary.
  • Switching between "backend" different nodes is a chore, one needs to change URLs in Preferences each time.
    • Users raised a need for making this easier, namely having a predefined list of backends that one can pick. MetaMask network-picker was given as an example of what is missing in Companion:

      screenshot

  • Embedded node will have a different meaning in environments where js-ipfs is replaced with orchestrated instance of go-ipfs. Still, we should be able to make it possible to use js-ipfs in those environments, if user choose to do so.

Proposed UI Changes

Let's replace two-state toggle with global ON/OFF toggle + a drop-down list that enables selection from multiple available backends:

Browser Action Popup

  • collapsed - mockup:

    screenshot_9

  • expanded - mockup:

    screenshot_11
    ( just a sketch, some design work needs to happen here to use space more efficiently)

  • ON/OFF toggle will be one-click switch for: (IMPLEMENTED)
    • API status polling
    • redirect of IPFS paths to custom gateway (if enabled in preferences)
    • spawning/destroying js-ipfs instance (if selected as a current backend)
    • exposing API as window.ipfs (if enabled in preferences)
    • making possible to pick different backend via drop-down menu (see below)
  • Drop-down list will include available backends that control:
    • which API is used for uploads, polled, exposed in status section and under window.ipfs
    • which HTTP gateway is used for redirect (if enabled in preferences)

Simplified Backend List on Preferences Screen

Preferences screen should have an UI for adding/removing "IPFS Backends" that appear in the dropdown list rendered in browser_action.

  • Preferences UI: replace "node type" and "custom and public gateway" forms with a single list of backends
  • Currently active Gateway/API ports will be hidden from Preferences screen and be solely based on which backend node is picked by the user in browser action popup menu
  • user-defined backends can be added/removed from the list
  • "embedded" js-ipfs is implicit, always present, cant be removed
  • each entry has attributes:
    • "label"
    • "API" and "Gateway" URLs
      (why both need to be defined? Gateway port can be fetched from API port, but it is not 100% safe as people are known to put it behind reverse-proxy such as nginx, and we want to use one list for Gateway-only backends)
    • a checkbox "public gateway without API" that disables API field and marks backend for use as "public gateway"
    • a checkbox "embedded, no HTTP gateway" that disables HTTP Gateway field (afaik there will be only one example: embedded js-ipfs node, so this checkbox may be a hidden flag, eg in "metadata" field below)
    • "metadata" – hidden, used for storing additional flags (eg. making sure default public or embedded node can't be removed)
    • "custom headers" – an option to define custom headers per backend (Feature request: support basic (or custom headers) auth for public gateway requests #538 (comment))
  • "external" nodes are loaded from storage.local.
  • If the list is empty, an item with current "localhost" defaults is added automatically when extension starts for the first time.
  • Future / Nice to haves
    • A way to dynamically import list of public gateways (eg. this one)

cc @olizilla @akrych

Thoughts?

@lidel lidel added kind/enhancement A net-new feature or improvement to an existing feature kind/discussion Topical discussion; usually not changes to codebase UX labels Jun 1, 2018
@lidel lidel added this to the v2.4.0 milestone Jun 1, 2018
@olizilla
Copy link
Member

olizilla commented Jun 4, 2018

I think for now we should just show what node you are connected to as a text label below the on off switch. On hover, a "change" link could fade in, and clicking it takes you to a page that explains what it means to change it, offer up the defaults along with their constraints and allow users to add more.

If people start making use of this feature, then we could offer a "quick switch" drop down, but I don't think we need it yet. It's a useful feature but we do need enough space to explain the consequences of changing it, so I'd forgo the drop down at this point.

@lidel
Copy link
Member Author

lidel commented Jun 4, 2018

@olizilla I like the idea, hovewer something to note is that we already display info about currently used API and Gateway in the bottom "status" section.

  • To avoid content duplication we may just add a clickable "change" action to the status section that opens Preferences. It could be as simple as an icon: 🔧 or ⚙️ next to "gateway" and "api" or something like that.

  • Existing toggle could remain in the same place, but its meaning would simply change from Embedded/External to Enabled/Disabled.

  • We may consider moving entire status section above menu items, making it one with "heartbeat" icon and toggle.

  • Just like in WebUI, we should avoid use of "on hover" for key features, as it does not work on touch devices (Firefox for Android). The "change" action should be always visible.

lidel added a commit that referenced this issue Jun 20, 2018
Feature: ON / OFF Toggle

This PR delivers an initial part of #491:

- Moves status fields back to the space-header, resulting in two clear sections instead of three vague ones
- Replaces node type toggle with a global On/Off switch that enables/disables gateway redirect and all active API integrations.
  - Perfect for users who don't want to run js-ipfs all the time to save battery, want to disable redirect  or temporarily block access to API `window.ipfs`
  - Things that don't require access to API will still work in OFF state:
    linkify, copy IPFS Path, custom protocol handlers
    (they just redirect to public gw)
- Moves switch for changing between _External_ (js-ipfs-api) and _Embedded_ (js-ipfs)  to _Preferences_ screen
- Hides unused options when embedded node is active (_Preferences_ screen)
- Changes fonts and icons to ones from ipfs-css
@lidel
Copy link
Member Author

lidel commented Jun 20, 2018

Activate / Suspend Toggle

First step was to move "node type toggle" to Preferences and introduce a global "on/off" toggle that activates/suspends all IPFS integrations. Details can be found in PR #500.

It just got merged and released to Beta in v2.3.1.9890 🚀

So far the UI moves into more calm, less cluttered direction:

peek 2018-06-20 18-45

Next

My initial thoughts on how to introduce "backed selector" into this minimal UI:

  • UI should look the same, but enable user to switch to different backend without going to Preferences
    • A) drop-down indicator (a triange?) on the right of "API" status field
    • B) add third icon that onclick replaces status area with bigger backend selector
    • C) ?

@lidel lidel self-assigned this Jun 20, 2018
@lidel lidel added the status/in-progress In progress label Jun 20, 2018
@lidel
Copy link
Member Author

lidel commented Jun 22, 2018

After playing with options, I've come up to realization that consistent UI requires us to inline gateway selector as well.

Mockup:

screenshot_24

Mechanics of both selectors would be similar to Material Design: exposed dropdown menu:

text-field-menu-intro

Thoughts?

@olizilla
Copy link
Member

That could work, but the extension already looks like a drop down menu, and a drop-down in a drop-down isn't ideal.

I'd start with a full page for it and figure our all the info we need to get across and the UI for adding new backends, and give the user access to it as a menu option. We can figure out the "quick change" selector once that is place.

@lidel
Copy link
Member Author

lidel commented Sep 21, 2018

Started gathering related feature requests in milestone/14.

Gist of feature request from #591:

  • When adding a new backend to the list it should be enough to enter API port by itself
  • Gateway port should be read from API by default, with an opt-in option to override it per backend
    (for custom setups where user tunels the port etc)

@hsanjuan
Copy link

I noticed the setting Redirect to Custom Gateway is a bit confusing right now because the local gateway is defined as Preferred so you would think it's used by default already.

I'm not sure what's the best way to improve it but it's a weird setting because it flips itself by toggling the public gateway from the main dropdown, and also automatically depending on local daemon' s availability. Perhaps Automatically use custom gateway when available would be a better config option, and leave the manual switching for the dropdown menu items.

@lidel lidel added the status/ready Ready to be worked label Dec 21, 2018
@lidel lidel pinned this issue Jan 7, 2019
@lidel lidel unpinned this issue Jan 25, 2019
@lidel
Copy link
Member Author

lidel commented Feb 28, 2019

  • Redirect to Custom Gateway will be moved from menu item to a quick toggle icon in Per-site Redirect Opt-out #687

  • Drop-down list with available backends that control in main popup menu did not happen yet, but we started discussing revamping entire menu in [META] Upgraded UI for IPFS Companion #689 (but I believe we will add backend switcher on the Preferences screen first)

@jessicaschilling jessicaschilling added topic/design-ux UX strategy, research, not solely visual design topic/design-visual Visual design ONLY, not part of a larger UX effort and removed UX labels Mar 30, 2020
@jessicaschilling
Copy link
Contributor

Closing in favor of #689.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/discussion Topical discussion; usually not changes to codebase kind/enhancement A net-new feature or improvement to an existing feature status/ready Ready to be worked topic/design-ux UX strategy, research, not solely visual design topic/design-visual Visual design ONLY, not part of a larger UX effort
Projects
None yet
Development

No branches or pull requests

4 participants