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

No tooltip when the cursor hovers over tray icon #1081

Open
diogoan opened this issue Oct 8, 2024 · 4 comments
Open

No tooltip when the cursor hovers over tray icon #1081

diogoan opened this issue Oct 8, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@diogoan
Copy link

diogoan commented Oct 8, 2024

Describe the issue
There is no tooltip (like the app name) when the mouse cursor is on the application icon on the tray area. This is not a breaking issue, but I thought it could be reported. Also, some functionality may be added in the tooltip (like how many hours were worked today, or what is the time to leave).

To Reproduce
Steps to reproduce the behavior:

  1. Just position the cursor on the app's icon in the tray area.

Expected behavior
A tooltip should appear, containing, at least, the app's name.

Environment

  • Version: 3.0.0
  • Electron: 11.5.0
  • Chrome: 87.0.4280.141
  • Node.js: 12.18.3
  • OS: Windows_NT ia32 10.0.19045

Screenshots
v0jETCRik7
(yep, I use my taskbar at the left of the screen)

Additional context
Nothing to add.

@diogoan diogoan added the bug Something isn't working label Oct 8, 2024
@diogoan
Copy link
Author

diogoan commented Oct 9, 2024

Adding a tooltip to the tray icon is as simple as inserting the following line:
tray.setToolTip('Time to Leave')
Source: https://www.electronjs.org/docs/latest/api/tray

I can volunteer to send a PR fixing this issue, but I'll need some work to figure out how to insert some more functionality to it, like it saying "You can leave by 6:05 PM".

@thamara
Copy link
Owner

thamara commented Oct 13, 2024

I think having the tooltip is already a great start.
From what I can tell, there is no event like "requested tooltip", so it might not be trivial to set the tooltip.
An idea is to update the tooltip as necessary.
For example: Whenever there's a new entry -> Update tool tip with "You can leave by XX:XX". This would work if you just started your day, or if you are leaving or coming back from lunch for example. We could even do some math to, let's say, if the person filled an even number of entries, we could say something like: "You worked XX:XX today." if the total time suppress the usual amount set on the preferences. Or "More XX:XX to go." if the total time is less.
If going on this direction (even on a reduced scope of always saying just "You can leave by...", we should make sure to update the tooltip not only on adding/removing entries, but also refreshing for a new day (follow the REFRESH_ON_DAY_CHANGE).

Does this make sense?
@diogoan do you want take on this?

@diogoan
Copy link
Author

diogoan commented Oct 14, 2024

Hi @thamara, I was giving some thought to it and I think we should keep it simple. If we follow the same logic as the app, we only would have to display the "You can leave by XX:XX" message on the tooltip when there's a punch, and a "Today's balance: XX:XX" message when the time to leave is past.

This is because I don't see any feature for displaying the worked time or the "More XX:XX to go" phrase, so I believe it is not the purpose of the app (or is it? I'm just using the app since last week), and we would need extra logic to calculate the times. For the other two messages, we just need to reuse the existing logic in the code that is already working.

I can take on this, in fact I already did the tooltip just for the "Time to Leave" title, but for the other two strings, I need to research some more in the code to get acquainted to it.

Thank you!

@thamara
Copy link
Owner

thamara commented Oct 14, 2024

Makes sense, I got a bit carried away with the possibility of being very dynamic with a sprinkle of a motivational coach. Hahahahha
Please go ahead with the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants