Repository navigation
Update toothpick extension - #26147
Conversation
- lint - Fix CHANGELOG - Removed a layer of abstraction from refresh-device.ts by calling services directly - Merge pull request raycast#2 from merchako/codex/add-refresh-action-for-bluetooth-connections-1k5myo - Finalize refresh changes and update manifest/changelog for Raycast contribution - Initial commit - Initial commit - Initialize repository
|
Thank you for your contribution! 🎉 🔔 @VladCuciureanu @briankosw @sxn @rspeicher @AntonNiklasson @xmok 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. 📋 Quick checkout commandsBRANCH="ext/toothpick"
FORK_URL="https://github.com/merchako/raycast-extensions.git"
EXTENSION_NAME="toothpick"
REPO_NAME="raycast-extensions"
git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run devWe're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days. |
Greptile SummaryThis PR adds a suite of "Refresh" commands to the Toothpick extension, covering per-device reconnect (disconnect → wait → reconnect), favorite-device shortcuts, and a Bluetooth power toggle (
Confidence Score: 5/5The changes are additive, all new commands are disabled by default, and the core logic closely mirrors existing connect/disconnect patterns. All new handlers are isolated, error paths are properly guarded, and the only finding is a convention nit in the changelog date placeholder. No files require special attention beyond the Important Files Changed
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
extensions/toothpick/CHANGELOG.md:3
The changelog entry uses a hardcoded date instead of the `{PR_MERGE_DATE}` placeholder. Raycast's release tooling automatically populates the placeholder at merge time; a hardcoded date will not be updated and may diverge from the actual merge date.
```suggestion
## [Refresh Device and Refresh All Commands] - {PR_MERGE_DATE}
```
Reviews (5): Last reviewed commit: "Update CHANGELOG.md" | Re-trigger Greptile |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…th.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
|
Thanks for the update @merchako @VladCuciureanu can you give this a spin? |
I'm afraid not. Schedule doesn't allow me to work on side-projects. |
pernielsentikaer
left a comment
There was a problem hiding this comment.
Hi @merchako 👋
I have some feedback when I checked the code 🙂
-
Empty
.gitkeepfile added — extensions/toothpick/.gitkeep is a new empty file with no purpose. Should be removed 🙂 -
refresh-allis instant off→on with no delay —blueutil -p 0 && blueutil -p 1turns BT off then immediately back on. For devices that are "stuck", this may not give enough time for the radio to fully power down. A smallsleep 1between the two commands would be more reliable:blueutil -p 0 && sleep 1 && blueutil -p 1. -
Hardcoded 2-second delay in
refresh-device.ts— setTimeout(resolve, 2000) is a magic number. Should at minimum be a named constant. Could also consider making it configurable or at least documenting why 2s was chosen. -
refreshDeviceduplicates connect/disconnect logic — refresh-device.ts calls devicesService.disconnectDevice() and devicesService.connectDevice() directly rather than reusing connectDevice() and disconnectDevice() from the existing handlers. This means it doesn't get the closeOnSuccessfulConnection behavior consistently and has its own message flow. It does handle closeOnSuccessfulConnection at the end, but the disconnect path doesn't respect it. -
connect-device.tsside effect: now returnsboolean— The existing connectDevice handler was changed to return !!result, and disconnectDevice similarly. These return values aren't used by existing callers. The change to showErrorMessage instead of showSuccessMessage on failure is a good bugfix, but the return value addition is dead code outside of the new refresh path (and refresh doesn't even use these handler functions). -
Greptile flag is valid — The "Refresh" action in devices.model.tsx is inserted at index 1 (between Connect/Disconnect and Copy MAC Address). This extension's action list is ordered, and Refresh should probably go after Copy MAC Address, before ...additionalActions.
-
refresh-device.tsuses raw arrow function export — export default async (props) => {...} instead of a named function like the other command files (export default async function Command()). Minor consistency issue. -
AppleScript backend
refreshBluetooth()silently returnsfalse— No user-facing message explains that Refresh All isn't supported on the AppleScript backend. The refresh-bluetooth.ts handler hardcodes getDevicesService("blueutil") which is good, but if someone calls refreshBluetooth() on the AppleScript service directly through the Manage panel, it silently fails. Not a real issue since refresh-all forces blueutil, but worth noting for interface completeness.
I converted this PR into a draft until it's ready for the review, please press the button Ready for review when it's ready and we'll have a look 😊
|
This pull request has been automatically marked as stale because it did not have any recent activity. It will be closed if no further activity occurs in the next 7 days to keep our backlog clean 😊 |
|
This pull request has been automatically closed due to inactivity. Feel free to comment in the thread when you're ready to continue working on it 🙂 You can also catch us in Slack if you want to discuss this. |
|
Thanks for the thorough review! Here's what was addressed: Resolved:
Not addressed:
|
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
Requesting a re-open @pernielsentikaer |
|
Anybody able to reopen this for me? @VladCuciureanu @briankosw @VladCuciureanu @sxn @pernielsentikaer @rspeicher @VladCuciureanu @AntonNiklasson @xmok |
pernielsentikaer
left a comment
There was a problem hiding this comment.
Hi @merchako 👋
Thanks for getting back to me, sorry I didn't catch it before now 🙂
Two small things:
refresh-favorite-device-1/2/3.tsuseexport default async () =>instead of named functionCommand()like the other command files. Could you align these for consistency?- Minor: unused
DevicesServicetype import inrefresh-bluetooth.ts(onlygetDevicesServiceis needed)
Could you look into above?
I converted this PR into a draft until it's ready for the review, please press the button Ready for review when it's ready and we'll have a look 😊
|
This pull request has been automatically marked as stale because it did not have any recent activity. It will be closed if no further activity occurs in the next 7 days to keep our backlog clean 😊 |
…port - Use named function Command() in refresh-favorite-device-1/2/3.ts for consistency with other command files - Remove unused DevicesService type import from refresh-bluetooth.ts
pernielsentikaer
left a comment
There was a problem hiding this comment.
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 (@merchako). Please link your GitHub account to your Raycast account to receive your credits and soon be able to exchange them for some swag. |
|
@raycastbot Fixed. Try again. Can I tell you to try again? Probably not. |
Description
Motivation
Implementation Details
src/core/devices/handlers/refresh-device.tsand wiring it intoDeviceactions (src/core/devices/devices.model.tsx).refresh-devicecommand and three favorite shortcuts (refresh-favorite-device-1/2/3) that reuse the existing fuzzy name/MAC lookup flow (src/refresh-device.ts,src/refresh-favorite-device-1.ts,src/refresh-favorite-device-2.ts,src/refresh-favorite-device-3.ts).refresh-allcommand to toggle Bluetooth power off/on via a new handlersrc/core/devices/handlers/refresh-bluetooth.tsand commandsrc/refresh-all.ts.refreshBluetooth()and implement it in blueutil only (blueutil -p 0 && blueutil -p 1insrc/core/devices/devices.service.blueutil.ts).package.jsonand add consistent user-facing messages via existingshowAnimatedMessage/showSuccessMessage/showErrorMessageutilities.Limitations
blueutilTesting
npm run lintAI Disclosure
Screencast
CleanShot.2026-03-08.at.21.07.39.mp4
Checklist
npm run buildand tested this distribution build in RaycastI checked that files in thenot changedassetsfolder are used by the extension itselfI checked that assets used by thenot changedREADMEare placed outside of themetadatafolder