Skip to content

Conversation

Soare-Robert-Daniel
Copy link
Contributor

@Soare-Robert-Daniel Soare-Robert-Daniel commented Sep 12, 2025

All Submissions:

Changes proposed in this Pull Request:

Moved the image sample loading inside the Compression component. When using in Compression, the loading will behave like the refresh button, which requests the optimized images with the force=true parameter that prevents the cache.

Closes https://github.com/Codeinwp/optimole-service/issues/1512

How to test the changes in this Pull Request:

  1. Go to Advanced > Compression and choose Custom
  2. Disable Auto Quality Powered by ML(Machine Learning)
  3. Press on View sample image
  4. Check the displayed data
2025-09-12_15-13-50.mp4

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@Soare-Robert-Daniel Soare-Robert-Daniel self-assigned this Sep 12, 2025
@Soare-Robert-Daniel Soare-Robert-Daniel marked this pull request as ready for review September 12, 2025 12:32
@pirate-bot
Copy link
Collaborator

Plugin build for afe13c6 is ready 🛎️!

Copy link
Contributor

@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 moves the image sample loading functionality from the main Settings component into the Compression component to ensure proper behavior when viewing quality samples. The change ensures that when the "View sample image" button is clicked, the optimized images are fetched with the force=true parameter to bypass cache, similar to the refresh button behavior.

  • Removed the loadSample function from the main Settings component and simplified the button to only toggle visibility
  • Added a useEffect hook in the Compression component to automatically load samples when showSample becomes true
  • Updated the button click handler to use the simplified toggleShowSample function

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
assets/src/dashboard/parts/connected/settings/index.js Removed sample loading logic and simplified button to toggle visibility only
assets/src/dashboard/parts/connected/settings/Compression.js Added useEffect to handle sample loading when showSample state changes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@selul selul left a comment

Choose a reason for hiding this comment

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

lgtm 🚀

@selul selul merged commit aa390de into development Sep 16, 2025
14 checks passed
@selul selul deleted the fix/sample-image-quality branch September 16, 2025 06:45
@pirate-bot
Copy link
Collaborator

🎉 This PR is included in version 4.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Indicate that an issue has been resolved and released in a particular version of the product.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants