Skip to content

Feat(website)dinonuggieUpgrades + gamesLayout#156

Merged
XeIris merged 2 commits intoWebsiteSlopfrom
WebsiteSlopDinonuggie
May 7, 2026
Merged

Feat(website)dinonuggieUpgrades + gamesLayout#156
XeIris merged 2 commits intoWebsiteSlopfrom
WebsiteSlopDinonuggie

Conversation

@XeIris
Copy link
Copy Markdown
Collaborator

@XeIris XeIris commented May 7, 2026

Summary by CodeRabbit

  • New Features

    • Added an interactive Dinonuggie Upgrades hub with eat, upgrade, and ascension mechanics.
    • Added layout switcher to the games page (3×3 grid, 4×4 grid, or list view).
    • Exposed Dinonuggie Upgrades as a playable game alongside existing offerings.
  • Refactor

    • Centralized core game logic for improved consistency and maintainability across commands.

@XeIris XeIris self-assigned this May 7, 2026
@XeIris XeIris added enhancement New feature or request Website labels May 7, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 11aec635-dcfe-4446-8d22-6e2790ae8159

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch WebsiteSlopDinonuggie

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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@site_src/pages/games/dinonuggie_upgrades.ts`:
- Around line 176-188: Add a CSS rule for warning toasts so elements given
className 'toast warn' render with distinct styling: create a `.toast.warn`
selector alongside `.toast.error` and `.toast.ok` and set an appropriate warning
text color and border-color (and optionally background or min-height) to
visually distinguish warnings; update the styles block that defines `.toast` so
the new `.toast.warn` rule appears with the other toast modifiers.
- Around line 299-306: The api function currently throws on network/HTTP/JSON
failures causing callers that expect a resolved object to break; update
api(path, body) to always resolve to an object following the shared { error }
contract: perform the fetch as before, but catch network/errors and JSON parse
errors and return { error: <string> } (use a concise message), and for non-2xx
responses attempt to parse JSON and return its error field or fallback to {
error: response.statusText || 'Request failed' }; on success return the parsed
JSON; keep csrf merging behavior intact so callers using api(...) never receive
a thrown exception.

In `@utils/ascend.ts`:
- Around line 62-72: The current if-guard in processAscend lets multiple waiters
capture the same existing promise and race; change the pattern to a while loop
that repeatedly checks ascendLocks.get(userId) and, while an existing promise is
present, awaits it (with .catch(() => {}) to swallow errors) before re-checking,
then only when no existing promise set the new run via ascendLocks.set(userId,
run); apply the identical while-based re-check-and-wait fix to the analogous
functions buyAscLocks and buyLocks (and their respective lock maps) and keep the
finally block that deletes the lock only if the stored value equals run.

In `@utils/buyAscensionUpgrade.ts`:
- Around line 91-92: The two separate writes using client.db.user.addUserAttr
(debit 'heavenlyNuggies' then increment `${upgrade}Level`) are not atomic and
can leave users charged without receiving the upgrade; modify
buyAscensionUpgrade (and the same pattern in buyUpgrade) to perform both
mutations inside a single DB transaction or a single atomic update: either use
the DB client's transaction API (e.g., begin/commit/rollback or withTransaction)
to call both addUserAttr operations together, or add a new atomic method on
client.db.user (e.g., updateUserAttrs or changeCreditsAndLevel) that applies the
credit delta and level delta in one DB call and returns success/failure so you
can roll back on error.

In `@utils/eat.ts`:
- Around line 128-137: The current lock logic in processEat awaits an existing
promise (existing) and then starts a new processEatInner(), allowing concurrent
runs; instead, chain the new work onto the stored promise so B and C wait for A
and then run sequentially: replace the await-existing pattern by creating run as
either processEatInner(client, userId, amount) when no existing, or
existing.catch(()=>undefined).then(() => processEatInner(client, userId,
amount)) when there is an existing; keep eatLocks.set(userId, run) and the
finally cleanup unchanged (checking eatLocks.get(userId) === run) so the promise
chain is stored and removed correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1b4a9f79-8818-4dcc-af0b-3ce6a787c3bc

📥 Commits

Reviewing files that changed from the base of the PR and between c51ef85 and 5193cc2.

⛔ Files ignored due to path filters (1)
  • site_src/Assets/svg/wrench-screwdriver-svgrepo-com.svg is excluded by !**/*.svg
📒 Files selected for processing (14)
  • commands/ascend.ts
  • commands/buy_ascension.ts
  • commands/buy_upgrades.ts
  • commands/eat.ts
  • site_src/bot-bridge.ts
  • site_src/pages/games.ts
  • site_src/pages/games/dinonuggie_upgrades.ts
  • site_src/routes/games-api.ts
  • site_src/routes/pages.ts
  • site_src/routes/static.ts
  • utils/ascend.ts
  • utils/buyAscensionUpgrade.ts
  • utils/buyUpgrade.ts
  • utils/eat.ts

Comment thread site_src/pages/games/dinonuggie_upgrades.ts
Comment thread site_src/pages/games/dinonuggie_upgrades.ts
Comment thread utils/ascend.ts
Comment thread utils/buyAscensionUpgrade.ts Outdated
Comment thread utils/eat.ts
@XeIris XeIris merged commit 2bd2312 into WebsiteSlop May 7, 2026
1 check was pending
@XeIris XeIris deleted the WebsiteSlopDinonuggie branch May 7, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant