Skip to content

Commit 9282711

Browse files
committed
launch upgrade onboarding if we are the primary tab and the user hasn't seen it before...
1 parent 92262a7 commit 9282711

4 files changed

Lines changed: 19 additions & 4 deletions

File tree

frontend/app/modals/modalsrenderer.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import { NewInstallOnboardingModal } from "@/app/onboarding/onboarding";
5+
import { CurrentOnboardingVersion } from "@/app/onboarding/onboarding-features";
56
import { UpgradeOnboardingModal } from "@/app/onboarding/onboarding-upgrade";
6-
import { atoms, globalStore } from "@/store/global";
7+
import { atoms, globalPrimaryTabStartup, globalStore } from "@/store/global";
78
import { modalsModel } from "@/store/modalmodel";
89
import * as jotai from "jotai";
910
import { useEffect } from "react";
11+
import semver from "semver";
1012
import { getModalComponent } from "./modalregistry";
1113

1214
const ModalsRenderer = () => {
@@ -32,6 +34,19 @@ const ModalsRenderer = () => {
3234
setNewInstallOnboardingOpen(true);
3335
}
3436
}, [clientData]);
37+
38+
useEffect(() => {
39+
if (!globalPrimaryTabStartup) {
40+
return;
41+
}
42+
if (!clientData.tosagreed) {
43+
return;
44+
}
45+
const lastVersion = clientData.meta?.["onboarding:lastversion"] ?? "v0.0.0";
46+
if (semver.lt(lastVersion, CurrentOnboardingVersion)) {
47+
setUpgradeOnboardingOpen(true);
48+
}
49+
}, []);
3550
useEffect(() => {
3651
globalStore.set(atoms.modalOpen, rtn.length > 0);
3752
}, [rtn]);

frontend/app/onboarding/onboarding-features.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { FakeChat } from "./fakechat";
1515
import { EditBashrcCommand, ViewLogoCommand, ViewShortcutsCommand } from "./onboarding-command";
1616
import { FakeLayout } from "./onboarding-layout";
1717

18-
const CurrentOnboardingVersion = "v0.12.0";
18+
export const CurrentOnboardingVersion = "v0.12.0";
1919

2020
type FeaturePageName = "waveai" | "magnify" | "files";
2121

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"prettier-plugin-jsdoc": "^1.3.3",
7373
"prettier-plugin-organize-imports": "^4.3.0",
7474
"sass": "1.91.0",
75-
"semver": "^7.7.3",
7675
"storybook": "^8.6.14",
7776
"storybook-dark-mode": "^4.0.2",
7877
"tailwindcss": "^4.1.14",
@@ -148,6 +147,7 @@
148147
"rehype-slug": "^6.0.0",
149148
"remark-flexible-toc": "^1.2.3",
150149
"remark-gfm": "^4.0.1",
150+
"semver": "^7.7.3",
151151
"remark-github-blockquote-alert": "^1.3.1",
152152
"rxjs": "^7.8.2",
153153
"shell-quote": "^1.8.3",

0 commit comments

Comments
 (0)