Repository navigation
Add ray-clicker extension - #20867
JonathanRReed wants to merge 4 commits into
Conversation
- 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
|
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. |
|
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. |
There was a problem hiding this comment.
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.tshook with sophisticated state management - Visual components split between
GameView.tsx, effects components, and prestige views - Comprehensive type definitions in
types.tsdefining 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
| }, | ||
| }; | ||
|
|
||
| export const UPGRADES: { [key: string]: UpgradeDefinition } = { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
| void saveGameState(newState); | ||
| // Persist immediately so prestige upgrades aren't lost on close | ||
| void saveGameState(newState); |
There was a problem hiding this comment.
syntax: Duplicate saveGameState call - remove one of these identical lines
| 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)", |
There was a problem hiding this comment.
style: Title should use consistent casing - 'menu Bar' should be 'Menu Bar' to follow title case conventions
| "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)
| // 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; | ||
| } |
There was a problem hiding this comment.
logic: Potential issue: accessing newState.settings without ensuring it exists first - consider using optional chaining or initializing settings
| // 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, | ||
| }, | ||
| }; |
There was a problem hiding this comment.
logic: Inline CSS styles may not work in Raycast. Consider using Raycast's built-in styling or removing custom visual effects.
| {showMilestone && ( | ||
| <div style={styles.milestoneContainer}> | ||
| <span style={styles.milestoneText}>{milestoneMessage}</span> | ||
| </div> | ||
| )} |
There was a problem hiding this comment.
logic: Custom div elements with inline styles rendered outside List component may not display correctly in Raycast's environment.
| <Action | ||
| title="Show All Upgrades" | ||
| icon={Icon.List} | ||
| onAction={() => {}} |
There was a problem hiding this comment.
style: Empty onAction handler - consider removing this action or implementing the functionality
|
|
||
| ## Features | ||
|
|
||
| - Active, Idle, and Efficiency upgrade trees, raycast/productivty themed |
There was a problem hiding this comment.
syntax: Typo: 'productivty' should be 'productivity'
| - 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) |
There was a problem hiding this comment.
style: Remove 'design doc.md' from extension root - documentation files should not be included in the extension folder
…e raycast store likes this version
|
cleaned up mistakes |
Accidentally left in design doc
|
@greptileai can you check since PR was modified |
There was a problem hiding this comment.
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:
-
Large file sizes - Some files are quite substantial (useGameState.ts is 577 lines). Consider breaking down into smaller, more focused modules.
-
Complex state calculations - The
calculateDerivedStatefunction inuseGameState.tsis 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
-
In
GameView.tsxline 83-85: The prestige upgrades prop has a default empty function with a comment. This should be properly implemented or the comment removed. -
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. -
Storage race conditions: The timestamp-based save protection in
storage.tsis 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:
- Test thoroughly with the menu bar component to ensure smooth operation
- Consider breaking down the largest files for better maintainability
- 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.
|
I ended up leaving the bug in because I thought it was more fun in the end. So, it’s good to keep! |
|
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. |
|
Also thank you for helping review this project! |
Please do so, you can read more about it here 😊
Would be nice so it's less to review and confuse 😊
I was a bit confused yes so I'm sure others will be too, do you have any ideas on how to improve it?
Would be nice 😇 |
|
I cleaned up the files, but had trouble pushing the fixes. 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.
The new PR made is #20979 |





Description
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder