Skip to content

Update parcel extension - #22239

Merged
raycastbot merged 12 commits into
raycast:mainfrom
aidenkt:ext/parcel
Nov 6, 2025
Merged

raycastbot merged 12 commits into
raycast:mainfrom
aidenkt:ext/parcel

Conversation

@aidenkt

@aidenkt aidenkt commented Oct 17, 2025 •

Copy link
Copy Markdown
Contributor

Description

  • I replaced using Universal Links (parcel://) with Parcel's new Add Delivery API. This adds cross-compatibility with Windows as parcel:// relies on the Mac-only Parcel Desktop app. It also makes adding deliveries much faster.
  • I also added form validation to make description and tracking number on the Add Delivery form to be filled in as otherwise Parcel returns an API error.
  • Previously when a delivery was successfully added, the behavior was to return a Success toast and then close the Raycast window immediately after. I switched to a Raycast HUD notification to do this automatically and ensure the user can see the Delivery Added notification as it's hard to see in the current implementation.
  • I added API functions to grab Parcel's list of carriers and added it as a field on the form, as the Add Delivery API requires a carrier to be specified.

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

Screenshot 2025-10-17 at 12 08 59 AM

Checklist

- Add Delivery Overhaul
- Initial commit
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: parcel Issues related to the parcel extension AI Extension platform: macOS labels Oct 17, 2025
@raycastbot

raycastbot commented Oct 17, 2025 •

Copy link
Copy Markdown
Collaborator

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.

@aidenkt
aidenkt marked this pull request as ready for review October 17, 2025 07:10

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 useCarriers hook to fetch and manage carrier list

Issues found:

  • The getUserLanguage() function has a logic bug - it tries to read a locale preference 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

Edit Code Review Agent Settings | Greptile

Comment thread extensions/parcel/src/api.ts Resolved
- 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
@pernielsentikaer

Copy link
Copy Markdown
Contributor

@aidenkt I updated the code a bit, bringing language back. Can you check that I didn't break anything too? 😊

@aidenkt

aidenkt commented Oct 17, 2025

Copy link
Copy Markdown
Contributor Author

All commands seem to work on my end!

@pernielsentikaer

Copy link
Copy Markdown
Contributor

@marcmagn1 / @xilopaint does it still work for you?

@xilopaint

xilopaint commented Oct 17, 2025 •

Copy link
Copy Markdown
Contributor

@marcmagn1 / @xilopaint does it still work for you?

Yes, but I think we should handle these errors with toast messages:
Screenshot 2025-10-17 at 08 02 31
Screenshot 2025-10-17 at 08 11 10
Also, is there API for deleting deliveries? It would be a good addition for the My Deliveries command.

It would also be beneficial to include a "Create Delivery" action in the action panel of the My Deliveries command.

@pernielsentikaer

Copy link
Copy Markdown
Contributor

Sounds like a good idea to check, @aidenkt can you have a look?

@pernielsentikaer
pernielsentikaer marked this pull request as draft October 17, 2025 12:36
Comment thread extensions/parcel/src/api.ts Resolved
Comment thread extensions/parcel/src/api.ts Resolved
Comment thread extensions/parcel/src/api.ts Resolved
Comment thread extensions/parcel/src/api.ts Resolved
Comment thread extensions/parcel/src/api.ts Resolved
Comment thread extensions/parcel/src/api.ts Resolved
Comment thread extensions/parcel/src/add-delivery.tsx Resolved
@aidenkt

aidenkt commented Oct 17, 2025 •

Copy link
Copy Markdown
Contributor Author

@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?

@bendrucker

Copy link
Copy Markdown
Contributor

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.

@aidenkt

aidenkt commented Oct 18, 2025

Copy link
Copy Markdown
Contributor Author

User preference would make more sense to me, per-form feels excessive as you'd likely choose the same option every time.

@pernielsentikaer

Copy link
Copy Markdown
Contributor

Ssounds like a preference would work better, do we know which contries is wprking as a setting @aidenkt

@aidenkt

aidenkt commented Oct 21, 2025 •

Copy link
Copy Markdown
Contributor Author

@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.

@aidenkt

aidenkt commented Oct 21, 2025

Copy link
Copy Markdown
Contributor Author

@pernielsentikaer @bendrucker
I've received a response from the developer of Parcel:
image
With this, I would propose building it in as Per did in his commit rather than making it a user exposed preference, especially if it's not always able to give the language the user requests. What do you guys think?

@bendrucker

Copy link
Copy Markdown
Contributor

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

@aidenkt
aidenkt marked this pull request as ready for review October 28, 2025 08:32
@aidenkt

aidenkt commented Oct 28, 2025 •

Copy link
Copy Markdown
Contributor Author

Made the following requested changes:

  • Confirmation notification has been added to the form
  • Used @bendrucker's simplified language line
  • Add Delivery has been added to the Action Menu on the My Delivery pages
  • Improved error handling to appear in the toasts (@xilopaint's request)

This PR should now be ready for review! 🎉

@pernielsentikaer

Copy link
Copy Markdown
Contributor

@bendrucker and @xilopaint do you have more feedback?

@xilopaint

Copy link
Copy Markdown
Contributor

No, that's all.

@bendrucker

Copy link
Copy Markdown
Contributor

Getting this so I can't resolve the handled comments:

Screenshot 2025-10-31 at 11 40 50

Still applicable are:

  • Dead code (fetchSupportedCarriers)
  • Unhandled error (from useCarriers)

@aidenkt

aidenkt commented Nov 1, 2025

Copy link
Copy Markdown
Contributor Author

@bendrucker Just addressed both!

@aidenkt
aidenkt requested a review from bendrucker November 4, 2025 03:05
@aidenkt

aidenkt commented Nov 6, 2025

Copy link
Copy Markdown
Contributor Author

Hey all, just wanted to check in and see if there were any updates here.

@raycast-extensions-bot raycast-extensions-bot Bot added the Approved Approved by a user label Nov 6, 2025

@pernielsentikaer pernielsentikaer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, approved 🔥

@raycastbot
raycastbot merged commit 2a66830 into raycast:main Nov 6, 2025
@github-actions

github-actions Bot commented Nov 6, 2025

Copy link
Copy Markdown
Contributor

@raycastbot

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Extension Approved Approved by a user extension fix / improvement Label for PRs with extension's fix improvements extension: parcel Issues related to the parcel extension platform: macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants