-
Notifications
You must be signed in to change notification settings - Fork 81
Remove the JS wave effect #1718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Simplify the code, to rely on CSS instead of JS effects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the previously implemented JavaScript-based wave animation effect from reaction avatars and replaces it with a simplified CSS hover effect. Key changes include:
- Deletion of JS logic (state management, timers, event handlers) for creating waves.
- Removal of related CSS classes (e.g. .wave-active and its rotation variations) in favor of a simple :hover transform.
- Minor asset version updates to reflect these changes.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/reactions/style.scss | Removed redundant .wave-active and rotation modifier blocks; CSS now directly applies a hover transform. |
src/reactions/reactions.js | Eliminated JS state/timer logic and mouse event handlers for wave effects. |
build/reactions/* | Updated build assets to accommodate removal of JS effects. |
.github/changelog/1718-from-description | Added an updated changelog entry confirming the use of CSS over JS. |
Comments suppressed due to low confidence (2)
src/reactions/style.scss:54
- The .wave-active block and its nested rotation modifiers have been removed in favor of a simpler :hover effect. Please ensure that the new CSS hover transform meets the intended design requirements without the additional rotation behaviors.
&.wave-active { ... }
src/reactions/reactions.js:22
- JS event handlers for initiating and retracting the wave effect have been removed. Confirm that the exclusive reliance on CSS hover effects provides sufficient user feedback for the reaction avatars.
onMouseEnter={ () => startWave( index, true ) } onMouseLeave={ () => startWave( index, false ) }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, it's also removed in the in-progress branch for making the Reactions block use the Interactivity API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR simplifies the reactions feature by removing the JavaScript‐driven wave effect and replacing it with a simple CSS hover effect.
- Removed JavaScript logic and state for the wave effect from reactions.js and index.js.
- Updated CSS files (style.scss, style-index.css, style-index-rtl.css) to use a basic hover transform instead of the previous wave animation.
- Bumped version numbers in built asset files and added a corresponding changelog entry.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/reactions/style.scss | Removed wave-active and rotation classes; added hover effect |
src/reactions/reactions.js | Removed state and event handler logic related to wave animations |
build/reactions/view.js | Updated build file reflecting removal of JS effects |
build/reactions/view.asset.php | Version metadata update |
build/reactions/style-index.css | Updated CSS to rely on hover effect instead of wave-active classes |
build/reactions/style-index-rtl.css | RTL CSS updated to use hover effect consistently |
build/reactions/index.js | Removed JS wave effect logic; streamlined event handlers |
build/reactions/index.asset.php | Version metadata update |
.github/changelog/1718-from-description | Added changelog entry summarizing the simplification change |
Comments suppressed due to low confidence (2)
src/reactions/reactions.js:16
- Since the JavaScript-based wave effect has been removed, please ensure that existing tests are updated or added to verify that the new CSS hover effect provides the intended visual behavior.
const [ activeIndices, setActiveIndices ] = useState( new Set() );
src/reactions/style.scss:55
- [nitpick] Consider adding a comment explaining that this hover effect replaces the previously implemented JS wave effect to help future maintainers understand the design decision.
&:hover { z-index: 1; position: relative; transform: translateY(-5px); }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the JavaScript-driven “wave” animation for reaction avatars and replaces it with a simpler CSS hover transform.
- Stripped out all JS state, timers, and mouse handlers related to the wave effect.
- Updated SCSS to apply a
translateY
on:hover
instead of toggling classes via JS. - Regenerated build artifacts (CSS, JS, asset manifests) to reflect the removal of wave logic.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/reactions/style.scss | Removed .wave-active rules and rotations, added hover transform |
src/reactions/reactions.js | Deleted wave-state hooks, timers, handlers, and related code |
build/reactions/view.js | Stripped out wave logic from the compiled view script |
build/reactions/view.asset.php | Bumped version hash after removing wave code |
build/reactions/style-index.css | Removed wave CSS rules and added hover transform |
build/reactions/style-index-rtl.css | Same CSS update for RTL build |
build/reactions/index.js | Removed wave effect code from the compiled index script |
build/reactions/index.asset.php | Bumped version hash after removing wave code |
.github/changelog/1718-from-description | Added changelog entry for the minor refactor |
Comments suppressed due to low confidence (1)
src/reactions/reactions.js:23
- [nitpick] The classes array now only contains a single static value; you could simplify this by using a literal string for the className instead of building/filtering an array.
const classes = [
Simplify the code, to rely on CSS instead of JS effects.
Proposed changes:
Other information:
Testing instructions:
Changelog entry
Changelog Entry Details
Significance
Type
Message
Refactored to use CSS for effects instead of JavaScript, simplifying the code.