Repository navigation
Add pitchfork-daemons extension - #33771
Conversation
|
Congratulations on your new Raycast extension! 🚀 We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days. Once the PR is approved and merged, the extension will be available on our Store. |
[Medium impact] No outstanding findings block merging. SummaryAdds Pitchfork daemon controls to Raycast.
Reviews (8) · Last reviewed commit: "Update CHANGELOG.md and optimise images" · Reviewed by Greptile |
0xdhrv
left a comment
There was a problem hiding this comment.
Hey @moeriki 👋
Thanks for bringing Pitchfork to Raycast, and for never starting the supervisor on its own, with a clear Start Supervisor action instead, so a click can't launch anything by surprise 🔥
Here's everything I found in this pass:
Should fix
-
The Start, Stop and Restart items in the Running Daemons menu bar command go through
runAction(src/menu-bar.tsxline 14), andrunActioncallsshowToastfirst (src/ui.tsxline 24), outside itstry. Menu bar commands run in the background, where the Toast API isn't available, so it throws "Toast API is not available when command is launched in background" beforecontrolruns and the menu item does nothing. Could you useshowHUDfor the click feedback whenenvironment.commandModeis"menu-bar"? For example:if (environment.commandMode === "menu-bar") { try { await control(action, ids); await showHUD(`${VERB[action]} finished`); return true; } catch (error) { await showHUD(`Could not ${action} ${label}`); return false; } }
-
In the same menu bar command, the Start Pitchfork Supervisor item awaits
startSupervisor()with notryandcatch(src/menu-bar.tsxline 37), so a failed start ends as an unhandled error on the menu item. Could you catch it and show the message withshowHUD?
Optional
- The README asks for Pitchfork 2.30 or newer, but nothing in the code checks the installed version. If someone has an older build, they see whatever raw error the CLI prints. You could read
pitchfork --versiononce and show an "Update Pitchfork" message in the Could not read Pitchfork view.
Feel free to reach me here or on Slack if anything is unclear.
Menu bar commands run in the background, where the Toast API is not available, so Start, Stop and Restart threw before running. They now report through showHUD, and a failed supervisor start is caught and shown the same way. When listing daemons fails, check pitchfork --version and show an Update Pitchfork message for versions older than 2.30.
The menu bar command runs in the background, where the Toast API is not available, so showFailureToast would throw instead of showing the failure.
|
Hey @0xdhrv, thanks for the careful review, and for the snippet. You were right on all three. Should fix
Optional
One more of the same kind While I was in there I found that the menu bar's "Search Daemons…" item still reported a failed launch through Testing I tested in Raycast against throwaway daemons: Start, Stop and Restart from the menu bar each change the daemon's state and show a HUD, including a daemon that fails on start. With the supervisor stopped, "Start Pitchfork Supervisor" brings it back and the list returns. I couldn't provoke a supervisor start failure or a failed "Search Daemons…" launch, so those two error HUDs are untested. Marking this ready for another look. Thanks again! |
|
Published to the Raycast Store: |
|
🎉 🎉 🎉 We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag. |
Description
Adds Pitchfork Daemons, for the Pitchfork daemon supervisor (not the music site). Search Daemons lists every daemon by namespace and starts, stops, restarts, opens or shows the logs of one daemon or a whole namespace; Running Daemons shows the running count in the menu bar.
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