Skip to content

refactor(ponytail): drop dead branch, aliases, and one-use constants - #99

Merged
theoneand33 merged 2 commits into
masterfrom
bb/ponytail-audit-thr_udvjis3uix
Sep 27, 2026
Merged

theoneand33 merged 2 commits into
masterfrom
bb/ponytail-audit-thr_udvjis3uix

Conversation

@theoneand33

Copy link
Copy Markdown
Owner

Ponytail-audit follow-up, scoped to the 4 zero-regression cuts:

  • [slug].astro: remove unreachable Game-not-available else branch (every non-flash slug is run-3/webtris, all others isFlash)
  • game-seo.ts: ...(guide ? { guide } : {}) spread -> guide: guide || undefined (identical runtime shape for all seo.guide && checks); drop POPULAR_COUNT / MORE_GAMES_COUNT, inline 11 / 9 at use sites
  • layout.astro / index.astro: drop knownGames alias, use defaultGames directly
  • AGENTS.md: sync docs with inlined counts

Verified: bun run check (astro check + build + pagefind) and bun run lint pass.

Deferred as follow-up (rewrites ~200 call sites, kept out of this diff): converting seo() to an object param.

- [slug].astro: remove unreachable Game-not-available else branch
- game-seo.ts: guide conditional spread -> guide || undefined; drop
  POPULAR_COUNT / MORE_GAMES_COUNT, inline 11 / 9 at use sites
- layout/index: drop knownGames alias, use defaultGames directly
- AGENTS.md: sync docs with inlined counts
@vercel

vercel Bot commented Sep 27, 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 27, 2026 10:12pm UTC

@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

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: 40f4f9b8-0c63-4dc3-a054-85762ebfe13d


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.

@opencode-agent

Copy link
Copy Markdown
Contributor

Review: approve

Verified each cut against the codebase. No runtime changes, no dangling references.

1. [slug].astro dead branch → : null — correct.
Only two entries in gamesMap have isFlash: false (src/data/game-seo.ts:230 run-3, :564 webtris), and both have explicit branches. The old <p>Game not available.</p> else was unreachable. One tradeoff to be aware of: a future HTML5 game added without its branch (per AGENTS.md §2.3) will now render a blank game area instead of the fallback message. Acceptable, but that failure will be silent.

2. guide: guide || undefined — equivalent.
All guide consumers are truthiness checks ([slug].astro:78 seo.guide &&, layout.astro:149 seo?.guide &&). undefined-valued key vs. missing key behaves identically there and under JSON.stringify. Nothing enumerates keys or uses in. || (not ??) is the right operator here since it preserves the old truthiness semantics for "".

3. Inlined 11 / 9, dropped POPULAR_COUNT / MORE_GAMES_COUNT — runtime-identical, small maintainability cost.
Confirmed zero remaining references to either constant or knownGames. The counts now live as magic numbers in three files (index.astro, layout.astro, generate-llms.ts) that must stay in sync with no compiler help; AGENTS.md documents the sync requirement, which mitigates it. Non-blocking suggestion: a one-line // keep in sync: popular = 11, more-games = 9 pointer at each use site would replace what the named exports used to do.

4. Dropped knownGames alias — pure cleanup. Direct defaultGames use is identical.

Could not re-run bun run lint / bun run check — bun isn't available in this environment — so taking the author's verification at face value. The diff is small enough that static inspection covers it: no imports broken, no logic altered.

New%20session%20-%202026-09-27T22%3A09%3A40.616Z
opencode session  |  github run

@opencode-agent

Copy link
Copy Markdown
Contributor

Review: approve

Verified each cut by inspection. No runtime change, no dangling references.

1. [slug].astro dead branch → : null — correct.
Only two gamesMap entries have isFlash: false (src/data/game-seo.ts:230 run-3, :559 webtris), and both have explicit branches ahead of the else. The old <p>Game not available.</p> was unreachable with current data. Tradeoff: a future HTML5 game added without its required branch (AGENTS.md §2.3) now renders a blank game area instead of a visible fallback. Silent failure, but adding the branch is already a documented required step, so acceptable.

2. guide: guide || undefined — equivalent.
All consumers are truthiness checks ([slug].astro:78 seo.guide &&, layout.astro:150 seo?.guide && + text: seo.guide). Missing key vs. undefined-valued key behaves identically there and under JSON.stringify. Nothing uses in or enumerates keys. || (not ??) correctly preserves the old falsy-"" semantics since the default param is "". Typechecks: string | undefined into guide?: string.

3. Inline 11 / 9, drop POPULAR_COUNT / MORE_GAMES_COUNT — runtime-identical, small maintainability cost.
Confirmed zero remaining references to either constant. Both slices updated consistently (index.astro:10 + generate-llms.ts:14 = 11; layout.astro:54,59 = 9; AGENTS.md synced). Note POPULAR_COUNT was actually shared by two files, so this removes a real single-source guard and replaces it with keep in sync comments (second commit). Weaker than the import, but mitigated by the comments + docs. Non-blocking.

4. Drop knownGames alias — pure cleanup. All four use sites (layout.astro ×2, index.astro ×2) switched to defaultGames directly. Identical behavior.

Could not re-run bun run check / bun run lint — bun and node_modules aren't available in this environment — so taking the author's green verification at face value. Diff is small and statically safe: no imports broken, no logic altered. Agree with deferring the seo() object-param rewrite (~200 call sites) to a follow-up.

New%20session%20-%202026-09-27T22%3A11%3A45.092Z
opencode session  |  github run

@theoneand33
theoneand33 merged commit 5dd23c2 into master Sep 27, 2026
4 of 5 checks passed
@theoneand33
theoneand33 deleted the bb/ponytail-audit-thr_udvjis3uix branch October 21, 2026 23:55

This branch was successfully deployed

1 active deployment
Preview — 77b24b06 Deployed Sep 27, 2026 by vercel[bot]
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