[Bugfix:Forum] Fix OP badge on anonymous toggle#12442
Conversation
|
Hi @bmcutler @williamjallen, I've implemented a fix for issue #11755 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12442 +/- ##
=========================================
Coverage 21.70% 21.70%
Complexity 9626 9626
=========================================
Files 268 268
Lines 36188 36188
Branches 486 486
=========================================
Hits 7856 7856
Misses 27850 27850
Partials 482 482
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Fixes Submitty#12442 Targets the specific .author-name span during the JS changeName event to avoid deleting the sibling OP badge. Removes hardcoded black color for dark-mode compatibility.
8c88bdf to
fa69514
Compare
williamjallen
left a comment
There was a problem hiding this comment.
Changes seem reasonable to me, but I'll defer a formal approval to whoever does a functionality review.
JManion32
left a comment
There was a problem hiding this comment.
I did a functionality review and was able to verify that the color of the name is as expected on light and dark mode, and the OP badge no longer disappears when revealing the name. Great work!
Why is this Change Important & Necessary?
Fixes #11755
This change is necessary because toggling the anonymity of a student in the Instructor Discussion Forum (using the "eye" icon) causes the Original Poster (OP) badge to disappear from the DOM. Additionally, toggling back to "Anonymous" hardcodes the text color to black when the site is set to Dark Mode.
What is the New Behavior?
visible_usernameinside a targeted.author-namespan so JavaScript does not overwrite sibling elements (like the OP badge)..author-nameand removes thecolorproperty instead of overriding it, keeping CSS inheritance intact for dark mode.Before:-

After:-


What steps should a reviewer take to reproduce or test the bug or new feature?
Automated Testing & Documentation
N/A - This is a CSS and DOM structure change that requires manual UI verification in the browser to confirm dark/light mode behavior.
Other information
This is not a breaking change.
No migrations are required.
No security concerns.