Skip to content

Add ray-clicker extension - #20867

Closed
JonathanRReed wants to merge 4 commits into
raycast:mainfrom
JonathanRReed:ext/ray-clicker
Closed

JonathanRReed wants to merge 4 commits into
raycast:mainfrom
JonathanRReed:ext/ray-clicker

Conversation

@JonathanRReed

@JonathanRReed JonathanRReed commented Aug 8, 2025 •

Copy link
Copy Markdown
Contributor

Description

Screencast

Checklist

- read me clean up
- update readme, add screenshots and polish menu bar UI for store submission
- fixed add menu bar idle accrual with optimized state management
- shortcuts & ui fix
- icon fix
- icon update
- docs: update branding from Idle-Raycast to Ray Clicker and add store compliance details
- first commit
@raycastbot raycastbot added the new extension Label for PRs with new extensions label Aug 8, 2025
@raycastbot

Copy link
Copy Markdown
Collaborator

Congratulations on your new Raycast extension! 🚀

Due to our current reduced availability during summer, 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.

@JonathanRReed

Copy link
Copy Markdown
Contributor Author

I made a simple raycast extension as practice. It’s a simple idle clicker game, with a basic productivity theme. This is my first attempt at making an extension. I would love any feedback or things I can do to improve.

@JonathanRReed
JonathanRReed marked this pull request as ready for review August 8, 2025 19: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 Summary

This PR introduces a new extension called "Ray Clicker" - an idle clicker game for Raycast. The extension implements a comprehensive game with multiple mechanics including active clicking for points, an upgrade system with three categories (active, idle, efficiency), a prestige system for long-term progression, and background idle progress via a menu bar command.

The extension follows a well-structured architecture with proper separation of concerns:

  • Main game logic handled in useGameState.ts hook with sophisticated state management
  • Visual components split between GameView.tsx, effects components, and prestige views
  • Comprehensive type definitions in types.ts defining game state and upgrade configurations
  • Utility functions for number formatting, time display, and visual effects
  • Menu bar integration allowing background currency accrual when the main view isn't open

The game includes 13 different upgrades across three categories, milestone achievements, combo multipliers for rapid clicking, and a prestige system with 10 prestige upgrades. The extension integrates well with Raycast's API, using local storage for persistence, toasts for feedback, and proper navigation patterns. The code demonstrates advanced React patterns with performance optimizations like epsilon-based updates to prevent excessive re-renders.

Confidence score: 1/5

  • This PR has critical blocking issues that prevent store submission and could cause immediate problems
  • Score reflects missing required metadata folder with screenshots for a new extension with view commands, which is mandatory for store submission
  • Pay close attention to package.json, metadata folder requirements, and CHANGELOG.md format compliance

Context used:

Rule - Extensions must include at least one screenshot in a metadata folder for store submission. (link)
Rule - Extensions must include at least one screenshot in a metadata folder for store submission. (link)

17 files reviewed, 13 comments

Edit Code Review Bot Settings | Greptile

},
};

export const UPGRADES: { [key: string]: UpgradeDefinition } = {

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.

style: Consider using a more strongly typed approach with Record<UpgradeId, UpgradeDefinition> instead of { [key: string]: UpgradeDefinition }

{ threshold: 1000000, message: "1M points!" },
];

const milestone = milestones.find((m) => points >= m.threshold && points - m.threshold < 1);

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.

logic: The milestone detection logic points - m.threshold < 1 assumes exact matches. This might miss milestones if points increment by more than 1 at a time.

Comment on lines +358 to +360
void saveGameState(newState);
// Persist immediately so prestige upgrades aren't lost on close
void saveGameState(newState);

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.

syntax: Duplicate saveGameState call - remove one of these identical lines

Suggested change
void saveGameState(newState);
// Persist immediately so prestige upgrades aren't lost on close
void saveGameState(newState);
// Persist immediately so purchases aren't lost if the command closes
void saveGameState(newState);

},
{
"name": "menu-bar",
"title": "Ray Clicker (menu Bar)",

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.

style: Title should use consistent casing - 'menu Bar' should be 'Menu Bar' to follow title case conventions

Suggested change
"title": "Ray Clicker (menu Bar)",
"title": "Ray Clicker (Menu Bar)",

Context Used: Context - Use the title case for titles in the preferences section of package.json files, e.g., 'Tab Width' instead of 'tabWidth'. (link)

Comment on lines +540 to +547
// Apply special effects based on the upgrade
if (upgradeId === "bulkBuyerPro") {
newState.settings.bulkBuyEnabled = true;
} else if (upgradeId === "fasterTick") {
newState.settings.offlineProgressEnabled = true;
} else if (upgradeId === "autoClickDaemon") {
newState.settings.autoClickEnabled = true;
}

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.

logic: Potential issue: accessing newState.settings without ensuring it exists first - consider using optional chaining or initializing settings

Comment thread extensions/ray-clicker/src/GameView.tsx Outdated
Comment on lines +95 to +113
// Styles for milestone notifications
const styles = {
milestoneContainer: {
position: "fixed" as const,
top: "50%",
left: "50%",
transform: "translate(-50%, -50%)",
backgroundColor: "rgba(0, 0, 0, 0.8)",
padding: "16px 24px",
borderRadius: 8,
zIndex: 1000,
},
milestoneText: {
color: "#fff",
fontSize: 24,
fontWeight: "bold",
textAlign: "center" as const,
},
};

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.

logic: Inline CSS styles may not work in Raycast. Consider using Raycast's built-in styling or removing custom visual effects.

Comment thread extensions/ray-clicker/src/GameView.tsx Outdated
Comment on lines +167 to +171
{showMilestone && (
<div style={styles.milestoneContainer}>
<span style={styles.milestoneText}>{milestoneMessage}</span>
</div>
)}

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.

logic: Custom div elements with inline styles rendered outside List component may not display correctly in Raycast's environment.

Comment thread extensions/ray-clicker/src/GameView.tsx Outdated
<Action
title="Show All Upgrades"
icon={Icon.List}
onAction={() => {}}

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.

style: Empty onAction handler - consider removing this action or implementing the functionality


## Features

- Active, Idle, and Efficiency upgrade trees, raycast/productivty themed

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.

syntax: Typo: 'productivty' should be 'productivity'

Suggested change
- Active, Idle, and Efficiency upgrade trees, raycast/productivty themed
- Active, Idle, and Efficiency upgrade trees, raycast/productivity themed


## Notes

- Design overview lives in `design doc.md` (truncated summary)

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.

style: Remove 'design doc.md' from extension root - documentation files should not be included in the extension folder

@JonathanRReed

Copy link
Copy Markdown
Contributor Author

cleaned up mistakes

Accidentally left in design doc
@pernielsentikaer

Copy link
Copy Markdown
Contributor

@greptileai can you check since PR was modified

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

Looking at this PR, I can see it adds a new "ray-clicker" extension - an idle clicker game for Raycast. Let me analyze the key aspects:

Code Quality & Architecture

Good aspects:

  • Well-structured TypeScript with proper type definitions
  • Clean separation of concerns (GameView, PrestigeView, hooks, storage)
  • Proper use of React hooks and state management
  • Good error handling in storage operations

Areas needing attention:

  1. Large file sizes - Some files are quite substantial (useGameState.ts is 577 lines). Consider breaking down into smaller, more focused modules.

  2. Complex state calculations - The calculateDerivedState function in useGameState.ts is doing a lot of work. This could be optimized or split up.

Store Compliance

✅ Meets requirements:

  • Uses proper Raycast API patterns
  • Has appropriate metadata and package.json structure
  • Includes proper TypeScript configuration
  • No external dependencies beyond Raycast APIs

❓ Questions/Concerns:

  • The game saves frequently to LocalStorage - make sure this doesn't impact performance
  • Menu bar component runs on 1-minute intervals - verify this is acceptable for Raycast store

Game Design

The game implements typical idle clicker mechanics with:

  • Click-based currency generation
  • Upgrade trees (Active, Idle, Efficiency)
  • Prestige system with permanent bonuses
  • Menu bar integration for background progress

Specific Technical Issues

  1. In GameView.tsx line 83-85: The prestige upgrades prop has a default empty function with a comment. This should be properly implemented or the comment removed.

  2. Performance consideration: The game loop runs every second and could cause unnecessary re-renders. The epsilon check (MIN_GAIN_EPS) is good, but monitor this.

  3. Storage race conditions: The timestamp-based save protection in storage.ts is good, but complex. Make sure this works reliably across menu bar and main app.

Recommendation

The extension appears technically sound and follows Raycast patterns well. The main concerns are around file organization and ensuring the frequent saves/updates don't impact Raycast performance.

Suggested next steps:

  1. Test thoroughly with the menu bar component to ensure smooth operation
  2. Consider breaking down the largest files for better maintainability
  3. Verify the 1-minute menu bar interval works well in practice

Overall, this looks like a solid implementation of an idle clicker game that should work well within the Raycast ecosystem.

@pernielsentikaer

Copy link
Copy Markdown
Contributor

Another thing, if you just hold hotkey or cmd+enter then it just keeps going (which is not click) - should we look into limit how many times each second should be allowed?

ray-clicker 2025-08-11 at 15 15 24

@JonathanRReed

Copy link
Copy Markdown
Contributor Author

I ended up leaving the bug in because I thought it was more fun in the end. So, it’s good to keep!

@pernielsentikaer

Copy link
Copy Markdown
Contributor

A few more things I came across:

  • Click to Earn action is missing an icon, icons should all have icons
ray-clicker 2025-08-11 at 23 01 23
  • This seems redundant since Raycast doesn’t support HTML
image
  • I’m not sure we need back to game action since Raycast doesn’t do that (And now all of them has the action)
ray-clicker 2025-08-11 at 23 04 56
  • What does this action do? It doesn’t do anything for me?
ray-clicker 2025-08-11 at 23 09 34
  • How do I get Idle Income?

@JonathanRReed

Copy link
Copy Markdown
Contributor Author

For the click to earn, I preferred it not having an icon, since it’s an action instead of a menu. But I can add an icon if needed.

I completely forgot about the HTML; it’s from a early version of the project, before it was moved into Raycast. I can clean that up.

cmd + p lets you change production lines. The default is the active clicker; then there are two others. One for idle & another general efficiency. I think I need a better way to show the options to the user.

Also, I agree with the "back to game" button; it’s another vestigial part of the project.
The same is for the "show all upgrades". It’s from when the upgrades had their own pages.
I can clean both those up too.

@JonathanRReed

Copy link
Copy Markdown
Contributor Author

Also thank you for helping review this project!

@pernielsentikaer

Copy link
Copy Markdown
Contributor

For the click to earn, I preferred it not having an icon, since it’s an action instead of a menu. But I can add an icon if needed

Please do so, you can read more about it here 😊

I completely forgot about the HTML; it’s from a early version of the project, before it was moved into Raycast. I can clean that up

Would be nice so it's less to review and confuse 😊

cmd + p lets you change production lines. The default is the active clicker; then there are two others. One for idle & another general efficiency. I think I need a better way to show the options to the user.

I was a bit confused yes so I'm sure others will be too, do you have any ideas on how to improve it?

Also, I agree with the "back to game" button; it’s another vestigial part of the project.
The same is for the "show all upgrades". It’s from when the upgrades had their own pages.
I can clean both those up too.

Would be nice 😇

@JonathanRReed
JonathanRReed deleted the ext/ray-clicker branch August 15, 2025 19:55
@JonathanRReed

Copy link
Copy Markdown
Contributor Author

I cleaned up the files, but had trouble pushing the fixes.
Here were the changes.

I added the icon for the Click to Earn action. Sorry for missing the info in the docs.

Also, cleaned up the leftover HTML from the pre-Raycast phase so It should be cleaned up.

For switching categories: cmd+p still works, but I added a change catatoery option in the action menu. 

I removed back to game and show all upgrades since both were vestigial from an earlier layout.

Also fixed somethings I found while playing.

  • Optional silent toasts; purchaseUpgradeMax runs quiet.
  • Combo system was unplugged—fixed, and capped at ×3 to keep it sane.
  • Cleaned up menu bar UI.
  • Prestige labels now use explicit metadata (no heuristic).
  • Implemented prestige effects for quickStart and secondWind.
  • Fixed multiple small upgrade bugs and a missed prestige label.
  • raycastProMode discount now scales with level as intended.
  • aiOptimizer fixed: base ×2 all with reasonable per-level scaling.
  • Removed the misleading ×5 idle display in src/index.tsx (prop + Stats).
  • Corrected Stats category level calculation; added Milestones & Achievements to Stats.
  • Milestone system got a cleanup + more milestones; split into its own Achievement.ts.
  • General organization cleanup + title-case fix in package.json.
  • Tweaked a few upgrade flavor text to fix UI space better.

The new PR made is #20979

@JonathanRReed JonathanRReed mentioned this pull request Aug 15, 2025
5 tasks done
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