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 messages notification should show mainwindow and/or add an overlay Image #367

Closed
fcoppolani opened this issue Feb 23, 2017 · 11 comments
Closed

Comments

@fcoppolani
Copy link

OS: Windows 7 and Windows 10
Current app version : 2.3.0

  • [x ] I have tested with the latest application version
  • [x ] I can simulate the issue easily

Description

Hi,

During test phase in our company we add several issues with notifications. Part of them seems to be solved by #353 , but most users still miss some features.

Current Behavious :

If the app is still visible in the taskbar and a new message fireup, no visual effect indicate this information (part from flashing which doesn't work on 2.4.0).
If the app is in the tray, no information is visible in the taskbar, so it is mainly invisible.

Expected Behavior

One of them is to have a visual effect on the taskbar icon (not only tray).
The second one is to have the main window show up without focus.

To do that (I worked on 2.3.0 src code), I changed tray.js :

Taskbar visual effect :

Adding an image : const _iconTBAlert = path.join(__dirname, 'images', icons[process.platform].dir, icons[process.platform].iconAlert || 'changes.png');
And in showTrayAlert adding an overlay : mainWindow.setOverlayIcon(_iconTBAlert, "new message");
and resetting it if showAlert is false : mainWindow.setOverlayIcon(null,"saved changes");

Show mainwindow :
in showTrayAlert adding mainWindow.showInactive();

For now I didn't fill up a pull request, since I would like to have your point of view and I cannot test my modifications on linux and OSX. Moreover the overlay image may not fit the global design of Rocket.Chat.

If validated I can add a pull request on the current branch, I would need a validated overlay image.

Regards,

@chrism113
Copy link

Looks similar to #213

Would love to see this added.

@chrism113
Copy link

chrism113 commented Apr 3, 2017

so something like this works in windows:

if (!mainWindow.isVisible()) {
	mainWindow.showInactive();
	mainWindow.minimize();
}

@fcoppolani
Copy link
Author

Yes indeed, much better, I would like to add that in this case the mainWindow.showInactive(); is useless mainWindow.minimize(); only is enough.

I have included the code for 2.5.0, if I have enough time I will create a pull request on develop.

@chrism113
Copy link

In my testing, showInactive was needed.

When using only minimize, the window would appear minimized and have focus. This meant the program would only stay orange in the taskbar for a few seconds before stopping. After adding in the showInactive, it would stay orange until i clicked on it.

@chrism113
Copy link

chrism113 commented Apr 4, 2017

After yet more testing, i think i've found the best solution. With showInactive, you could get a brief view of the window appearing before being minimized. The blur() method will remove focus from the minimized window so that the "taskbar flash" won't go away.

	if (!mainWindow.isVisible()) {
		mainWindow.minimize();
		mainWindow.blur();
	}

fcoppolani pushed a commit to fcoppolani/Rocket.Chat.Electron that referenced this issue May 18, 2017
@fcoppolani
Copy link
Author

@gdelavald
Copy link
Contributor

@fcoppolani Hey, please check the current changes made to the notification, if your code still improves it, please open a PR. Thank you.

@gdelavald gdelavald added this to the 3.0.0 milestone Aug 17, 2017
@fcoppolani
Copy link
Author

Hi @gdelavald, sorry for the delay, I tried out the last version. It looks good enough to me, I still believe an overlay image on the icone in the taskbar will still be an improvement (the best would be with a number of message, like on the tray icone).

@engelgabriel
Copy link
Member

@engelgabriel engelgabriel modified the milestones: 2.10.0, 2.13.0 Aug 14, 2018
@chrism113
Copy link

I just tested 2.12.1 on Windows 10. After receiving a message and the toast times out, there is still no persistent visual to let you know someone messaged you while you were away from your desk.

@engelgabriel
Copy link
Member

OK, we will work on that.

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

No branches or pull requests

5 participants