Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThe purchase flow now returns structured insufficient-currency results, shows a reusable dialog for them, and updates the store text used by that dialog. ChangesInsufficient Currency Purchase Flow
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
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. Comment |
| resolved.type === "flag" | ||
| ? translateCosmetic("flags", c.name) | ||
| : translateCosmetic("territory_patterns.pattern", c.name); | ||
| const dialog = document.createElement("confirm-dialog") as ConfirmDialog; |
There was a problem hiding this comment.
instead can we use this as an elemnt like:
return html<confirm-dialogue> ... </confirm-dialogue>
There was a problem hiding this comment.
yes, but split it out into src/client/components/InsufficientCurrencyDialog.ts, which now renders declaratively
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@src/client/Cosmetics.ts`:
- Around line 159-161: The `InsufficientCurrencyDialog.show` call in
`Cosmetics.ts` is formatting `shortfall` too early with `toLocaleString()`,
which can leak browser-locale separators into the dialog. Pass the raw numeric
value from `(price - balance)` into `shortfall` and let the translation/message
formatting handle localization inside the dialog text.
🪄 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: 934a37bf-3e59-4ec5-8885-bc3394196440
📒 Files selected for processing (2)
src/client/Cosmetics.tssrc/client/components/InsufficientCurrencyDialog.ts
When a player can't afford a cosmetic (plutonium or caps), show a styled dialog (reusing the clan-system <confirm-dialog>) instead of a native alert. Plutonium offers a 'Purchase' button that opens the store packs tab; caps are dismiss-only. The purchase outcome flows up from purchaseCosmetic through the cosmetic button/container to PurchaseButton, which renders the dialog from reactive state. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Description:
change the generic popup:

into a popup i added for clan system:

caps doesn't have a "buy" button:

also works for win modal:

Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
w.o.n