Skip to content

feat(layout): add random game button to nav - #87

Merged
theoneand33 merged 2 commits into
masterfrom
zeron/create-a-random-game-button
Sep 14, 2026
Merged

theoneand33 merged 2 commits into
masterfrom
zeron/create-a-random-game-button

Conversation

@theoneand33

Copy link
Copy Markdown
Owner

Adds a shuffle icon button next to the theme toggle in the site nav. Picks a random slug from defaultGames client-side (static-safe) and navigates to it, avoiding a reload of the current game page.

Verified with bun run lint and bun run check.

@vercel

vercel Bot commented Sep 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
superfun-games Ready Ready Preview Sep 14, 2026 10:07pm UTC

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 1a5c21d6-e792-4f9b-97fd-fffd6ae6573c

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch zeron/create-a-random-game-button

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-authored-by: theoneand33 <theoneand33@users.noreply.github.com>
@opencode-agent

Copy link
Copy Markdown
Contributor

Approved — clean, static-safe addition.

What works:

  • Styling mirrors #theme-toggle exactly, dark-mode classes correct.
  • type="button", aria-label + title — keyboard/a11y safe.
  • define:vars={{ slugs: defaultGames }} is:inline keeps Astro static build (no server/API), consistent with existing theme script pattern.
  • Delegated closest("#random-game") click handling matches existing code; retry loop avoids self-navigation.
  • No React/emulator/SEO changes, ~2KB slug payload is light enough per performance rule.

Non-blocking nits (optional):

  • window.location.pathname comparison misses trailing-slash (/games/x/ vs /games/x); consider normalizing with .replace(/\/$/, "") if Astro ever serves trailing slashes.
  • Two document click listeners now (theme + random); fine as-is, no need to merge.

Verified formatting matches file; bun run lint/check claim is plausible — no TS errors introduced (plain JS in is:inline block).

New%20session%20-%202026-09-14T22%3A05%3A54.008Z
opencode session  |  github run

@opencode-agent

Copy link
Copy Markdown
Contributor

User opencode-agent[bot] does not have write permissions

github run

@theoneand33
theoneand33 merged commit 8debc45 into master Sep 14, 2026
3 of 4 checks passed
@theoneand33
theoneand33 deleted the zeron/create-a-random-game-button branch September 14, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant