Update Vercast extension - update components + proper handling when token invalid#17429
Update Vercast extension - update components + proper handling when token invalid#17429raycastbot merged 4 commits intoraycast:mainfrom
Vercast extension - update components + proper handling when token invalid#17429Conversation
|
Thank you for your contribution! 🎉 🔔 @MaxLeiter @gleich @dgrcode @samuelkraft 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 |
There was a problem hiding this comment.
PR Summary
This PR improves error handling for invalid tokens in the Vercast extension and updates the components list to match Vercel's current Geist design system.
- Added new
WithValidTokencomponent in/extensions/vercast/src/pages/with-valid-token.tsxthat properly handles loading states and displays an error view when token validation fails - Added
InvalidTokenViewcomponent in/extensions/vercast/src/pages/details/invalid-token-view.tsxto show a clear error message with a button to open preferences - Updated
isValidTokenutility in/extensions/vercast/src/utils/is-valid-token.tsto properly validate tokens by fetching user data asynchronously - Updated the components list in
/extensions/vercast/src/search-components.tsxto match Vercel's current Geist design system - Added version 2.9 to
/extensions/vercast/CHANGELOG.mdwith the required{PR_MERGE_DATE}template string
10 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
There was a problem hiding this comment.
PR Summary
(updates since last review)
This PR enhances the Vercast extension's error handling for invalid tokens by using the usePromise hook from @raycast/utils with failureToastOptions for cleaner error management.
- Improved error messaging in
/extensions/vercast/src/utils/is-valid-token.tswith specific error messages for token length and validation failures - Simplified error handling in
WithValidTokencomponent by leveraging built-in toast functionality from@raycast/utils - Removed unnecessary imports (
showToastandToast) as they're replaced by the more elegantfailureToastOptionsapproach
3 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
|
@MaxLeiter do you want to check this? |
|
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
My Vercel token expired which caused the extension to crash and show never-ending loading indicators. We now wrap the main components in a
WithAccessTokenthat callsisValidTokenand shows the relevant view. To ensure that token is valid, we call thefetchUserfunction.As a bonus: updated all components in "Search Components"
Search ComponentsScreencast
Here are 3 screencasts showing the changes (before and after):
INVALID TOKEN LENGTH (notice the infinite loading)
vercast-invalid-token-length.mp4
CORRECT LENGTH BUT INVAILD/EXPIRED TOKEN
vercast-invalid-token.mp4
NEW COMPONENTS
vercast-components.mp4
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