feat: implement onboarding preferences and welcome modal for new users (#7319)

* feat: implement onboarding preferences and welcome modal for new users

* fixes

* adding: defaultPreferences

* fixes

* fix: tests

* fixes

* fix: test

* fix: test

* fixes

* fixes
This commit is contained in:
naman-bruno
2026-02-27 16:15:06 +05:30
committed by GitHub
parent 8b230043c1
commit c8e57b7f9f
67 changed files with 1550 additions and 185 deletions

View File

@@ -170,6 +170,27 @@ export const test = baseTest.extend<
});
await fs.promises.writeFile(path.join(userDataPath, file), content, 'utf-8');
}
} else {
// No initUserDataPath provided: create default preferences to skip onboarding
// BUT only if preferences.json doesn't already exist
const prefsPath = path.join(userDataPath, 'preferences.json');
const prefsExist = await existsAsync(prefsPath);
if (!prefsExist) {
const defaultPreferences = {
preferences: {
onboarding: {
hasLaunchedBefore: true,
hasSeenWelcomeModal: true
}
}
};
await fs.promises.writeFile(
prefsPath,
JSON.stringify(defaultPreferences, null, 2),
'utf-8'
);
}
}
const app = await playwright._electron.launch({