Skip to content

Make onboarding optional, able to be ignored on desktop#6564

Merged
franknoirot merged 28 commits intomainfrom
franknoirot/adhoc/optional-onboarding
Apr 30, 2025
Merged

Make onboarding optional, able to be ignored on desktop#6564
franknoirot merged 28 commits intomainfrom
franknoirot/adhoc/optional-onboarding

Conversation

@franknoirot
Copy link
Contributor

@franknoirot franknoirot commented Apr 29, 2025

Closes #6542. Makes onboarding tutorial optional on both desktop and web, removing all redirection behavior.

Both platforms

  1. Whenever the user dismisses the tutorial before, during, or after doing it, we show a toast telling them one place to find the replay button
  2. The same code path now occurs for replay workflows via native help menu, lower-right help menu, and settings

Desktop

  1. No toasts or dialogs are shown
  2. If the user has not yet begun the tutorial, a dismissible button appears in the home page sidebar
  3. Whenever the user begins, continues, or replays the tutorial, we create a new project on their behalf and navigate to it
  4. If the user is in the middle of the tutorial, the home page button says "continue" instead of "start"
Screenshare.-.2025-04-29.9_46_32.AM-compressed.mp4

Browser

  1. If the user has not yet begun or completed the tutorial, a toast appears to begin or dismiss
  2. If the user's code is not the web tutorial's code, a warning toast is shown after the first acceptance
Screenshare.-.2025-04-29.9_49_57.AM-compressed.mp4

Tests

I consolidated all tests within onboarding-tests.spec.ts into one longer test. Several of those tests—like the "avatar text" tests—checked behavior that will become irrelevant this week when we update the onboarding to no longer mention all the menus and UI. Some of them were redundant, each checking that the code reset and the model was loaded. This test checks that, clicks through all onboarding steps and back, and verifies the "always create a new project" behavior on desktop in several ways. I left a TODO comment in that test that another test will need to be written for the divergent web onboarding behavior when we support browser E2E tests again.

Other

This PR removes one of our circular dependencies.

@qa-wolf
Copy link

qa-wolf bot commented Apr 29, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

@vercel
Copy link

vercel bot commented Apr 29, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2025 6:28pm

@codecov
Copy link

codecov bot commented Apr 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.63%. Comparing base (5e200ae) to head (f1fc230).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6564      +/-   ##
==========================================
+ Coverage   85.60%   85.63%   +0.02%     
==========================================
  Files         108      108              
  Lines       47362    47362              
==========================================
+ Hits        40546    40558      +12     
+ Misses       6816     6804      -12     
Flag Coverage Δ
rust 85.63% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@franknoirot franknoirot force-pushed the franknoirot/adhoc/optional-onboarding branch from bfa0690 to 0d3725f Compare April 29, 2025 13:33
@franknoirot franknoirot force-pushed the franknoirot/adhoc/optional-onboarding branch from 0d3725f to fba9f83 Compare April 29, 2025 13:52
@franknoirot franknoirot requested a review from a team April 29, 2025 14:04
@franknoirot franknoirot marked this pull request as ready for review April 29, 2025 14:53
@franknoirot
Copy link
Contributor Author

Sorry gotta address something flaky(?) about my new consolidated test. It passes locally on MacOS

@nadr0
Copy link
Contributor

nadr0 commented Apr 29, 2025

The create a new project always is great. I think it is less friction, less complex code on our end to option select all the scenarios of what could be in the system.

6) src/lib/singletons.ts -> src/clientSideScene/sceneEntities.ts -> src/clientSideScene/segments.ts -> src/components/Toolbar/angleLengthInfo.ts
7) src/lib/singletons.ts -> src/clientSideScene/sceneEntities.ts -> src/clientSideScene/segments.ts
8) src/hooks/useModelingContext.ts -> src/components/ModelingMachineProvider.tsx -> src/components/Toolbar/Intersect.tsx -> src/components/SetHorVertDistanceModal.tsx -> src/lib/useCalculateKclExpression.ts
9) src/routes/Onboarding/index.tsx -> src/routes/Onboarding/Camera.tsx -> src/routes/Onboarding/utils.tsx
Copy link
Contributor

Choose a reason for hiding this comment

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

this is mega

const requestedPath = `${PATHS.FILE}/${encodeURIComponent(
projectPathWithoutSpecificKCLFile
)}`
)}${requestedProjectName.subRoute || ''}`
Copy link
Contributor

Choose a reason for hiding this comment

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

perfect

@nadr0
Copy link
Contributor

nadr0 commented Apr 29, 2025

Found one bug?

  • npm run tron:start
  • cat ~/.config/zoo-modeling-app/settings.toml says onboarding_status = "dismissed"
  • click Replay onboarding tutorial from the native menu
  • it creates a new project but does not navigate me

I think any of the replay options when it is dismissed is not navigating? It creates the project but no navigation?

: onboardingRoutes[stepNumber]
const goToNext = useNextClick(onboardingPaths.INDEX + (nextStep?.path ?? ''))
: onboardingPathsArray[stepNumber]
const goToNext = useNextClick(nextStep + onboardingPaths.INDEX)
Copy link
Contributor

Choose a reason for hiding this comment

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

The concatenation of nextStep + onboardingPaths.INDEX may create invalid URL paths since onboardingPaths.INDEX is '/'. When appended to another path, this would result in paths like /camera/ instead of the likely intended /camera. Consider using a path joining utility or template string that properly handles path segments to ensure valid URL construction.

Suggested change
const goToNext = useNextClick(nextStep + onboardingPaths.INDEX)
const goToNext = useNextClick(nextStep === '' ? onboardingPaths.INDEX : `/${nextStep}`)

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

@codspeed-hq
Copy link

codspeed-hq bot commented Apr 29, 2025

CodSpeed Instrumentation Performance Report

Merging #6564 will not alter performance

Comparing franknoirot/adhoc/optional-onboarding (de781e5) with main (0002295)

Summary

✅ 54 untouched benchmarks

@franknoirot franknoirot force-pushed the franknoirot/adhoc/optional-onboarding branch 2 times, most recently from 6c69d65 to 81aaa97 Compare April 29, 2025 17:50
@franknoirot
Copy link
Contributor Author

Found one bug?

  • npm run tron:start
  • cat ~/.config/zoo-modeling-app/settings.toml says onboarding_status = "dismissed"
  • click Replay onboarding tutorial from the native menu
  • it creates a new project but does not navigate me

I think any of the replay options when it is dismissed is not navigating? It creates the project but no navigation?

Hey @nadr0 sorry I might have gotten the branch in a bad state trying to clear up the circular dependency I had added. I am not experiencing this as of now, would you mind double-checking?

…ttyCAD/modeling-app into franknoirot/adhoc/optional-onboarding
Comment on lines +264 to +268
// TODO: this is not navigating to the correct `/onboarding/blah` path yet
navigate(
makeUrlPathRelative(
`${PATHS.ONBOARDING.INDEX}${makeUrlPathRelative(onboardingStatus)}`
)
Copy link
Contributor

Choose a reason for hiding this comment

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

The nested makeUrlPathRelative calls here are unnecessarily complex and error-prone. Consider using the newly created joinRouterPaths utility function instead, which would handle path construction more reliably:

navigate(joinRouterPaths(PATHS.ONBOARDING.INDEX, onboardingStatus))

This would ensure proper path formatting and avoid potential issues with duplicate or missing slashes.

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

Copy link
Contributor

@pierremtb pierremtb left a comment

Choose a reason for hiding this comment

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

Didn't test on web but desktop looks great! And so does the code diff

@franknoirot franknoirot merged commit 820082d into main Apr 30, 2025
67 checks passed
@franknoirot franknoirot deleted the franknoirot/adhoc/optional-onboarding branch April 30, 2025 18:43
franknoirot added a commit that referenced this pull request Apr 30, 2025
franknoirot added a commit that referenced this pull request May 1, 2025
Revert "Make onboarding optional, able to be ignored on desktop (#6564)"

This reverts commit 820082d.
franknoirot added a commit that referenced this pull request May 2, 2025
Oversight on my part while refactoring the onboarding system in #6564.
The new centralized `acceptOnboarding` workflow constructs a relative
path, so we have to get out of the settings before invoking it.
franknoirot added a commit that referenced this pull request May 2, 2025
Fix resetting onboarding in web after #6564

Oversight on my part while refactoring the onboarding system in #6564.
The new centralized `acceptOnboarding` workflow constructs a relative
path, so we have to get out of the settings before invoking it.
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.

Make onboarding tutorial optional

4 participants