Skip to content

Update/section progress bar issue #80

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

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

circlecube
Copy link
Member

Proposed changes

After #78, the progress bar stopped working.

Earlier, a task update would essentially reload the whole app, but that PR fixed that. The progress bar wasn't set up to receive task updates, so this fixes the section component to dynamically update the progress bar.

While fixing, I also noticed the open endpoint was hit on load for every open section, so I updated that with some useRef in each component for the initial open state. I also cleaned up components some more and then updated the test to verify that the progress bar updates when a task is completed and that when a section is complete, we see a success/celebration pane.

Type of Change

Production

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update
  • Refactoring / housekeeping (changes to files not directly related to functionality)

Development

  • Tests
  • Dependency update
  • Environment update / refactoring
  • Documentation Update

Visual

Checklist

  • I have read the CONTRIBUTING doc
  • I have viewed my change in a web-browser
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

* main:
  NPM Dev(deps-dev): Bump @wordpress/scripts from 30.20.0 to 30.21.0
  NPM Dev(deps-dev): Bump @wordpress/dom-ready from 4.27.0 to 4.28.0
  NPM(deps): Bump @wordpress/api-fetch from 7.27.0 to 7.28.0
  NPM Dev(deps-dev): Bump mini-css-extract-plugin from 2.9.2 to 2.9.3
@circlecube circlecube requested a review from a team August 8, 2025 20:25
@circlecube circlecube self-assigned this Aug 8, 2025
@circlecube
Copy link
Member Author

I also made an update to the progress bar text so this failing a11y test should be fixed too: newfold-labs/wp-plugin-bluehost#406

@wpscholar wpscholar requested a review from Copilot August 8, 2025 21:36
Copilot

This comment was marked as outdated.

@wpscholar wpscholar requested a review from Copilot August 11, 2025 17:33
Copilot

This comment was marked as outdated.

@wpscholar wpscholar requested a review from Copilot August 11, 2025 19:53
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 fixes a critical issue where the progress bar stopped working after PR #78. It implements dynamic progress bar updates when tasks are completed, optimizes API calls to prevent unnecessary hits on page load, and refactors the codebase for better maintainability using React hooks and immutability patterns.

  • Fixes progress bar to dynamically update when task status changes
  • Optimizes initial open state handling to prevent unnecessary API calls
  • Refactors components with memoization and proper state management

Reviewed Changes

Copilot reviewed 19 out of 21 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/cypress/integration/next-steps-widget.cy.js Updated test assertions to verify progress bar updates and success celebration
tests/cypress/integration/next-steps-portal.cy.js Simplified test structure and removed redundant version handling tests
src/components/track/index.js Added memo, useRef hooks, and improved initial state handling
src/components/task/index.js Added memo, task status synchronization, and better error handling
src/components/section/index.js Refactored with memo, progress data from props, and celebration logic
src/components/progressBar/index.js Added memo wrapper for performance optimization
src/components/nextSteps/styles.scss Enhanced celebration visibility conditions and text shadow
src/components/nextSteps/index.js Major refactor with progress calculation, immutable state updates, and helper imports
src/components/nextSteps/helpers.js New helper file with API functions and immutable state update utilities
includes/StepsApi.php Updated API parameter names for consistency
includes/PlanManager.php Changed default track open state to false
Build files Updated compiled assets with new functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant