Skip to content

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

Merged
merged 9 commits into from
May 21, 2025
Merged

Remove the JS wave effect #1718

merged 9 commits into from
May 21, 2025

Conversation

pfefferle
Copy link
Member

@pfefferle pfefferle commented May 20, 2025

Simplify the code, to rely on CSS instead of JS effects.

Screen Recording 2025-05-20 at 10 38 31

Proposed changes:

  • Removed JS effects
  • Added simple CSS hover effect

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Go to '..'

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

Refactored to use CSS for effects instead of JavaScript, simplifying the code.

Simplify the code, to rely on CSS instead of JS effects.
@pfefferle pfefferle requested review from Copilot and obenland and removed request for Copilot May 20, 2025 08:35
@pfefferle pfefferle self-assigned this May 20, 2025
@github-actions github-actions bot added [Block] Reactions [Feature] Reactions [Focus] Editor Changes to the ActivityPub experience in the block editor labels May 20, 2025
@pfefferle pfefferle requested a review from Copilot May 20, 2025 09:01
Copy link

@Copilot Copilot AI left a 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 ) }

obenland
obenland previously approved these changes May 20, 2025
Copy link
Member

@obenland obenland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pfefferle pfefferle requested review from obenland and Copilot May 20, 2025 13:19
Copy link

@Copilot Copilot AI left a 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); }

@pfefferle pfefferle requested a review from Copilot May 21, 2025 13:02
Copy link

@Copilot Copilot AI left a 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 = [

@pfefferle pfefferle merged commit 791604b into trunk May 21, 2025
11 checks passed
@pfefferle pfefferle deleted the remove/wave-effect branch May 21, 2025 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Reactions [Feature] Reactions [Focus] Editor Changes to the ActivityPub experience in the block editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants