-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Tray icon #1005
Tray icon #1005
Conversation
Signed-off-by: Roman <ixrock@gmail.com>
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 do we still have the kontena logo in master?
Looks pretty good
Kontena refuses to die 😂 |
Signed-off-by: Roman <ixrock@gmail.com>
Couple of usage issues / enhancement requests:
|
Signed-off-by: Roman <ixrock@gmail.com>
Signed-off-by: Roman <ixrock@gmail.com>
Signed-off-by: Roman <ixrock@gmail.com>
This error possibly causing integration tests start failing. |
- optimization: don't re-create tray icon on menu udpates (avoid blinking) Signed-off-by: Roman <ixrock@gmail.com>
Signed-off-by: Roman <ixrock@gmail.com>
# Conflicts: # src/renderer/components/cluster-manager/cluster-view.tsx
Signed-off-by: Roman <ixrock@gmail.com>
Signed-off-by: Roman <ixrock@gmail.com>
src/common/base-store.ts
Outdated
@@ -73,7 +75,9 @@ export class BaseStore<T = any> extends Singleton { | |||
|
|||
enableSync() { | |||
this.syncDisposers.push( | |||
reaction(() => this.toJSON(), model => this.onModelChange(model)), | |||
reaction(() => this.toJSON(), model => this.onModelChange(model), { | |||
delay: this.params.syncDelayMs, |
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 do we need a delay now?
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 was added to avoid possible infinite cycle of saving store.json in some cases when update comes from renderer
(don't remember exact case, usually hard to reproduce)
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.
I ran into something like that too. The fix that I used was making sure any updates happen within the store class and are marked as @action
that way multiple deep updates don't cause an infinite loop. But if you have tried that this might help
Signed-off-by: Roman <ixrock@gmail.com>
Investigated integration tests failures. They are now failing because we introduced new window for Tray and tests are expecting certain amount of windows. To fix those please modify
However, after fixing that, tests revealed a real problem. When adding new cluster, the cluster activation happens before the cluster is added in cluster store on main process. |
# Conflicts: # src/renderer/components/+add-cluster/add-cluster.tsx # src/renderer/components/+cluster-settings/cluster-settings.tsx
Signed-off-by: Roman <ixrock@gmail.com>
# Conflicts: # locales/en/messages.po # locales/fi/messages.po # locales/ru/messages.po
Signed-off-by: Roman <ixrock@gmail.com>
@nevalla integration on linux failed again for some reasons.. and why I actually can't re-run it? (but clicking to "Re-run" says only it's has been requested). |
package.json
Outdated
@@ -200,6 +208,7 @@ | |||
"openid-client": "^3.15.2", | |||
"path-to-regexp": "^6.1.0", | |||
"proper-lockfile": "^4.1.1", | |||
"react": "^16.13.1", |
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 react moved here?
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.
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.
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.
And seems like it's requested by react-router
in runtime in main
process (need to refactor navigation.ts
to get rid of this dependency)
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.
@jakolehm did refactoring and now react
and react-router
not required to be runtime dependencies. PTAL.
…` and `react-router` not required as package.json dependecies in runtime (main) Signed-off-by: Roman <ixrock@gmail.com>
const browserWindow = await windowManager.ensureMainWindow(); | ||
showAbout(browserWindow); |
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.
Does the "About Lens" dialog have to depend on the browserWindow's existence? This means, if not already open, the user must wait for the splash window and browser window to come up before seeing "About Lens". Maybe the splash window can be skipped? Though maybe there is still a delay for the browser window?
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 and I don't know if it's technically possible to show the dialog without it.
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.
src/main/tray.ts
Outdated
label: "Check for updates", | ||
async click() { | ||
const result = await AppUpdater.checkForUpdates(); | ||
const browserWindow = await windowManager.ensureMainWindow(); |
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.
Can this line be inside the if (!result) { ... }
? I'm not sure what happens when result
is true
(Does there still need to be a browserWindow
?)
// load & show app | ||
this.showMain(); | ||
initMenu(this); | ||
async ensureMainWindow(): Promise<BrowserWindow> { |
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.
could take showSplash
param and pass on to initMainWindow()
?
@@ -57,4 +57,8 @@ | |||
box-shadow: 0 0 0 1px $borderFaintColor; | |||
} | |||
} | |||
|
|||
.Checkbox { | |||
align-self: start; // limit clickable area to checkbox + text |
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.
thanks for adding comments! I get lost easily in css files :)
@@ -303,12 +309,15 @@ | |||
"postinstall-postinstall": "^2.1.0", | |||
"progress-bar-webpack-plugin": "^2.1.0", | |||
"raw-loader": "^4.0.1", | |||
"react": "^16.13.1", | |||
"react": "^16.14.0", |
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.
Does this PR require React upgrade?
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.
Nope.
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.
Should we revert? Not that many changes in that release: https://github.com/facebook/react/blob/master/CHANGELOG.md#16140-october-14-2020
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 it's even matter? :) It is not a major release update.
@ixrock integration tests are failing (I have triggered restart but it didn't help). |
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
Current implementation sets icon color depending on electron's API |
@ixrock this needs conflict resolve. |
# Conflicts: # package.json # src/common/user-store.ts # src/common/workspace-store.ts # src/main/index.ts # src/main/window-manager.ts # src/renderer/components/+cluster-settings/cluster-settings.tsx # src/renderer/components/+preferences/preferences.tsx # src/renderer/components/cluster-manager/cluster-manager.tsx # src/renderer/components/cluster-manager/clusters-menu.tsx # src/renderer/components/layout/sidebar.tsx # yarn.lock
Signed-off-by: Roman <ixrock@gmail.com>
Signed-off-by: Roman <ixrock@gmail.com>
# Conflicts: # package.json
Signed-off-by: Roman <ixrock@gmail.com>
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.
LGTM
Tray icon and menu (enabled by default)
Added preferences
app.setLoginItemSettings
, enabled by default)close #833