Skip to content

Add dice-tiles extension - #22021

Merged
raycastbot merged 19 commits into
raycast:mainfrom
Jumitti:main
Nov 7, 2025
Merged

raycastbot merged 19 commits into
raycast:mainfrom
Jumitti:main

Conversation

@Jumitti

@Jumitti Jumitti commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

Description

Dice Tiles is a minimalist dice-and-tiles game built for Raycast.
The goal is to roll dice and eliminate numbered tiles by selecting those whose sum matches the dice roll.
Each mistake costs HP; clearing all tiles grants a victory. Track your progress through victories and defeats, unlock emoji-based rewards, and reach the ultimate random-tier pattern after 500 wins.

Core features:

  • Dice rolling and tile elimination mechanic.
  • Persistent victories and defeats tracking via Raycast LocalStorage.
  • Progressive reward system with visual emoji upgrades.
  • Help and rules accessible via keyboard shortcuts.
  • Lightweight UI integrated directly into Raycast.

Shortcuts:

  • Enter → Roll dice / Validate / Restart
  • Shift + [1–0] → Select / Deselect tiles
  • Shift + R → Reset
  • Shift + H → Toggle Help

Screencast

screen_base

Checklist

ghost 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 Overview

Summary

This PR introduces **Dice Tiles**, a new minimalist dice-and-tiles elimination game extension for Raycast. The game allows users to roll dice and eliminate numbered tiles by selecting combinations that match the dice roll sum. Players have limited HP, and mistakes cost health while clearing all tiles grants victory.

The extension leverages Raycast's LocalStorage API for persistent game statistics tracking (victories/defeats) and implements a progressive emoji-based reward system that unlocks visual upgrades as players accumulate wins, culminating in a "random-tier pattern" after 500 victories. The UI is built using Raycast's Detail component with keyboard shortcuts for game interaction.

The implementation follows Raycast extension patterns with proper TypeScript typing, React hooks for state management, and ActionPanel integration for native keyboard controls. The extension is categorized under "Fun" and "Games", similar to existing gaming extensions like roll-d20, expanding Raycast's entertainment offerings with a more complex gameplay experience.

PR Description Notes:

  • The Buy Me a Coffee link contains a placeholder "yourusername" that should be updated to the actual username
  • Minor documentation inconsistency: shortcuts show "Shift + [1–0]" in description but implementation uses standard 1-0 keys

Important Files Changed

Changed Files
Filename Score Overview
extensions/dice-tiles/package.json 2/5 New extension package configuration with missing metadata folder, CHANGELOG.md, and ESLint setup
extensions/dice-tiles/src/index.tsx 4/5 Main game implementation with React hooks, dice mechanics, tile selection, and LocalStorage persistence
extensions/dice-tiles/README.md 4/5 Comprehensive game documentation with placeholder Buy Me a Coffee link and minor shortcut inconsistency
extensions/dice-tiles/LICENSE 5/5 Standard MIT License file with proper copyright attribution

Confidence score: 2/5

  • This PR introduces a new extension but has several critical missing components that prevent store submission
  • Score reflects missing required metadata folder with screenshots, missing CHANGELOG.md entry, and missing ESLint configuration
  • Pay close attention to package.json requirements and ensure all new extension submission requirements are met

Context used:

Rule from dashboard - Extensions must include at least one screenshot in a metadata folder for store submission. (source)
Rule from dashboard - ## ESLint Configuration

Import Path for defineConfig

  • The correct import path for `defineConf... (source)

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@Jumitti

ghost commented Oct 7, 2025 •

Copy link
Copy Markdown
Contributor Author

The shortcut documentation is accurate. Each tile selection is mapped to Shift + [1–0], consistent with the code:

shortcut={{ key: i === 9 ? "0" : `${i + 1}`, modifiers: ["shift"] }}

This explicitly applies the Shift modifier for all numeric keys (1 through 0). The reviewer’s observation seems based on a misunderstanding — the modifiers: ["shift"] property enforces the documented combination. No change required.

@Jumitti

ghost commented Oct 7, 2025

Copy link
Copy Markdown
Contributor Author

Sorry for the number of commits; I was just trying to fix as many issues as possible flagged by the verification bots...

@Jumitti Jumitti changed the title Dice Tiles Add dice-tiles extension Oct 8, 2025
@Jumitti

ghost commented Oct 15, 2025

Copy link
Copy Markdown
Contributor Author

@pernielsentikaer Sorry to bother you, but the PR bot isn't working and I don't understand why...

…iguration, and update dependencies. Remove outdated assets and improve README documentation.
@pernielsentikaer

ghost commented Oct 16, 2025

Copy link
Copy Markdown
Contributor

Hi 👋

I tried to optimize the code best possible, can you have a look to make sure I didn't break it

@raycastbot

ghost commented Oct 16, 2025

Copy link
Copy Markdown
Collaborator

Congratulations on your new Raycast extension! 🚀

You can expect an initial review within five business days.

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

@pernielsentikaer pernielsentikaer self-assigned this Oct 16, 2025
@raycastbot

ghost commented Oct 30, 2025

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 Oct 30, 2025

ghost 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 Overview

Greptile Summary

This PR introduces a new "dice-tiles" extension - a minimalist dice-and-tiles game for Raycast. The extension implements a game where players roll dice and eliminate numbered tiles by selecting combinations that match the dice sum, featuring persistent statistics tracking, progressive emoji-based rewards, and a special random pattern unlock at 500 victories. The codebase follows modern React patterns with a clean separation of concerns: custom hooks manage state and game logic (useGameState, useGameActions), pure utility functions handle game mechanics (gameLogic.ts), and separate UI components render the interface (GameDisplay, GameActions). The extension uses Raycast's LocalStorage for persistence, follows TypeScript best practices with proper type definitions, and includes comprehensive keyboard shortcuts for gameplay interaction.

Important Files Changed

Filename Score Overview
extensions/dice-tiles/package.json 4/5 Defines extension metadata, dependencies, and Raycast configuration for the new dice-tiles game
extensions/dice-tiles/src/index.tsx 5/5 Main component orchestrating game state and actions through custom hooks with clean architecture
extensions/dice-tiles/src/hooks/useGameState.ts 5/5 Custom hook managing all game state including tiles, HP, statistics, and persistent storage
extensions/dice-tiles/src/hooks/useGameActions.ts 4/5 Custom hook encapsulating game logic for dice rolling, validation, and victory/defeat handling
extensions/dice-tiles/src/components/GameDisplay.tsx 4/5 Optimized UI component rendering game state and help using Raycast's Detail component
extensions/dice-tiles/src/components/GameActions.tsx 4/5 ActionPanel component providing keyboard shortcuts with performance optimizations
extensions/dice-tiles/src/gameLogic.ts 4/5 Pure utility functions for dice rolling, validation, and reward calculations
extensions/dice-tiles/src/types.ts 5/5 Well-structured TypeScript interfaces defining game state, configuration, and reward system
extensions/dice-tiles/src/storage.ts 5/5 Simple storage functions for persisting victories and defeats using Raycast's LocalStorage
extensions/dice-tiles/src/constants.ts 5/5 Game configuration constants and emoji arrays for visual representation
extensions/dice-tiles/CHANGELOG.md 5/5 Properly formatted initial changelog entry with required template string
extensions/dice-tiles/README.md 5/5 Updated documentation with proper metadata folder structure and formatting

Confidence score: 4/5

  • This PR is generally safe to merge with well-structured code following React and Raycast best practices
  • Score reflects excellent architectural patterns but some complexity in game logic that could benefit from additional testing, plus missing metadata folder validation
  • Pay close attention to src/hooks/useGameActions.ts for complex game state transitions and ensure the metadata folder contains required screenshots

15 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +52 to +57
const handleMainAction = useCallback(() => {
if (showHelp) toggleHelp();
else if (gameOver) resetGame();
else if (lastRoll.length === 0) gameActions.rollDiceHandler();
else gameActions.validateSelectionHandler();
}, [showHelp, gameOver, lastRoll.length, toggleHelp, resetGame, gameActions]);

ghost Nov 4, 2025

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: Dependency array includes gameActions object which will cause unnecessary re-renders since objects have unstable references. Consider memoizing the gameActions hook or extracting specific functions needed.

await saveVictoriesWithPattern(newVictories);
setGameOver(true);
setMessage(
`🎉 Victory! Cleared all tiles! Total victories: ${newVictories} ${getLifeEmoji(victories, randomLifePattern)} — Press Enter to restart 🕹️`,

ghost Nov 4, 2025

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: Victory message uses old victories count instead of newVictories for emoji pattern calculation

Suggested change
`🎉 Victory! Cleared all tiles! Total victories: ${newVictories} ${getLifeEmoji(victories, randomLifePattern)} — Press Enter to restart 🕹️`,
`🎉 Victory! Cleared all tiles! Total victories: ${newVictories} ${getLifeEmoji(newVictories, randomLifePattern)} — Press Enter to restart 🕹️`,

Comment on lines +81 to +97
}, [
lastRoll,
gameOver,
selected,
tiles,
setTiles,
victories,
randomLifePattern,
saveVictoriesWithPattern,
hp,
setHp,
setMessage,
setGameOver,
saveDefeatsWithState,
setSelected,
setLastRoll,
]);

ghost Nov 4, 2025

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: Missing defeats dependency in useCallback dependency array

Suggested change
}, [
lastRoll,
gameOver,
selected,
tiles,
setTiles,
victories,
randomLifePattern,
saveVictoriesWithPattern,
hp,
setHp,
setMessage,
setGameOver,
saveDefeatsWithState,
setSelected,
setLastRoll,
]);
}, [
lastRoll,
gameOver,
selected,
tiles,
setTiles,
victories,
defeats,
randomLifePattern,
saveVictoriesWithPattern,
hp,
setHp,
setMessage,
setGameOver,
saveDefeatsWithState,
setSelected,
setLastRoll,
]);

Comment on lines +5 to +15
interface GameDisplayProps {
hp: number;
victories: number;
defeats: number;
randomLifePattern: string[];
message: string;
tiles: number[];
selected: number[];
showHelp: boolean;
actions: React.ReactNode;
}

ghost Nov 4, 2025

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 type instead of interface for better consistency with TypeScript conventions

Suggested change
interface GameDisplayProps {
hp: number;
victories: number;
defeats: number;
randomLifePattern: string[];
message: string;
tiles: number[];
selected: number[];
showHelp: boolean;
actions: React.ReactNode;
}
type GameDisplayProps = {
hp: number;
victories: number;
defeats: number;
randomLifePattern: string[];
message: string;
tiles: number[];
selected: number[];
showHelp: boolean;
actions: React.ReactNode;
}

Context Used: Context from dashboard - Coding style (source)

@pernielsentikaer

ghost commented Nov 7, 2025

Copy link
Copy Markdown
Contributor

Could you look into the suggestions from Greptile, @Jumitti

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 November 7, 2025 10:28
@Jumitti
Jumitti marked this pull request as ready for review November 7, 2025 10:41
@Jumitti

ghost commented Nov 7, 2025

Copy link
Copy Markdown
Contributor Author

Everything seems perfect to me. I was able to test it today and it works on my end.

Sorry for the late reply, I was in the middle of a big move and my PC wasn't working. Thank you very much for your help! 😀

ghost 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 Overview

Greptile Summary

This PR adds a new Raycast extension called "dice-tiles" - a minimalist dice-and-tiles game where players roll dice and eliminate numbered tiles by selecting combinations that match the dice roll sum. The extension includes a progressive reward system with emoji upgrades, persistent victory/defeat tracking through Raycast's LocalStorage API, and keyboard shortcuts for gameplay. The codebase is well-structured with proper separation of concerns: game state management in custom hooks, type definitions, constants for configuration, and storage utilities. The extension follows standard Raycast extension patterns with proper configuration files, documentation, and metadata.

Important Files Changed

Filename Score Overview
extensions/dice-tiles/package.json 4/5 New extension configuration with proper metadata and dependencies
extensions/dice-tiles/src/hooks/useGameState.ts 4/5 Game state management hook with proper structure and async data loading
extensions/dice-tiles/src/hooks/useGameActions.ts 4/5 Game actions hook encapsulating dice rolling and validation logic
extensions/dice-tiles/src/types.ts 5/5 Well-defined TypeScript interfaces for game state and configuration
extensions/dice-tiles/src/constants.ts 5/5 Clean game configuration constants and reward system setup
extensions/dice-tiles/src/storage.ts 5/5 Simple storage abstraction for persistent game statistics
extensions/dice-tiles/CHANGELOG.md 5/5 Proper changelog format with required PR_MERGE_DATE template
extensions/dice-tiles/README.md 5/5 Comprehensive documentation with gameplay rules and shortcuts
extensions/dice-tiles/LICENSE 5/5 Standard MIT license with proper attribution
extensions/dice-tiles/.prettierrc 5/5 Standard Raycast formatting configuration

Confidence score: 4/5

  • This PR adds a well-structured game extension with solid architecture and follows most Raycast guidelines
  • Score reflects generally good implementation but with some logic bugs in game mechanics that could affect user experience
  • The useGameActions hook needs attention due to a victory message bug and missing useCallback dependency

10 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@pernielsentikaer

ghost commented Nov 7, 2025

Copy link
Copy Markdown
Contributor

Let's get the first iteration out and then we'll see how it goes 😊

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

Looks good to me, approved 🔥

@raycastbot
raycastbot merged commit 7c6269c into raycast:main Nov 7, 2025
@github-actions

ghost commented Nov 7, 2025

Copy link
Copy Markdown
Contributor

@raycastbot

ghost commented Nov 7, 2025

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants