Conversation
A bad merge wrapped the Adjust Balance button (and View Votes, Set Vote Balance, Cancel HCB Grants, Flipper Features, and Internal Notes) inside an 'if user has pending shop orders' conditional, so they only rendered for users with pending orders. The same merge left duplicate Impersonate / Sync / Refresh / role-management / Reject Orders blocks inside that conditional. Keep Reject Orders gated by pending orders, remove the duplicate blocks, and un-nest the rest so admins can always grant/deduct stardust from a user.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what's this do?
Fixes the admin "💰 Adjust Balance" button (for granting/deducting a user's stardust) that had gone missing from user admin pages. A bad merge had accidentally wrapped it — along with View Votes, Set Vote Balance, Cancel HCB Grants, the Flipper Features panel, and Internal Notes — inside an "if this user has pending shop orders" check, so those controls only showed up for users who happened to have pending orders. That same merge also left duplicate Impersonate / Sync / Refresh / role-management / Reject Orders blocks inside the same check. This PR keeps Reject Orders gated by pending orders (where it belongs), deletes the duplicate blocks, and un-nests everything else so admins can always adjust a user's stardust.
show it works
On any user's admin page (
/admin/users/:id), an admin now always sees the 💰 Adjust Balance button regardless of whether the user has pending orders. Verified the ERB if/do/end nesting is balanced after the change. Worth a quick manual check on a real admin login.ai?
Yes — Claude Code (Opus 4.8) diagnosed the merge bug and made the edit.
Note
Low Risk
View-only template restructuring with no controller or authorization logic changes; main risk is a markup nesting mistake, which this PR is meant to correct.
Overview
Fixes broken ERB nesting on the admin user show page so routine controls are no longer tied to “has pending shop orders.”
The pending-orders
ifnow wraps only Reject Orders and its modal. Removed a large duplicate block (second Impersonate, Hackatime sync, verification refresh, role promote/demote dropdowns, inline dropdown script, and a second Reject Orders UI) that had been nested inside that check. Also drops an extra closing<% end %>so Adjust Balance, vote tools, Flipper, Internal Notes, and lower-page sections render for every user again.Reviewed by Cursor Bugbot for commit 290128e. Bugbot is set up for automated code reviews on this repo. Configure here.