Skip to content

Fix admin Adjust Balance button hidden behind pending-orders check#665

Open
dhamariT wants to merge 1 commit into
mainfrom
kyoto
Open

Fix admin Adjust Balance button hidden behind pending-orders check#665
dhamariT wants to merge 1 commit into
mainfrom
kyoto

Conversation

@dhamariT

@dhamariT dhamariT commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

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 if now 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.

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.
@dhamariT dhamariT marked this pull request as ready for review June 24, 2026 15:47
@dhamariT dhamariT added this pull request to the merge queue Jun 24, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 24, 2026
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