Skip to content

Conversation

@lacherogwu
Copy link
Contributor

@lacherogwu lacherogwu commented Mar 5, 2025

Description

This was a fun proof-of-concept project aimed at enhancing productivity by allowing users to open specific Gmail accounts directly from Raycast. It improves productivity by eliminating the need to manually switch accounts after opening the Gmail interface.

Why This Extension

I love the Gmail inbox interface, but I hate that I have to open the interface and only after that switch to the desired account. This extension solves this problem by letting users directly open specific Gmail accounts from Raycast.

The reason I didn't just add this functionality to the current Gmail Raycast extension is because they work completely differently - the existing Gmail extension requires you to add a token, while this extension doesn't require any setup beyond having Chrome installed.

Features

  • Lists all Gmail accounts connected to your Chrome browser
  • Ability to pin favorite accounts
  • Organize pinned accounts by moving them up/down
  • Open Gmail accounts directly in Chrome with a single click

Security Note

This extension accesses Chrome cookies to retrieve your Google account information. It:

  • Uses the chrome-cookie-decrypt package to read cookies from Chrome
  • Only accesses cookies from Google domains
  • Does not send your data to any external servers except Google's own services
  • Stores a cache of your accounts and pinned preferences locally

The extension needs these permissions to show you which accounts you're logged into. If you have security concerns, you can review the source code to see exactly how your data is handled.

How It Works

The extension reads your Chrome cookies to identify Google accounts you're logged into, then displays them in a convenient list within Raycast. You can then quickly access your Gmail inbox for any account with a single click.

Question About Implementation

I have one concern that I'm not sure if I implemented correctly:

If Chrome isn't installed on the system, I show a List with List.EmptyView to inform the user. This seems a bit off, but I couldn't find a dedicated error view. Is there a better way to handle this, or is my implementation correct? Simply throwing an error doesn't look nice and gives less control over actions.

Screencast

gmail-accounts-1

Checklist

@raycastbot raycastbot added the new extension Label for PRs with new extensions label Mar 5, 2025
@raycastbot
Copy link
Collaborator

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.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR adds a new Gmail Accounts extension that enables quick access to Chrome-based Gmail accounts with features for listing, pinning, and organizing multiple accounts.

  • Missing metadata folder with screenshots for the view command as required for store submission - see https://developers.raycast.com/basics/prepare-an-extension-for-store#how-to-use-it
  • getAccounts() in src/gmail.ts should handle errors gracefully using try/catch and showFailureToast from @raycast/utils
  • execSync calls in list-accounts.tsx should be wrapped in try/catch blocks to handle potential failures gracefully
  • List component should use isLoading prop to avoid empty state flicker while accounts are being fetched

💡 (2/5) Greptile learns from your feedback when you react with 👍/👎!

10 file(s) reviewed, 13 comment(s)
Edit PR Review Bot Settings | Greptile

lacherogwu and others added 5 commits March 5, 2025 16:35
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@lacherogwu
Copy link
Contributor Author

@greptileai check again

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR continues to evolve the Gmail Accounts extension with improved error handling and user experience considerations.

  • openInChrome function in src/list-accounts.tsx should escape the URL parameter to prevent command injection vulnerabilities
  • Consider using showFailureToast instead of showToast for pin/unpin error handling in ListItem component
  • The chrome-cookie-decrypt package (v0.0.5) seems experimental for handling sensitive data - consider adding security warnings or finding a more established alternative
  • The getAllowedMovements function could be simplified by using array index checks instead of building a movements array

The implementation for handling Chrome's absence using List.EmptyView is actually a good approach as it provides a clear user experience with actionable feedback.

10 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile

@pernielsentikaer pernielsentikaer self-assigned this Mar 12, 2025
Copy link
Collaborator

@pernielsentikaer pernielsentikaer left a comment

Choose a reason for hiding this comment

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

Hi 👋

Looks good to me, approved 🔥

@raycastbot raycastbot merged commit 0e7bdfd into raycast:main Mar 12, 2025
2 checks passed
@github-actions
Copy link
Contributor

Published to the Raycast Store:
https://raycast.com/lachero/gmail-accounts

@raycastbot
Copy link
Collaborator

🎉 🎉 🎉

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

@lacherogwu lacherogwu deleted the ext/gmail-accounts branch April 3, 2025 01:13
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants