[2 / 7] - Characters menu#199
Conversation
📝 WalkthroughWalkthroughAdds an ChangesCharacter Order Screen Rework
Admin Dark Mode Toggle
Sequence Diagram(s)sequenceDiagram
rect rgba(100, 149, 237, 0.5)
Note over Browser,UserMeta: Dark Mode Toggle
end
participant Browser
participant DarkMode.php
participant WP_AJAX
participant UserMeta
Browser->>DarkMode.php: admin_bar_menu (page load)
DarkMode.php->>UserMeta: get_user_meta(acore_dark_mode)
UserMeta-->>DarkMode.php: current value
DarkMode.php-->>Browser: render sun/moon icon + body class
Browser->>WP_AJAX: POST acore_toggle_dark_mode + nonce
WP_AJAX->>WP_AJAX: wp_verify_nonce()
WP_AJAX->>UserMeta: update_user_meta(flip value)
UserMeta-->>WP_AJAX: saved
WP_AJAX-->>Browser: JSON {dark: bool}
Browser->>Browser: toggle body.acore-dark-mode + update icon/title
sequenceDiagram
rect rgba(144, 238, 144, 0.5)
Note over Browser,CharDB: Character Order Reset
end
participant Browser
participant loadHome
participant resetCharacterOrder
participant CharDB
Browser->>loadHome: POST acore_reset_order + nonce
loadHome->>loadHome: check_admin_referer()
loadHome->>resetCharacterOrder: call
resetCharacterOrder->>CharDB: UPDATE characters SET order=NULL WHERE account=? AND deleteInfos_Account=0
CharDB-->>resetCharacterOrder: ok
resetCharacterOrder-->>loadHome: done
loadHome-->>Browser: "Character order reset successfully" notice
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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/acore-wp-plugin/src/Components/CharactersMenu/CharactersController.php`:
- Line 26: The success notice message in the admin notice has a spelling error
where "succesfully" should be "successfully". In the div with class "updated",
locate the text "Character settings succesfully saved." and correct the
misspelling to "Character settings successfully saved." to ensure the
user-visible message is grammatically correct.
In `@src/acore-wp-plugin/src/Components/CharactersMenu/CharactersView.php`:
- Line 31: The introductory sentence in the paragraph element on line 31 of
CharactersView.php is grammatically broken and reads awkwardly due to the comma
splice construction "by dragging them, matches in-game position". Rewrite this
sentence to be grammatically correct and clear for the admin UI, restructuring
it to properly connect the dragging action with the outcome of matching the
in-game position. The revised text should flow naturally and clearly communicate
the purpose of the feature to users.
In `@src/acore-wp-plugin/web/assets/css/main.css`:
- Around line 45-54: The CSS rule for preventing text selection in character
rows currently targets only button.acore-char-row, but character rows are also
rendered as div.acore-char-row elements in CharactersView.php. Add a selector
for .acore-char-row (without the button prefix) to the rule so that the
user-select: none property applies to both button and div elements with the
acore-char-row class, ensuring all character row elements are included in the
selection lock.
In `@src/acore-wp-plugin/web/assets/css/theme.css`:
- Around line 600-616: The CSS selectors for dark mode styling are too broad and
affect all WordPress admin pages instead of only myCRED-specific pages. Add the
`.mycred-log-page` class to each selector in the dark mode rule set that
currently targets `.subsubsub a`, `input[type="checkbox"]`, and `a.btn`
elements. This will scope all the color and styling overrides to only apply when
the `.mycred-log-page` class is present, preventing unintended style changes on
unrelated admin pages.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6d5a0e4d-cdf1-449a-a0bc-d85393b7be3e
📒 Files selected for processing (8)
src/acore-wp-plugin/src/Components/CharactersMenu/CharactersController.phpsrc/acore-wp-plugin/src/Components/CharactersMenu/CharactersView.phpsrc/acore-wp-plugin/src/Hooks/Various/DarkMode.phpsrc/acore-wp-plugin/src/Utils/AcoreCharColors.phpsrc/acore-wp-plugin/src/boot.phpsrc/acore-wp-plugin/web/assets/css/dark-mode.csssrc/acore-wp-plugin/web/assets/css/main.csssrc/acore-wp-plugin/web/assets/css/theme.css
(Resume generated by Claude) **PR azerothcore#199 — Characters Menu** - Fixed typo: "succesfully" → "successfully" in save confirmation - Fixed broken sentence in the Order Character Screen description - Extended `user-select: none` to cover all `.acore-char-row` elements, not just `button` **PR azerothcore#200 — Mail Return** - *(issues covered by later PRs — no unique fixes)* **PR azerothcore#201 — Item Restoration** - Added `alt=` attributes to race/class icons in `CharactersView.php` - `ToolsApi`: `ItemRestoreList` now catches exceptions and returns a 403 instead of a 500 - `ToolsApi` + `ACoreServices`: **Security fix** — `ItemRestore` now verifies the recovery item belongs to the character, not just that the user owns the character name (IDOR vulnerability) **PR azerothcore#202 — Unstuck / Scroll / RAF** - `ItemRestorationPage`: removed brittle `data.includes('mail')` success check — any HTTP success now triggers the success path **PR azerothcore#203 — Security Tab** - `CharactersController`: `resetCharacterOrder()` now guards against invalid/null account ID before running UPDATE - `Tools.php`: added `esc_attr()` on banned-names table input (XSS fix) - `Tools.php`: added `is_array()` guard on thresholds `foreach` - `Tools.php` + `SettingsController`: added sentinel input so deleting all thresholds actually clears them in the DB - `Tools.php`: GeoIP hidden fallback `value="0"` is now always rendered, not conditionally **PR azerothcore#204 — Admin Settings / CSRF** - `AcoreCharColors`: removed unused `$fDark`, unknown race IDs now get a neutral color instead of Horde red - `MailReturnView`: added `esc_url()` on race/class icon `src` attributes - `DarkMode`: added `dmToggleInFlight` flag to prevent overlapping AJAX requests on rapid dark mode clicks
|
The reviews are valid for this, but the are fixed in the on the way to latest PR and including he last PR #205 PR #199 — Characters Menu
|
Split from the main PR: #197
Split by Claude
Reworked character rows (class-colour tab, faction-colour border, level badge, bigger race/class icons with tooltips). Adds a Reset Order button that nulls the DB order to fix characters soft-locked out of login.
Summary by CodeRabbit
New Features
Improvements