[coffee] show caffeinate duration in menu bar item#17493
[coffee] show caffeinate duration in menu bar item#17493raycastbot merged 2 commits intoraycast:mainfrom
Conversation
|
Thank you for your first contribution! 🎉 🔔 @mooxl @bibixx @GastroGeek @pernielsentikaer @xilopaint @ridemountainpig @zakj @Visual-Studio-Coder 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. Due to our current reduced availability, the initial review may take up to 10-15 business days |
6cab0dd to
af80b2c
Compare
af80b2c to
860af48
Compare
|
Could we make the time prettier instead of showing 3600s it should be nice to show 1h and string like 5h 30m instead |
There was a problem hiding this comment.
PR Summary
This PR adds functionality to display the caffeinate duration in the menu bar item, enhancing user visibility of the remaining time when using time-limited caffeination.
- Added new
useExtraInfoStrhook inextensions/coffee/src/index.tsxthat extracts duration information from caffeinate process arguments - Implemented display of duration as "For Xs" in the menu bar when Mac is caffeinated with a time limit
- Added a new section in the menu bar UI to show the duration information when available
- Added changelog entry in
extensions/coffee/CHANGELOG.mdbut it's missing the required{PR_MERGE_DATE}template string - The implementation cleanly integrates with existing code to provide useful context to users
💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!
2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
Is there a pre-existing function somewhere that does this that I can import? |
|
You can maybe do something like |
|
Won't this be a bit confusing after some time progresses? For example, if I caffeinate for 2 hours, when there's one minute left to go it will still display "For 7200s". |
I updated it to show the remaining time. Any advice on wording/format would be appreciated. (see updated screenshot) |
|
Thank you, that's so much better! I think "remain" is fine. Other alternatives would be "left", or nothing at all—the time on its own is pretty clear in this context. |
pernielsentikaer
left a comment
There was a problem hiding this comment.
Hi 👋
Looks good to me, approved 🔥
|
Published to the Raycast Store: |
|
🎉 🎉 🎉 Such a great contribution deserves a reward, but unfortunately we couldn't find your Raycast account based on your GitHub username (@kargeor). |
Description
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare located outside the metadata folder if they were not generated with our metadata tool