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

feat: just a menubar #866

Merged
merged 19 commits into from
Mar 14, 2019
Merged

feat: just a menubar #866

merged 19 commits into from
Mar 14, 2019

Conversation

hacdias
Copy link
Member

@hacdias hacdias commented Mar 12, 2019

I've taken a bit of time today to work on this since I really enjoyed the idea - and I liked the result very much. Don't get mistaken by the 'wip' in the title. The only thing missing are changes to the README 😄The software is workiiiiiing!

It is working on macOS and Windows. It is supposed to work better on Linux now since we don't have the issue of which 'screen' is showing (some envs would just show the menubar with options on either click).

Windows

macOS

Please read #865 for further background information. @ericronne suggested to collapse the Web UI options (from Status to Peers) into one 'Open Web UI'. Although I actually like the current configuration. Please try it out!

Wonder if in the future we wouldn't be able to ditch Electron and open Web UI on user's browser and use Qt for the menubar.

TODO

  • Update README screenshot

@ghost ghost assigned hacdias Mar 12, 2019
@ghost ghost added the in progress label Mar 12, 2019
@hacdias
Copy link
Member Author

hacdias commented Mar 12, 2019

@ipfs-shipyard/gui I need y'all here 😄 This is a big change!

hacdias and others added 3 commits March 12, 2019 23:46
On Linux in order for changes made to individual MenuItems to take
effect, you have to call setContextMenu again.

Without this, updateStatus(status) in src/lib/tray.js does not  update
the menu.

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
@ghost ghost assigned lidel Mar 13, 2019
Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Menu did not update on Linux (i3bar), but I've found a fix (see cab400c) and it displays updated menu correctly on right-click now:

2019-03-13--02-30-53

Not sure why left-click does not work, perhaps it is i3bar I use for tray.
(this should not block this PR, we can investigate this later).

Quick thoughts on menu itself:

  • Settings should be moved out of "Advanced" to the top level, and be in the same order as in Web UI (under "Peers"), to minimize user confusion :)
  • "Check for updates" could be moved to "Advanced" submenu to declutter UI a bit
  • Overall, I like it a lot! This change makes it feel light and snappy.

@hacdias
Copy link
Member Author

hacdias commented Mar 13, 2019

@lidel

Not sure why left-click does not work, perhaps it is i3bar I use for tray.

I think what I just pushed might fix that.

Settings should be moved out of "Advanced" to the top level, and be in the same order as in Web UI (under "Peers"), to minimize user confusion :)

Yas. Talking about that: we only have three options in settings related to Desktop. Perhaps they could be checkbox-type buttons on a Preferences sub-menu where the user could activate them and deactivate them.

"Check for updates" could be moved to "Advanced" submenu to declutter UI a bit

Yeah!

Overall, I like it a lot! This change makes it feel light and snappy.

Feels light, but it isn't light... In the future I'd like to investigate possible ways of moving out of Electron. It would be lighter and perhaps even/actually more native.

Perhaps native implementations for each OS with a C/C++/Go shared library. Thinking too much? After this is closes, I'll certainly open an issue about the nativeness of our app and what we can do to make it better. Or perhaps native apps that rely on our Node library which must be possible too.

@olizilla
Copy link
Member

I really like it. I think we could drop the third divider.

something like

- IPFS is running
- About IPFS Desktop
---
- View Status
- View Files
- View Settings
---
Advanced ▸           Stop IPFS daemon
Quit                 Open repo directory
                     Open logs directory
                     Check for updates
                     _Versions_
                     IPFS Desktop 0.7-rc4
                     go-ipfs 0.4.19                              
  • We don't need to list out all peers and explore from the main navbar, just the most useful ones. Also this avoids the "am i opening the Desktop app, or the Web UI, what should I call it?" question.
  • Move "Stop IPFS" to the advanved menu. It should be available, but not one of the main things.
  • At this early stage, while we're still getting the auto update mechanism working, it's useful to have an easy way to see the versions, so push them into the advanced section too.

And what about adding a link to docs.ipfs.io? this'd draw more attention to it and encourage us to add a section on Desktop and Web UI.

@olizilla
Copy link
Member

also of note, the status link isn't working for me.

@hacdias
Copy link
Member Author

hacdias commented Mar 13, 2019

@olizilla will restructure that way! Seems a good idea.

also of note, the status link isn't working for me.

Neither for me, thanks for noticing.

@hacdias
Copy link
Member Author

hacdias commented Mar 13, 2019

Current status:
Screenshot 2019-03-13 10 43 22

@hacdias hacdias changed the title wip: just a menubar feat: just a menubar Mar 13, 2019
@fsdiogo
Copy link
Contributor

fsdiogo commented Mar 13, 2019

Move "Stop IPFS" to the advanced menu. It should be available, but not one of the main things.

@olizilla I don't think so, especially when you want to start the node again:

desktop

It's pretty odd finding that function buried, and having the About being the second item too. The About should be between Advanced and Quit (most of the mac apps have about before the quit).

@hacdias
Copy link
Member Author

hacdias commented Mar 13, 2019

@fsdiogo: It's pretty odd finding that function buried, and having the About being the second item too. The About should be between Advanced and Quit (most of the mac apps have between before the quit).

Yeah, I agree with those two.

@hacdias
Copy link
Member Author

hacdias commented Mar 13, 2019

And perhaps we could hide the versions behind 'About IPFS Desktop'. Instead of opening the repository, we could show a simple informational dialog.

@fsdiogo
Copy link
Contributor

fsdiogo commented Mar 13, 2019

Hmm yeah, if that dialog is customisable we can have the links to the repos there!

@olizilla
Copy link
Member

olizilla commented Mar 13, 2019

@fsdiogo I was following the example of Docker for Mac. I don't find it weird, but I don't feel strongly about it.

I don't think "Stop IPFS" should be in the main menu. A user has to restart IPFS to make a config change, but we should offer that option in the UI, when they make a config change. In the meantime we could add a "Restart IPFS" option to either the advanced, or the main menu if you feel strongly that it should be there.

My assumption is that for most users, we'd like them to be able to set their node up once (ideally just run with the defaults) and then leave IPFS running. If IPFS takes too much resources, we should limit it. We just dropped the number of open connections it'll try and make from 600+ to about 150, which should help.

@hacdias
Copy link
Member Author

hacdias commented Mar 13, 2019

@lidel how do you feel about this?

@fsdiogo
Copy link
Contributor

fsdiogo commented Mar 13, 2019

I don't think "Stop IPFS" should be in the main menu. A user has to restart IPFS to make a config change, but we should offer that option in the UI, when they make a config change. In the meantime we could add a "Restart IPFS" option to either the advanced, or the main menu if you feel strongly that it should be there.

@olizilla the idea of restarting through Web UI is great 👌 I feel strongly that it shouldn't be in the advanced, and we should have the option to Start and Stop instead of just restarting.

docker

@hacdias as we're talking about Docker, this About window looks good don't you think?

info

@lidel
Copy link
Member

lidel commented Mar 13, 2019

  • Start/Stop/Restart actions could land under the Status item.
  • Web UI items also could be moved it own submenu, but personally I prefer to keep them at the top-level. I'd like "Files" to be super easy to access.
  • I don't like "View" and "Open" being repeated in UI, so I would just drop them from labels.
IPFS is running ▸    Restart
                     Stop
---
Status
Files
Peers
Settings  
---
Advanced ▸           Logs Directory
                     Repo Directory
                     IPFS Desktop Configuration File

About ▸              About IPFS Desktop
                     Check for Updates
                     _Versions_
                     ipfs-desktop 0.7-rc4
                     go-ipfs 0.4.19
Quit

@hacdias
Copy link
Member Author

hacdias commented Mar 13, 2019

@fsdiogo I really like Docker's about page. Although remember: that's a native window. We can't do one as native as that one. What we could do is create a very simple web page to show. Again - it would be really nice if in the feature we could have really native apps for each platform.


@lidel I like the idea of starting/stopping and restart being under the status item.

I agree with dropping 'Open' and 'View' labels.

I personally don't like having those options under 'About'. It feels weird to me.


Another interesting thing is that on macOS we usually see 'Per Word Capitalisation' and on Windows we have 'Per sentence capitalisation'.

@olizilla
Copy link
Member

I think we are zooming in on an ideal list. I like @lidel's proposal, pulling the start and restart under the status seems neat.

In general think the menu items should be things you can do, so verbs rather than nouns.

  • I feel strongly that actions that open directories should start with "Open" e.g " Open logs directory"
  • I can live with the links to the web ui sections not starting with "View", as I agree, the reptition looks odd, but in general, I'm in favour of explicit and clear over terse and more visually pleasing where menu options are concerned.
  • I like @fsdiogo's ask for an about dialog, but perhaps lets keep it as menu options for now to keep this PR focused.
IPFS is running ▸    Restart
                     Stop
---
Status
Files
Settings  
---
Advanced ▸           Open logs directory
                     Open respository directory
                     Open configuration file

About ▸              _Versions_
                     ipfs-desktop 0.7-rc4
                     go-ipfs 0.4.19
                     ----
                     Check for Updates...
                     View on Github

Quit

@hacdias
Copy link
Member Author

hacdias commented Mar 13, 2019

@olizilla I agree with that disposition. What do you think @lidel @fsdiogo?

@olizilla
Copy link
Member

olizilla commented Mar 13, 2019

If you can't put stop and restart under a submenu, then just inline them.

🍏 IPFS is running
Restart
Stop
---
Status
Files
Settings  
---
Advanced ▸           Open logs directory
                     Open respository directory
                     Open configuration file

About ▸              _Versions_
                     ipfs-desktop 0.7-rc4
                     go-ipfs 0.4.19
                     ----
                     Check for Updates...
                     View on Github

Quit

@hacdias
Copy link
Member Author

hacdias commented Mar 13, 2019

Done:

image


### IPFS daemon always running

IPFS Desktop's main feature is to allow you to have the IPFS daemon always running in the background. But fear not! If you need to stop it, you can do it under the 'Advanced' options.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

middle=$(($3 / 2))
center=$((middle - 1))

convert -size "$3x$3" xc:transparent \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very cool

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not for this PR, but would be good to document the dependencies for running this script.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do later :) I can even just add a comment there or add to the README. There's something I don't really like about that: not sure if the sizes are perfect. They look good but it seems that they're not as correct as they should be. But we can take a look at that later.

Copy link
Member

@olizilla olizilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! It feels so much snappier and integrated as an OS menu. This PR is really neat too.

I've left some minor feedback inline, and also, note that the "stopped" circle indicator is almost invisible on macos:

Screenshot 2019-03-14 at 09 04 51

},
{
label: i18n.t('openConfigFile'),
click: () => { shell.openItem(store.path) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about exposing the IPFS Desktop config file to users. It's confusing that it isn't related to the much more documented IPFS config.

I'm not gonna block the PR for this, I just want to flag that my expectation here was that it'd open the IPFS config file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we already had that possibility. It might be useful for someone who wants to change the flags that we use to run the daemon.

const updateStatus = data => {
status = data

menu.getMenuItemById('ipfsIsStarting').visible = status.starting && !status.done
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just setting the status to one of these string values in the first place? with the collection of booleans, it's harder to be sure that we have covered every eventuality. If status can only be 1 string, then we can quickly scan the deamon init code to see all the possible values, and we can just use it directly here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I wanted to make those constants and just compare. I'll do that in another PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be even better to just change the text and the icon... But this is not native and Electron doesn't let us do that.

@hacdias
Copy link
Member Author

hacdias commented Mar 14, 2019

@olizilla I'll update the circle in another PR and the other things you've mentioned!

@hacdias hacdias merged commit 2e7fd29 into master Mar 14, 2019
@hacdias hacdias deleted the feat/just-menubar branch March 14, 2019 09:42
@ghost ghost removed the in progress label Mar 14, 2019
@alanshaw
Copy link
Member

w00t! ship it!

@lidel
Copy link
Member

lidel commented Mar 15, 2019

Not sure why left-click does not work, perhaps it is i3bar I use for tray.
(this should not block this PR, we can investigate this later).

For the record:
I just re-tested in v0.7.0 and the issue is fixed there (menu pops up for both left and right clicks) 🚀 👍

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

Successfully merging this pull request may close these issues.

5 participants