Skip to content

Add spark-mail extension - #28483

Closed
v-khanna wants to merge 5 commits into
raycast:mainfrom
v-khanna:ext/spark-mail
Closed

v-khanna wants to merge 5 commits into
raycast:mainfrom
v-khanna:ext/spark-mail

Conversation

@v-khanna

@v-khanna v-khanna commented Jun 2, 2026 •

Copy link
Copy Markdown

Description

Adds Spark Mail — browse, search, read, and triage your Spark inbox from Raycast via the official Spark CLI. Six commands: Inbox (smart views + load-more), Search Mail (keyword + semantic, with a thread reader), Calendar, Search Contacts, Browse Folders, and Compose. Write actions are auto-hidden for Read-only accounts since Spark gates triage behind Premium. Requires Spark Desktop running + the spark CLI. Not affiliated with Readdle; Spark is a trademark of its owner.

Screencast

Screenshots are included in metadata/ (command list, Inbox, Search, Calendar, Folders, Compose).

Checklist

- Refit store screenshots without cropping
- Add store screenshots and finalize icon for publishing
- Update icon to paper-plane + search bar, set author handle
- Add custom icon and polish README
- Initial commit: Spark Mail Raycast extension
@raycastbot raycastbot added the new extension Label for PRs with new extensions label Jun 2, 2026
@raycastbot

raycastbot commented Jun 2, 2026 •

Copy link
Copy Markdown
Collaborator

Congratulations on your new Raycast extension! 🚀

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days.

Once the PR is approved and merged, the extension will be available on our Store.

@v-khanna
v-khanna marked this pull request as ready for review June 2, 2026 02:27
@greptile-apps

greptile-apps Bot commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a Raycast extension for Spark Mail. The main changes are:

  • New commands for inbox, search, calendar, contacts, folders, and compose.
  • Shared Spark CLI helpers for command execution and output parsing.
  • Thread reading, attachment handling, and mail triage actions.
  • Extension metadata, screenshots, package setup, and changelog.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
extensions/spark-mail/src/lib/spark.ts Adds Spark CLI path detection, command execution helpers, and parsers for mail, accounts, calendar events, folders, and attachments.
extensions/spark-mail/src/compose.tsx Adds the compose flow with triage-account gating and comma-separated recipient handling.
extensions/spark-mail/src/calendar.tsx Adds the calendar command that renders parsed Spark agenda events by day.
extensions/spark-mail/src/components/email-list.tsx Adds the reusable paginated email list with read-thread and triage actions.

Reviews (5): Last reviewed commit: "Enhance event title parsing in spark.ts ..." | Re-trigger Greptile

Comment thread extensions/spark-mail/src/lib/spark.ts Resolved
Comment thread extensions/spark-mail/src/lib/spark.ts Resolved
Comment thread extensions/spark-mail/src/compose.tsx Resolved
@v-khanna

v-khanna commented Jun 2, 2026

Copy link
Copy Markdown
Author

Thanks for the review! Addressed all three points in the latest push:

  1. isSparkInstalled() always returning true — it now scans the directories on the CLI PATH for a spark binary (and validates the preference path when one is set) instead of assuming the bare "spark" fallback is installed. Users without the CLI now get the SparkNotInstalled setup screen rather than a raw ENOENT toast.
  2. Manual Preferences interface — removed; now using the auto-generated Preferences type from raycast-env.d.ts.
  3. splitAddresses splitting on whitespace — now splits on commas only, so friendly-formatted addresses like Alice Smith <[email protected]> are preserved as a single recipient.

npm run build and npm run lint both pass.

@v-khanna

v-khanna commented Jun 2, 2026

Copy link
Copy Markdown
Author

Addressed both issues from the latest review:

  1. Rules of Hooks — each command (inbox, search, calendar, contacts, folders, compose) is now split into a thin guard component that performs the isSparkInstalled() check (no hooks) and an inner *View component that calls all hooks unconditionally. No hook runs after a conditional early return.
  2. EmailList arg serialization — the usePromise key now uses JSON.stringify/JSON.parse instead of joining/splitting on a separator, so folder IDs containing spaces (e.g. account:Sent Messages) are preserved as a single argument. (The old separator was also an errant NUL byte rather than a space, so this removes that too.)

npm run build and npm run lint both pass.

@v-khanna

v-khanna commented Jun 2, 2026

Copy link
Copy Markdown
Author

Thanks — addressed both points from the latest pass:

  1. sparkPath default neutralising the PATH fallback — removed the hardcoded "default": "/usr/local/bin/spark" (kept it as a placeholder hint instead). With no default, an unset preference is empty, so resolveSparkOnPath() runs and scans /usr/local/bin and /opt/homebrew/bin. Apple Silicon users with the CLI at /opt/homebrew/bin/spark are now detected out of the box.
  2. Unresolved attachment-download toast — the animated toast handle is now captured and resolved to Success/Failure via an effect once the attachment-enabled refetch settles, and the generic thread-load toast is suppressed while a download is in flight, so the two no longer stack.

npm run build and npm run lint both pass.

Comment thread extensions/spark-mail/src/lib/spark.ts Resolved
@pernielsentikaer pernielsentikaer self-assigned this Jun 26, 2026

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

Could you add at least one screenshot of the extension and add them to a folder called metadata - you need to use our tool to get the right padding on the images


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 😊

@pernielsentikaer
pernielsentikaer marked this pull request as draft June 29, 2026 06:13
@raycastbot

Copy link
Copy Markdown
Collaborator

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 😊

@raycastbot raycastbot added the status: stalled Stalled due inactivity label Jul 24, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

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.

@raycastbot raycastbot closed this Jul 31, 2026
@keito4 keito4 mentioned this pull request Sep 5, 2026
5 tasks done
raycastbot added a commit that referenced this pull request Sep 11, 2026
* Add Spark Mail extension

Browse, search, read, and triage Spark email from Raycast via the
official Spark CLI (ships with Spark Desktop): unified inbox with smart
views and pagination, hybrid keyword + semantic search, thread reader
with attachments, calendar agenda, contact lookup, folder browser, and
draft composition. Write actions are gated to accounts with Triage
access.

Based on the extension by Vir Khanna (#28483, closed
unmerged), reused under the MIT license with attribution in the
changelog.

Co-Authored-By: Claude Fable 5 <[email protected]>

* Remove local extension icon from metadata screenshots

The Metadata Image Enforcer flagged all three screenshots because the
development-extension icon was visible in the bottom bar. Repainted the
footer region and recomposed the images.

Co-Authored-By: Claude Fable 5 <[email protected]>

* Address review feedback: attachment retry, image tracking, generated types

- Retry attachment downloads via revalidate() when the flag is already
  set (a failed attempt previously left the action inert)
- Neutralize Markdown image syntax in untrusted email content (subject,
  sender, body) so a sender-embedded tracking pixel is never fetched
- Use the generated Preferences type from raycast-env.d.ts instead of a
  hand-written duplicate

Co-Authored-By: Claude Fable 5 <[email protected]>

* Apply image-tracking protection to the Date header as well

toRelative returns an invalid date header verbatim, so it is
sender-controlled like the other rendered fields.

Co-Authored-By: Claude Fable 5 <[email protected]>

* Update CHANGELOG.md and optimise images

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: raycastbot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new extension Label for PRs with new extensions status: stalled Stalled due inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants