Skip to content
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

CYS - Ensure the offline modal is displayed whenever AI is unavailable #42949

Merged
merged 6 commits into from Dec 21, 2023

Conversation

albarin
Copy link
Contributor

@albarin albarin commented Dec 19, 2023

Submission Review Guidelines:

Changes proposed in this Pull Request:

The goal of this PR is to show the AI offline modal always when the AI is unavailable, independently from the onboarding tour.
For that, a new AiOfflineModal component is created and extracted from the OnboardingTour component.

Closes #42905

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

Case 1: after first creation

  1. Make sure you have WooCommerce Beta Tester installed.
  2. Enable customize-store feature flag in Tools -> WCA Test Helper -> Features.
  3. Go to WooCommerce -> Home and click on Customize your store task.
  4. Open your browser's inspector and use Chrome's content override feature to change the content of https://status.openai.com/api/v2/status.json call. Change status.indicator to major.
  5. Refresh the page, go through the process.
  6. Check you see the AI offline modal.
  7. Skip the modal, refresh the page, and make sure you see again the modal but without the buttons and mentions of the tour.
Screenshot 2023-12-19 at 16 24 57
  1. This is the expected result depending on the onboarding tour and AI status.
Show onboarding AI Result
yes online Show onboarding tour on the left
yes offline Show AI offline modal with buttons
no online No modal or onboarding
no offline Show AI offline modal without buttons

Case 2: when customizing an existing store

  1. After testing case 1, click Done to confirm the store design.
  2. Go to WooCommerce -> Home and click on Customize your store task again.
  3. Click on the Customize button.
  4. Make sure the AI offline modal doesn't show anymore.

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Ensure the offline modal is displayed whenever AI is unavailable and not just on the initial store setup.

Comment

@albarin albarin added type: enhancement The issue is a request for an enhancement. plugin: woocommerce Issues related to the WooCommerce Core plugin. focus: ai team: Kirigami & Origami labels Dec 19, 2023
Copy link
Contributor

github-actions bot commented Dec 19, 2023

Test Results Summary

Commit SHA: f1d361e

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 38s
E2E Tests258003026115m 17s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@albarin albarin marked this pull request as ready for review December 19, 2023 15:29
Copy link
Contributor

github-actions bot commented Dec 19, 2023

Hi @chihsuan, @gigitux, @nefeline,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

Copy link
Contributor

@gigitux gigitux left a comment

Choose a reason for hiding this comment

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

Nice work! LGTM!

Copy link
Member

@chihsuan chihsuan left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

However, I noticed that when I click on Customize button in intro screen, and AI is offline, I see the offline modal as well. Is it expected?

Screen.Recording.2023-12-20.at.17.17.21.mov

Copy link
Member

@nefeline nefeline left a comment

Choose a reason for hiding this comment

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

Excellent work! Confirmed that the correct modals are displayed depending on whether AI is down and if the store owner already finished the onboarding flow.

@nefeline
Copy link
Member

However, I noticed that when I click on Customize button in intro screen, and AI is offline, I see the offline modal as well. Is it expected?

I could also reproduce this; we should skip displaying the modal when customizing the store.

@albarin
Copy link
Contributor Author

albarin commented Dec 20, 2023

Looks good! 👍

However, I noticed that when I click on Customize button in intro screen, and AI is offline, I see the offline modal as well. Is it expected?
Screen.Recording.2023-12-20.at.17.17.21.mov

Good catch @chihsuan! I don't think that should be the case, do you know how can I control that case?
Looking at the code I see there is a customizeStoreTaskCompleted that is true on the "customize your store" first screen, but as soon as I click the Customize button, it's updated to true. So, in the assembler page I'm not sure how to check if the user is customizing an generated theme or not.
Thanks!

@chihsuan
Copy link
Member

Good catch @chihsuan! I don't think that should be the case, do you know how can I control that case? Looking at the code I see there is a customizeStoreTaskCompleted that is true on the "customize your store" first screen, but as soon as I click the Customize button, it's updated to true. So, in the assembler page I'm not sure how to check if the user is customizing an generated theme or not. Thanks!

Hey @albarin I think we can probably append a query parameter to customize the button URL to know if the user is customizing. What do you think?

Copy link
Member

@nefeline nefeline left a comment

Choose a reason for hiding this comment

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

Nice work! Re-ran the tests and confirmed that:

✅ Offline modal is displayed if AI is down
✅ Modal is not displayed if AI is up and running
✅ On initial store setup, when AI is down the modal also includes the initial tour.
✅ When clicking on the "Customize" button on the intro screen, and AI is offline, the offline modal is not displayed.

@albarin albarin merged commit b3db937 into trunk Dec 21, 2023
24 checks passed
@albarin albarin deleted the show-ai-offline-modal branch December 21, 2023 15:56
@github-actions github-actions bot added this to the 8.6.0 milestone Dec 21, 2023
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Dec 21, 2023
@veljkho veljkho added needs: internal testing Indicates if the PR requires further testing conducted by Solaris status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: ai needs: internal testing Indicates if the PR requires further testing conducted by Solaris plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris team: Kirigami & Origami type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CYS - Ensure the offline modal is displayed whenever AI is unavailable and not just on the initial store setup
5 participants