-
Notifications
You must be signed in to change notification settings - Fork 33
Conversation
Regarding the icon it should be the same as the readme I can provide it to you. |
…nt on taskbar app * Note: To quickly see the changes force the Onboarding component (displaying Terms & Conditions screen) to appear by changing `if (isFirstRun) {` to `if (true) {` in `fether-react/src/App/App.js. The screen should be consistent when you run `yarn taskbar` and `yarn start` * Terms & Conditions updates for consistency and compatibility with taskbar app * Add extra side padding `-padded-extra` to Terms & Conditions so consistent with rest of site and in taskbar app * Wrap with `.terms-and-conditions-wrapper` to add box shadow around both the 'Please read carefully' label and associated Terms & Conditions * Adjust height of `.terms-and-conditions` down to 16rem otherwise with more side padding it causes overflow to occur with vertical scrollbar appearing (checked that it works on both taskbar app i.e. `yarn taskbar` and normal app `yarn electron` or `yarn start`) * Hide `overflow-x` in Terms and Conditions as caused horizontal scroll on taskbar app * Add top margin to Terms and Conditions so extra gap from its 'Please read carefully' label * Only left padding in Terms and Conditions
…stent in taskbar app * Note: To quickly see the changes force the Onboarding component (displaying Terms & Conditions screen) to appear by changing `if (isFirstRun) {` to `if (true) {` in `fether-react/src/App/App.js. The screen should be consistent when you run `yarn taskbar` and `yarn start` * Add eggshell background colour to `body` element otherwise `yarn taskbar` app has grey background (even though running as normal `yarn start` or `yarn electron` app has white background from manifest)
Yes please, should it be the one with the round white background (like the desktop icon)? I can resize it at my end to 40x40 pixels (for retina) and 20x20 pixels |
@ltfschoen A lot of the checkpoints are already solved in |
* Remove TypeScript types (we're not using TypeScript here!) * Add Babel.js to fether-electron package similar to fether-ui * Change to block `onProgress: progress => {` otherwise it doesn't compile * Use https://babeljs.io/docs/en/next/babel-plugin-proposal-class-properties.html
… into ParityEthereum class
…folder. Fix imports
@Tbaut Actually, according to Electron docs theey suggest 16x16, 32x32, 48x48 https://electronjs.org/docs/api/app#appgetfileiconpath-options-callback. Menubar suggests 20x20 |
…it details * Readme updated with environment variable prefix `TASKBAR=false` to disable taskbar. Use existing "electron" and "start" scripts in package.json. Configure taskbar to be enabled by default (i.e. `withTaskbar = true`) * Integrate menubar functionality including for taskbar including: * electron dependencies: `Tray` * electron-positioner: `Positioner` * Separate logic in `FetherApp` component dependending on whether `withTaskbar` is enabled, but shared functionality in `finalise()` function * Incorporate relevant Pino logs throughout to improve developer experience * Move options into FetherAppOptions class and move configuration config for options into a config subfolder within the module. * Use `extends` library to overwrite `DEFAULT_OPTIONS` options properties with those in `TASKBAR_OPTIONS` if `withTaskbar` is enabled * Add ability to pass `customOptions` to further overwrite the values in the config directory, and add option setter and getters * Move taskbar icons into app/options/config subdirectory. Use different logic to set the path of the icons directory depending on whether it was run using the "electron" or the "start" script in package.json. Leverage the fact that when "electron" is run the environment variable `SKIP_PREFLIGHT_CHECK=true` is set * Set the Electron option `webPreferences.devTools` depending on whether we are in production or not particularly for security reasons * Fix `activate` event listener to cater for `withTaskbar` enabled or disabled usage * BUG: When running with `withTaskbar` enabled we are setting the option `show: false` because it opens the window in the center of the screen instead of positioned right under the taskbar icon at the top of the screen. When you click the icon in the taskbar it toggles the window open/close correctly positioned since it takes into consideration the `bounds` value in `FetherApp.clickedTray`. To fix the bug we need to reuse the same approach. * BUG: Additional `EventEmitter` does not appear to be working correctly or is not required. Investigate if can remove
@axelchalon I've Thanks for highlighting how the menu already appears in the 'master' branch on Linux. I found that showing the menu all the time in the existing 'master' branch only works in development though, since when I build .deb and run the binary it auto-hides. If I "hold" ALT and click refresh the menu loads and remains, but when I click the menu it auto-hides. I noticed that running the 'master' branch in development environment it shows the Fether menu and it remains shown after it has finished compiling in the menu bar, and that In any case, clicking the Fether windows and "holding" down ALT key should show the Fether menu, as described here https://electronjs.org/docs/api/browser-window#winsetautohidemenubarhide. Does "holding" down ALT key show the Fether menu for you?? |
Hey, testing with the latest commit, Fether launches with frame and with auto-hiding menu bar. Pressing alt toggles the menu bar. 👍 Well done! |
showDockIcon: true, // macOS usage only | ||
tabbingIdentifier: 'parity', | ||
webPreferences: { | ||
devTools: shouldUseDevTools, // Security |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this a security risk? It helps a lot when users post their console logs, even in production
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't appear to be a security risk as it's not mentioned at the following links:
I've pushed a commit allowing dev tools.
Note that I have not focussed on improving security in this PR. I was going to create a separate PR for security-specific aspects as a result of going through #124.
I created a separate branch a while ago where I started going through security-related aspects 4f6c2fd
Would you like that to remain as a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this PR is big enough, so let's do another security-focused PR
I've found some bugs. I haven't handled re-opening of the window and other methods in |
…oosing Window > Close
I've pushed commits that fix those errors. I've tested that on macOS I can now choose "Window > Close Window" and then afterwards click the small tray icon to re-open the Fether window without any errors. I've also tested that choosing "Window > Close" on Ubuntu Gnome and on Windows 10 doesn't cause any errors. |
@amaurymartiny With regard to the Fether window "frame" and the Fether menu currently we have:
The problem that this presents in the short-term is that the Feedback button is always clipped at the bottom as shown. I could access detect if both process.platform === 'win32' and If we want to auto-hide the menu bar on Windows so that the user can toggle it with the ALT key, then we just need to change it to the following in setupMenu.js
Or even just the following if it still functions correctly on Linux:
That way it will appear as shown below, and the Feedback button would only be clipped when the user toggles the menu to be shown by pressing ALT: |
Wouldn't adding the height of the menu bar to |
tbh I wouldn't mind so much about the feedback button being hidden. The user pressed himself the Alt button, so he knows that it's hidden because of his action, and he can just press Alt again to return to the normal state. We can ask users about this, if it really bothers them. |
I'm actually happy to merge this PR as-is! What do you think @ltfschoen @axelchalon ? |
@axelchalon this works great. @amaurymartiny I think on Windows we should keep the menu shown (without it auto-hiding) in the interim, and use the fix for the feedback button that Axel suggested (I've tested it and it works). |
… to fit the Feedback button since the menu is shown
@amaurymartiny I've pushed a fix that shows the menu all the time on Windows, and so they cannot hide the menu, and adds extra height so the Feedback button is shown |
I'll merge this then. Thanks a lot Luke for this impressive PR! |
Nice! 🎉 |
Wooohooo that's awesome, thank you so much for this crazy work! |
Usage:
Follow steps in
# Usage of taskbar mode
section of update READMENote: If it hangs with a white screen after it has finished loading, then go to Electron menu "View > Reload" (CMD+R on macOS)
Note: Press ALT after clicking Fether window to view the Fether menu on Windows/Linux
TODO
FetherApp
and other classes areFetherAppOptions
andParityEthereum
withTaskbar
boolean argument so we can launch Fether. Use environment variable to disable taskbar mode which is enabled by default whether running "electron" or "start" script. See commit comments for detailsconst { options } = this.fetherApp
)EventEmitter
on fetherApp instance and use to organise pino logging in the same placewithTaskbar
enabled and when setting the optionshow: true
in the
TASKBAR
options, as it incorrectly automatically opens the window in the center of the screen instead of positioned right under the taskbar icon at the top of the screen. Currently the bug isn't noticable because theTASKBAR
option is set toshow: false
, which requires the user to manually click the icon in the taskbar to openthe Fether window.
When you click the icon in the taskbar it toggles the window open/close correctly positioned
since it takes into consideration the
bounds
value inFetherApp.clickedTray
.To fix the bug we need to reuse the same approach.
EDIT: Resolved, just needed to call
showWindow()
when the taskbar was readyUpdate: Tested on macOS Mojave 10.14, Linux Ubuntu Gnome Xenial (Gnome >3), and Windows (Windows 10 Enterprise 64-bit)
Note: Currently being developed on macOS Mojave 10.14. Check that different Parity Fether icon sizes are being used (16x16, 32x32, 48x48).
7z x 1604264.7z
alwaysOnTop: true
process.platform
returnslinux
when running Gnome 3) or higher and run as non-taskbar app (since taskbar apps not allowed on Gnome by default: https://blogs.gnome.org/aday/2018/10/09/farewell-application-menus/.Update: This has not been an issue
export GH_TOKEN="..."
(obtained from GitHub settings) to ~/.bashrc and thensource ~/.bashrc
yarn; yarn build; DEBUG=electron-builder yarn release --linux
is to just runyarn package
export GH_TOKEN="..."
(obtained from GitHub settings) to ~/.bashrc and thensource ~/.bashrc
yarn; yarn build; DEBUG=electron-builder yarn release --mac;
is to just runyarn package
and then run theopen "./packages/fether-electron/dist/mac/Parity Fether.app"
(i.e. no need to install)open /Applications/Parity\ Fether.app/
export GH_TOKEN="..."
(obtained from GitHub settings) to ~/.bashrc and thensource ~/.bashrc
Icon setup tips:
If you have a larger PNG image (i.e. 1024x1024px) and need to produce smaller ones, then in Photoshop select appropriate DPI level (i.e. maintain ~>192 DPI) when reducing image size
Use https://icoconvert.com/ to convert PNG to "ICO for Windows 7, Windows 8, Vista and XP", outputs a 256x256 .ico file
In electron-builder.json specify location of .ico file relative to /build directory, otherwise it uses the smallest size PNG file (which looks poor quality)
Debug using
DEBUG=electron-builder yarn release
References:
Fix tests to use Jest and make all existing tests pass (see review comment)
Refactor methods in FetherApp class into a 'methods' folder so the class isn't monolithic
Create custom 16x16 icon for taskbar using monochrome (see review comment)
Security modifications to be handled in a separate PR and adopt techniques from https://github.com/parity-js/shell/tree/master/electron, review these guidelines Code Review, volunteers needed #124, and branch 'luke-312-taskbar-app-security'
Add tests for good measure where necessary
BONUS: Arrow adjacent to the window
Screenshot: