Skip to content

Modify when to cancel tours#73655

Open
kobryan0619 wants to merge 1 commit into
stagingfrom
kaitie/stop-tutorials-when-user-exits
Open

Modify when to cancel tours#73655
kobryan0619 wants to merge 1 commit into
stagingfrom
kaitie/stop-tutorials-when-user-exits

Conversation

@kobryan0619

@kobryan0619 kobryan0619 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

This PR:

  • Stops the same tour from tours from overlapping
  • Stops tour steps from staying open when the user has navigated to a different section of the Teacher Homepage
  • Modifies the styles of the tip boxes

NEW:
image

OLD:
image

It does not do:

  • In the syllabus tour, the first step in the Teacher Homepage points to the Course title. However, it will keep pointing to any title if the user navigates to a new titled page. That will be fixed in a future PR.
  • Stops two different tours from starting at the same time.

Links

  • Jira:

Testing story

Deployment notes

Privacy and security

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adjusts Shepherd-based onboarding tours on the Teacher Homepage (v2) to avoid overlapping tours during SPA navigation, cancel tours when their anchors disappear, and refine onboarding tip styling.

Changes:

  • Cancel any existing Shepherd.activeTour before creating/resuming a tour to prevent overlapping popovers.
  • Add DOM-removal cancellation via MutationObserver (both for step anchors and for the “Add Section” dialog dismissal case).
  • Update onboarding step container styles and add/extend unit tests for the new cancellation behavior.

Reviewed changes

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

Show a summary per file
File Description
apps/src/templates/studioHomepages/teacherHomepageV2/useReviewSyllabusTour.ts Cancels any active tour before resuming; memoizes step builder via useCallback.
apps/src/templates/studioHomepages/teacherHomepageV2/useLearnHowToEvaluateTour.ts Cancels any active tour before resuming; memoizes step builder via useCallback.
apps/src/templates/studioHomepages/teacherHomepageV2/useCreateSectionTour.ts Cancels any active tour before resuming; memoizes step builder via useCallback.
apps/src/templates/studioHomepages/teacherHomepageV2/createSectionOnboarding.ts Cancels the tour if the Add Section dialog closes without a login type selection (MutationObserver-based).
apps/src/sharedComponents/productTour/shepherdTourFactory.ts Adds anchor-watching MutationObserver to cancel tour when the attachTo anchor is removed; disconnects observer on hide/complete/cancel.
apps/src/sharedComponents/productTour/shepherd.scss Updates onboarding tip box padding/layout and removes quiz feedback min-height.
apps/test/unit/templates/studioHomepages/teacherHomepageV2/useReviewSyllabusTourTest.ts Adds coverage for canceling an active Shepherd tour before resuming.
apps/test/unit/templates/studioHomepages/teacherHomepageV2/useLearnHowToEvaluateTourTest.ts Adds coverage for canceling an active Shepherd tour before resuming.
apps/test/unit/templates/studioHomepages/teacherHomepageV2/useCreateSectionTourTest.ts Adds/extends tests for resuming behavior, active-tour cancellation, and completion/cancel side effects.
apps/test/unit/templates/studioHomepages/teacherHomepageV2/createSectionOnboardingTest.ts Adds tests for dialog-dismissal cancellation behavior.
apps/test/unit/sharedComponents/productTour/shepherdTourFactoryTest.ts New unit tests validating anchor-removal cancellation and observer cleanup behavior.

Comment on lines 52 to 56
// Resume at the saved step if it belongs to this page, otherwise start
// at the first step (the saved step was from the previous page).
const startStep = tour.steps.find(s => s.id === savedStepId) ?? tour.steps[0];
tour.show(startStep.id);
};
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.

2 participants