Add evaluate-math-expression extension#17089
Conversation
|
Congratulations on your new Raycast extension! 🚀 Due to our current reduced availability, the initial review may take up to 10-15 business days Once the PR is approved and merged, the extension will be available on our Store. |
|
@greptileai can you do a review here 😊 |
There was a problem hiding this comment.
PR Summary
This PR adds a new "Evaluate Math Expression" extension that reads selected text, evaluates it as a math expression, and outputs the result according to user preferences.
- In
CHANGELOG.md, please use{PR_MERGE_DATE}instead of the hardcoded date "2025-02-15" - this will be automatically replaced with the current date upon merging - In
src/evaluate-math-expression.ts, error handling could be simplified withshowFailureToastfrom@raycast/utilsinstead of the currentshowToastimplementation - The
evaluatefunction is marked as async but doesn't contain any await operations - Consider adding validation for empty text selection before evaluation
- The
Preferencesinterface inpreferences.tsis unnecessary as it's autogenerated inraycast-env.d.ts
💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!
10 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
extensions/evaluate-math-expression/src/evaluate-math-expression.ts
Outdated
Show resolved
Hide resolved
| return { | ||
| ...preferences, | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| maxDecimals: parseInt(preferences.maxDecimals as any) || undefined, |
There was a problem hiding this comment.
style: Consider using Number(preferences.maxDecimals) instead of parseInt() to handle decimal values properly
Co-authored-by: Per Nielsen Tikær <per@raycast.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…on.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
|
@pernielsentikaer Done! |
| # Evaluate Math Expression | ||
|
|
||
| A [Raycast](https://www.raycast.com/) extension that reads current selection, evaluates the math expression, and shows it in a desired way. | ||
|
|
There was a problem hiding this comment.
Can you add a few examples here?
There was a problem hiding this comment.
Screen.Recording.2025-02-28.at.9.16.37.PM.mov
There is no good way to showcase this extension using static images. Does Raycast support GIFs?
| export interface Preferences { | ||
| maxDecimals?: number; | ||
| replaceSelection: boolean; | ||
| copyToClipboard: boolean; | ||
| displayResult: boolean; | ||
| } |
There was a problem hiding this comment.
You don't need to manually set preference types as this is autogenerated in raycast-env.d.tsx
There was a problem hiding this comment.
I simplified it, but I can't get rid of it completely as the maxDecimals field has a different type
pernielsentikaer
left a comment
There was a problem hiding this comment.
Hi 👋
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
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder