extensions icon indicating copy to clipboard operation
extensions copied to clipboard

[toggl-track] Add menu bar command

Open lukebars opened this issue 1 year ago • 4 comments

Description

There's only one thing I couldn't make to work perfectly - instant lifecycle update on menuBar. Something takes a bit longer to refresh on the extensions logic, than the async calls take, so the menuBar goes to sleep and it needs to wait the intervalTime (which is 10 seconds) to update the bar or the user has to click it to refresh the display.

One dirty fix would be to add something like this to both onActions:

              await new Promise((r) => setTimeout(r, 1000));

Not sure if I want to go that route.

Anyways, this PR adds a great functionality to this extension and also brings a heap of fixes.

Here's the changelog:

[Bug Fixes] - 2024-07-10

  • Do not show currently running time entry in the recent time entries list

[Bug Fixes] - 2024-07-05

  • Fix running time entries not showing project details

[New Feature] - 2024-07-05

  • Add ability to view, start, or stop existing time entries from the Menu Bar Solves #13165

Screencast

Menu bar when running: Menu bar when running

Expanded menu when running: Expanded menu when running

Expanded menu when stopped: Expanded menu when stopped

Previously Start/Stop Timer Entry Window didn't show the running time entry details, because of coding error (here's an example from live plugin version): image

Fixed: image

Checklist

lukebars avatar Jul 05 '24 18:07 lukebars

Thank you for your contribution! :tada:

🔔 @franzwilhelm @bkeys818 @michaelfaisst @teziovsky you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

You can expect an initial review within five business days.

raycastbot avatar Jul 05 '24 18:07 raycastbot

@bkeys818

Great work! The refactoring is done super well!

Thanks! I'm new to Raycast Plugins development, so this was fun.

  1. You may want to add a user setting that defines whether the time entry name and/or duration is displayed in the menu bar.

Done ✅ I've added some extra options, if somebody wanted to see client/project also. The default is description only: image

  1. I recommend calling the menu bar refresh command after starting or stopping a time entry to insure that it's updated as soon as possible.

Could you direct me how it's done? I can't find any methods for refreshing the menu bar in Raycast documentation.

lukebars avatar Jul 05 '24 21:07 lukebars

The changes look great!

I'm actually not sure how to manually refresh the menu bar. You may want to reach out to the Raycast Developer Discord.

bkeys818 avatar Jul 08 '24 21:07 bkeys818

The changes look great!

I'm actually not sure how to manually refresh the menu bar. You may want to reach out to the Raycast Developer Discord.

Can we get this PR merged then?

lukebars avatar Jul 09 '24 05:07 lukebars

I've added some workarounds for the menu bar to refresh, also fixed some bugs I've found and cleaned up the codebase even further.

lukebars avatar Jul 11 '24 06:07 lukebars

@bkeys818 I've fixed all the things you've mentioned

lukebars avatar Jul 26 '24 13:07 lukebars

@mil3na I guess we can go forward with the merge? 🙌

lukebars avatar Jul 27 '24 17:07 lukebars

As soon as you fix the conflicts, I can do one final review, yes :D

mil3na avatar Jul 29 '24 12:07 mil3na

This was fun! :D Conflicts are solved

lukebars avatar Jul 29 '24 13:07 lukebars

As soon as you fix the conflicts, I can do one final review, yes :D

@mil3na just checking, are we doing the final review anytime soon? I'd love to avoid another conflict solving session 😅

lukebars avatar Jul 30 '24 19:07 lukebars

Published to the Raycast Store: https://raycast.com/franzwilhelm/toggl-track

github-actions[bot] avatar Jul 31 '24 08:07 github-actions[bot]

:tada: :tada: :tada:

Such a great contribution deserves a reward, but unfortunately we couldn't find your Raycast account based on your GitHub username (@lukebars). Please link your GitHub account to your Raycast account to receive your credits and soon be able to exchange them for some swag.

raycastbot avatar Jul 31 '24 08:07 raycastbot

Am I still eligible for the swag credits after linking my account? 😆

lukebars avatar Jul 31 '24 08:07 lukebars

Yes!

mil3na avatar Jul 31 '24 10:07 mil3na