-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: self-guided onboarding Learning Path (Beginner to Advanced) #3890
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
Changes from all commits
b461bc9
ec53679
64c3353
a19110e
c639421
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| VITE_API_DOMAIN=api.openfront.io | ||
| VITE_WS_HOST=openfront.io |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -34,6 +34,9 @@ | |||||||
| import { GameStartingModal } from "./GameStartingModal"; | ||||||||
| import "./GoogleAdElement"; | ||||||||
| import { HelpModal } from "./HelpModal"; | ||||||||
| import { hasSeenOnboarding, OnboardingModal } from "./OnboardingModal"; | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use side-effect-only import for custom element registration. The ♻️ Proposed fix-import { hasSeenOnboarding, OnboardingModal } from "./OnboardingModal";
+import { hasSeenOnboarding } from "./OnboardingModal";
+import "./OnboardingModal";📝 Committable suggestion
Suggested change
🧰 Tools🪛 ESLint[error] 37-37: 'OnboardingModal' is defined but never used. ( 🪛 GitHub Check: 🔍 ESLint[failure] 37-37: 🤖 Prompt for AI Agents |
||||||||
| import "./TourOverlay"; | ||||||||
| import { getTourOverlay } from "./TourOverlay"; | ||||||||
| import "./HomepagePromos"; | ||||||||
| import { HostLobbyModal as HostPrivateLobbyModal } from "./HostLobbyModal"; | ||||||||
| import { JoinLobbyModal } from "./JoinLobbyModal"; | ||||||||
|
|
@@ -1019,6 +1022,20 @@ | |||||||
| new Client().initialize(); | ||||||||
| initNavigation(); | ||||||||
|
|
||||||||
| // Auto-open onboarding for first-time visitors | ||||||||
| if (!hasSeenOnboarding()) { | ||||||||
| setTimeout(() => { | ||||||||
| window.showPage?.("page-onboarding"); | ||||||||
| }, 600); | ||||||||
| } | ||||||||
|
|
||||||||
| // Wire up the onboarding nav button (desktop + mobile) | ||||||||
| document.querySelectorAll("[data-action='open-onboarding']").forEach((btn) => { | ||||||||
| btn.addEventListener("click", () => { | ||||||||
| window.showPage?.("page-onboarding"); | ||||||||
| }); | ||||||||
| }); | ||||||||
|
|
||||||||
| // Hide elements immediately | ||||||||
| hideCrazyGamesElements(); | ||||||||
|
|
||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoded
https://may break local development.When
VITE_API_DOMAINis set to a localhost address (e.g.,localhost:8787), the code returnshttps://localhost:8787. Local dev servers typically run onhttp://, so this would fail to connect. The existing localStorage fallback at line 187 can include the protocol in the stored value (http://localhost:8787), but this new override cannot.Consider allowing the protocol to be specified or defaulting to
http://when the domain starts withlocalhost:🔧 Suggested fix to support http for localhost
export function getApiBase() { const viteApiDomain = ( import.meta as unknown as { env?: Record<string, string> } ).env?.VITE_API_DOMAIN; if (viteApiDomain) { - return `https://${viteApiDomain}`; + const protocol = viteApiDomain.startsWith('localhost') ? 'http' : 'https'; + return `${protocol}://${viteApiDomain}`; }📝 Committable suggestion
🤖 Prompt for AI Agents