Skip to content

FE-756: petrinaut product walkthrough#8789

Open
alex-e-leon wants to merge 16 commits into
mainfrom
FE-756-petrinaut-walkthrough
Open

FE-756: petrinaut product walkthrough#8789
alex-e-leon wants to merge 16 commits into
mainfrom
FE-756-petrinaut-walkthrough

Conversation

@alex-e-leon
Copy link
Copy Markdown
Contributor

🌟 What is the purpose of this PR?

Adds a product walkthrough to the petrinaut website. The logic for the new walkthrough lives inside the petrinaut library so that it can be kept in sync with any changes to the petrinaut ui and/or interact with other modals - however the content (copy + any video animations + their urls) is passed in by the consuming application by including the WalkthroughProvider - not including a walkthrough provider means that no preview will be rendered.

We track whether the user has seen the walkthrough in its own localstorage variable rather than the userSettings variable in order to keep the data better co-located with the context + provider and avoid situations where a provider is added in the wrong order.

The animations in this PR are not final yet, and still need polish @kube has graciously offered to record the experiments animation over the weekend. Will update the PR once they are done.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
petrinaut Ready Ready Preview, Comment May 29, 2026 6:23pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
hash Ignored Ignored Preview May 29, 2026 6:23pm
hashdotdesign-tokens Ignored Ignored Preview May 29, 2026 6:23pm

@cursor
Copy link
Copy Markdown

cursor Bot commented May 29, 2026

PR Summary

Low Risk
Onboarding UI and static assets only; no auth, persistence, or simulation logic changes beyond hiding the AI hero during the tour.

Overview
Adds an optional first-visit product walkthrough to @hashintel/petrinaut/ui: WalkthroughProvider, context API, and a multi-step WalkthroughDialog (video, copy, navigation, localStorage petrinaut:hasSeenWalkthrough). The editor mounts the dialog and suppresses the empty-canvas AI CTA while the tour is open. Public exports let embedders supply steps and reopen the tour programmatically.

The petrinaut website wraps Petrinaut in WalkthroughProvider with site-specific walkthroughSteps (copy + MP4s) and updates PWA-style icons (favicon.ico, icon-192/512, apple touch icon, site.webmanifest). A patch changeset documents the library addition.

Reviewed by Cursor Bugbot for commit 204685e. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team area/apps area/apps > hash.design Affects the `hash.design` design site (app) labels May 29, 2026
@alex-e-leon alex-e-leon changed the title Fe 756 petrinaut walkthrough FE-756: petrinaut product walkthrough May 29, 2026
@github-actions github-actions Bot added the area/infra Relates to version control, CI, CD or IaC (area) label May 29, 2026
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 29, 2026

🤖 Augment PR Summary

Summary: This PR adds a first-visit product walkthrough (“tour”) to the Petrinaut website/editor.

Changes:

  • Wraps the Petrinaut website’s <Petrinaut /> instance with a new <WalkthroughProvider /> and supplies host-owned walkthrough step content.
  • Adds walkthrough step definitions (copy + video metadata) plus bundled MP4 demo videos to the petrinaut-website app.
  • Introduces a new walkthrough module in @hashintel/petrinaut/ui: context types, provider (localStorage-backed “has seen” state), and an Ark UI-based dialog.
  • Adds a Storybook story to exercise the walkthrough dialog in isolation.
  • Exports walkthrough APIs from the UI package index and mounts <WalkthroughDialog /> in EditorView so it can render when a provider is present.

Technical Notes: The walkthrough auto-opens on first visit (tracked via a dedicated localStorage key) and is designed so embedders provide content via steps rather than baking copy/media into the library.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread libs/@hashintel/petrinaut/src/ui/components/walkthrough/walkthrough-dialog.tsx Outdated
Comment thread libs/@hashintel/petrinaut/src/ui/index.ts
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 34e2977. Configure here.

Comment thread libs/@hashintel/petrinaut/src/ui/components/walkthrough/walkthrough-dialog.tsx Outdated
Copy link
Copy Markdown
Collaborator

@kube kube left a comment

Choose a reason for hiding this comment

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

Beautiful, just a comment on the LocalStorage usage.

Comment on lines +26 to +40
const [hasSeenWalkthrough, setHasSeenWalkthrough] = useState(
loadHasSeenWalkthrough,
);
const [isOpen, setIsOpen] = useState(() => !hasSeenWalkthrough);

useEffect(() => {
if (!hasSeenWalkthrough) {
return;
}
try {
localStorage.setItem(STORAGE_KEY, "true");
} catch {
// Ignore write failures (e.g. quota exceeded)
}
}, [hasSeenWalkthrough]);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could I ask you to use UserSettings since now this code live in the Petrinaut component.

You should create the UserSetting value + setter in the UserSettingContext then:

  const {
    showWalkthrough
    setShowWalkthrough,
  } = use(UserSettingsContext);

Or something with a better name.

And add it in the ViewportSettings component too.

It is a beautiful Walkthrough you created, and I want to be able to re-open it from time to time.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ha yes, and instead of putting that in the Provider, put it in the Dialog so you have access to UserSettingsContext.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps > hash.design Affects the `hash.design` design site (app) area/apps area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

2 participants