Skip to content

Incorporate Desktop's Settings into Web UI's #674

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

Closed
hacdias opened this issue Oct 25, 2018 · 1 comment
Closed

Incorporate Desktop's Settings into Web UI's #674

hacdias opened this issue Oct 25, 2018 · 1 comment

Comments

@hacdias
Copy link
Member

hacdias commented Oct 25, 2018

Right now we have a set of Settings for Desktop that should be available for the user. Screenshots:

image

image

For a better user experience and integration, this settings should be placed alongside/withing Web UI's.

How are we going to incorporate this settings into Web UI?

On one hand, we could have some kind of detection on Web UI's side to know if it is running inside desktop or not. If so, then it would just show the Settings. Not sure if the bundled version of Web UI would work that way because we need ipcRenderer to be available to have contact between Web UI and the node main proccess.

Another option would be to have some kind of plug-ins on Web UI so we could just add a "third-party" component to a pre-defined place in the UI.

These are just some thoughts. I'm looking forward to hear yours @ipfs-shipyard/gui

@hacdias hacdias added this to the v1.0 milestone Oct 25, 2018
@lidel
Copy link
Member

lidel commented Nov 6, 2018

(below are some notes, mostly a summary of discussion we had during our sync call this week: ipfs/in-web-browsers#127)

Design

To keep UI minimal, we will try to extend Settings screen from Web UI.

Injecting Settings

AKA "Signaling Web UI runs in ipfs-desktop"

A clean way to do it is to:

  • ipfs-desktop: inject window.ipfsDesktop into browser window that renders Web UI
    • This is similar to ipfs-redux-bundle detecting window.ipfsCompanion when Web UI runs in WebExtension context of ipfs-companion, but probably requires less code:
      • Electron supports this type of script injection natively – search for preload at https://electronjs.org/docs/api/browser-window
      • We don't need to worry about access controls or changing window.ipfsDesktop.* API in the future (it will only used internally by ipfs-desktop)
  • ipfs-webui: check if window.ipfsDesktop exists and if it does:
    • show settings section specific to ipfs-desktop
    • use methods exposed as window.ipfsDesktop.* for getting/setting settings from ipfs-desktop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants