Repository navigation
Update parcel extension - #22239
Update parcel extension#22239
Conversation
- Add Delivery Overhaul - Initial commit
|
Thank you for your first contribution! 🎉 🔔 @marcmagn1 @omarshahine @bendrucker @damian-duchnowski @xilopaint 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. |
There was a problem hiding this comment.
Greptile Overview
Summary
This PR modernizes the Add Delivery functionality by replacing Mac-only universal links (parcel://) with Parcel's Add Delivery API, enabling cross-platform support for Windows.
Key changes:
- Migrated from universal links to REST API for adding deliveries
- Added carrier dropdown with dynamic list from Parcel's API
- Implemented form validation for required fields (tracking number, carrier, description)
- Replaced success toast with HUD notification for better UX
- Added
useCarriershook to fetch and manage carrier list
Issues found:
- The
getUserLanguage()function has a logic bug - it tries to read alocalepreference that doesn't exist in package.json, so it will always return "en"
Confidence Score: 4/5
- This PR is safe to merge with one minor logic issue that should be addressed
- The implementation is well-structured and uses Raycast best practices (useFetch, useForm, FormValidation). However, the getUserLanguage function contains a logic bug where it tries to access a preference that doesn't exist, causing it to always return the default value. This won't break functionality but should be fixed.
- extensions/parcel/src/api.ts - Fix the getUserLanguage function to either remove the unused locale preference logic or add the preference to package.json
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| extensions/parcel/src/api.ts | 3/5 | Added new API functions for carriers and delivery creation; getUserLanguage has logic bug with undefined preference |
| extensions/parcel/src/add-delivery.tsx | 4/5 | Refactored to use API instead of universal links; added form validation and carrier selection |
| extensions/parcel/src/hooks/useCarriers.ts | 5/5 | New hook to fetch and sort carriers list using useFetch |
6 files reviewed, 1 comment
- Fixed code formatting - Hard-coded language - Add Delivery Overhaul - Add Delivery Overhaul
- Upgrade dependencies to version 0.25.11 for various esbuild packages - Update ESLint and TypeScript packages to latest versions - Refactor status icon mapping to use Raycast's Icon component - Implement dynamic language detection for API requests - Add new utility function for retrieving system language - Minor formatting and code cleanup
|
@aidenkt I updated the code a bit, bringing |
|
All commands seem to work on my end! |
|
@marcmagn1 / @xilopaint does it still work for you? |
Yes, but I think we should handle these errors with toast messages: It would also be beneficial to include a "Create Delivery" action in the action panel of the My Deliveries command. |
|
Sounds like a good idea to check, @aidenkt can you have a look? |
|
@xilopaint There is no Delete Delivery endpoint in their docs right now, but I will get to work on displaying the errors. @bendrucker I will add the confirm notification checkbox to the form on my next commit. @pernielsentikaer could I ask you to take a look at the comments Ben made on the language? |
|
Re: languages, it'll be important to check how the API actually behaves. Using the native locale API and grabbing the first two characters seems reasonable. But even then I'd say it should be a smart default for either a user preference or per-delivery form field or both, and not a magic behavior internal to the extension. |
|
User preference would make more sense to me, per-form feels excessive as you'd likely choose the same option every time. |
|
Ssounds like a preference would work better, do we know which contries is wprking as a setting @aidenkt |
|
@pernielsentikaer Honestly I've yet to test the languages/countries. It's hard to when the API itself is throttled at 20 requests per day per token and since I don't have any valid tracking numbers to test with. Additionally, according to the Parcel API documentation the languages don't work for every carrier and depend on each making it available. I'll reach out to the developer to see if there is a way on determining the available countries per carrier. I have a commit that fixes the error handling, action menu, and adds the confirmation notifications ready to push. I am having trouble with pushing it for some reason though - I messaged you on Slack about possibly troubleshooting that issue. |
|
@pernielsentikaer @bendrucker |
|
Sure that's fine. Getting the users language should be as simple as this: Intl.DateTimeFormat().resolvedOptions().locale.slice(0, 2)No conditionals/fallbacks needed |
|
Made the following requested changes:
This PR should now be ready for review! 🎉 |
|
@bendrucker and @xilopaint do you have more feedback? |
|
No, that's all. |
|
@bendrucker Just addressed both! |
|
Hey all, just wanted to check in and see if there were any updates here. |
pernielsentikaer
left a comment
There was a problem hiding this comment.
Looks good to me, approved 🔥
|
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
Note: I wasn't sure to add Windows as a platform in the manifest as I haven't tested with Windows and I'm not sure if that's currently the only block.
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder