feat: smart package recommendations with UX improvements

- Added smart recommendations section with category-based filtering
- Implemented onboarding flow with 3-step wizard (categories, OS, experience level)
- Added 'Select All/Deselect All' for recommendations
- Added 'Preferences' button in header to reopen onboarding
- Fixed script generation for recommendation-based packages (auto-detect platform)
- Fixed onboarding completion bug (removed duplicate save)
- Added comprehensive debug logging
- Enhanced ScriptPreview to work with auto-generated platform info
- Optimized recommendation API with proper validation and error handling
- Added localStorage profile management with version control
This commit is contained in:
ersaayan
2025-11-22 18:10:16 +03:00
parent a893ec6837
commit 32b415a97f
8 changed files with 182 additions and 29 deletions
+5 -3
View File
@@ -88,7 +88,7 @@ export class RecommendationService {
try {
// Fetch all preset packages in one query
const packages: Package[] = [];
// Search for each package name (case-insensitive)
// Note: Current API doesn't support bulk name filtering,
// so we optimize by fetching larger batches and filtering
@@ -105,7 +105,7 @@ export class RecommendationService {
const exactMatch = result.packages.find(
(pkg) => pkg.name.toLowerCase() === name.toLowerCase()
);
if (exactMatch) {
packages.push(exactMatch);
} else if (result.packages.length > 0) {
@@ -155,7 +155,9 @@ export class RecommendationService {
// This is a workaround until we add category name filtering to API
const result = await PackageService.getMany({
platform_id: platformId,
limit: Math.ceil(limit / (categories.length * dbCategoryNames.length)),
limit: Math.ceil(
limit / (categories.length * dbCategoryNames.length)
),
sort_by: "popularity_score",
sort_order: "desc",
});