Skip to content

Conversation

@Parvinmh
Copy link
Contributor

@Parvinmh Parvinmh commented Oct 1, 2025

No description provided.

@vercel
Copy link

vercel bot commented Oct 1, 2025

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

Project Deployment Preview Comments Updated (UTC)
intro-js Error Error Oct 2, 2025 10:40am

@vercel
Copy link

vercel bot commented Nov 6, 2025

@Parvinmh is attempting to deploy a commit to the Pean Team on Vercel.

A member of the Team first needs to authorize it.

}));

// Create and configure tour
const tour = new Tour();
Copy link
Contributor

Choose a reason for hiding this comment

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

executeCampaign is currently tied to Tour only but what if we want to launch a Hint, or a banner in the future? This function shouldn't really care about what needs to be executed, instead, there needs to be a factory that takes the type of experience that needs to be launched (e.g. tour, hint, etc) and then launches it.

this.setupCampaignCallbacks(tour, campaign);

// Store active tour
this.activeTours.set(campaignId, tour);
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to the previous comment, we shouldn't maintain activeTours specifically, but rather an active experience type -- Also, how this activeTours is being used? what's the purpose?

}
break;

case "element_visible":
Copy link
Contributor

Choose a reason for hiding this comment

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

I really like these triggers

/**
* Setup scroll to element trigger
*/
private setupScrollToElementTrigger(
Copy link
Contributor

Choose a reason for hiding this comment

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

These triggers should be moved to separate files to make the testing and maintainablitiy easier

* Resume idle timers when page becomes visible
*/
private resumeIdleTimers(): void {
// Implementation for resuming idle timers
Copy link
Contributor

Choose a reason for hiding this comment

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

These need to be implemented I assume?

updatedAt?: string;
author?: string;
tags?: string[];
priority?: number; // Priority for when multiple campaigns match (higher = higher priority)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this currently implemented?

tourOptions?: Partial<TourOptions>;

// Hint configuration - uses existing HintOptions structure
hintOptions?: Partial<HintOptions>;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to have tourOptions or hintOptions, but rather a generic "options" that defines the options of that particular experience based on what "mode" is passed in. Make sure we don't union the types though, there needs to be a BaseCampaign type and Campaign type the conditionally changes the "options" type based the "mode".

global?: {
targeting?: CampaignTargeting;
tourDefaults?: Partial<TourOptions>;
hintDefaults?: Partial<HintOptions>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need defaults here? And again, it shouldn't be tied to Tour or Hint.

if (this.isInitialized) return;

// Track session count
const sessionCountKey = "introjs-campaign-session-count";
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be in configs.

updateStatus('Initializing campaigns from JSON file...');

// Initialize campaigns from JSON file (correct path for this directory)
await introJs.initializeCampaigns("./campaigns/first-visit-tour.json");
Copy link
Contributor

Choose a reason for hiding this comment

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

How this would work in a browser environment? How do we do file I/O when running in browser context?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants