vibefast-cli 1.1.3 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.md +63 -169
- package/dist/__tests__/recipes.test.js +25 -3
- package/dist/__tests__/recipes.test.js.map +1 -1
- package/dist/commands/add.d.ts +1 -1
- package/dist/commands/add.d.ts.map +1 -1
- package/dist/commands/add.js +547 -543
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/checklist.d.ts +1 -1
- package/dist/commands/checklist.d.ts.map +1 -1
- package/dist/commands/checklist.js +40 -39
- package/dist/commands/checklist.js.map +1 -1
- package/dist/commands/doctor.d.ts +1 -1
- package/dist/commands/doctor.js +22 -22
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/env.d.ts +1 -1
- package/dist/commands/env.d.ts.map +1 -1
- package/dist/commands/env.js +58 -53
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/health.d.ts +1 -1
- package/dist/commands/health.d.ts.map +1 -1
- package/dist/commands/health.js +101 -93
- package/dist/commands/health.js.map +1 -1
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +416 -296
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/remove.d.ts +1 -1
- package/dist/commands/remove.d.ts.map +1 -1
- package/dist/commands/remove.js +77 -64
- package/dist/commands/remove.js.map +1 -1
- package/dist/commands/status.d.ts +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +15 -14
- package/dist/commands/status.js.map +1 -1
- package/dist/core/__tests__/detect.test.js +68 -34
- package/dist/core/__tests__/detect.test.js.map +1 -1
- package/dist/core/ast.d.ts +14 -0
- package/dist/core/ast.d.ts.map +1 -0
- package/dist/core/ast.js +239 -0
- package/dist/core/ast.js.map +1 -0
- package/dist/core/codemod.d.ts.map +1 -1
- package/dist/core/codemod.js +62 -44
- package/dist/core/codemod.js.map +1 -1
- package/dist/core/config.d.ts +10 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +51 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/detect.d.ts +8 -2
- package/dist/core/detect.d.ts.map +1 -1
- package/dist/core/detect.js +52 -21
- package/dist/core/detect.js.map +1 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +9 -8
- package/dist/core/errors.js.map +1 -1
- package/dist/core/exec.d.ts +16 -0
- package/dist/core/exec.d.ts.map +1 -0
- package/dist/core/exec.js +48 -0
- package/dist/core/exec.js.map +1 -0
- package/dist/core/manualSteps.d.ts +7 -0
- package/dist/core/manualSteps.d.ts.map +1 -0
- package/dist/core/manualSteps.js +59 -0
- package/dist/core/manualSteps.js.map +1 -0
- package/dist/core/paths.d.ts +3 -1
- package/dist/core/paths.d.ts.map +1 -1
- package/dist/core/paths.js +14 -10
- package/dist/core/paths.js.map +1 -1
- package/dist/core/spinner.d.ts +1 -1
- package/dist/core/spinner.d.ts.map +1 -1
- package/dist/core/spinner.js +38 -8
- package/dist/core/spinner.js.map +1 -1
- package/dist/core/vosk.d.ts.map +1 -1
- package/dist/core/vosk.js +50 -39
- package/dist/core/vosk.js.map +1 -1
- package/docs/manual-testing.md +91 -0
- package/package.json +6 -3
- package/recipes/audio-recorder/apps/native/src/app/audio-recorder/index.tsx +5 -0
- package/recipes/audio-recorder/recipe.json +3 -3
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/components/audio-player.tsx +301 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/components/audio-recorder.tsx +373 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/components/audio-waveform.tsx +270 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/components/index.ts +4 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/components/recording-list.tsx +89 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/demo/audio-player-demo.tsx +66 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/demo/audio-recorder-cloud.tsx +68 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/demo/audio-recorder-interview.tsx +102 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/demo/basic.tsx +27 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/demo/index.ts +5 -0
- package/recipes/audio-recorder-supabase/apps/native/src/features/audio-recorder/demo/with-recording-list-demo.tsx +82 -0
- package/recipes/audio-recorder-supabase/packages/backend/src/services/recordings.ts +369 -0
- package/recipes/audio-recorder-supabase/packages/backend/supabase/migrations/recordings.sql +70 -0
- package/recipes/audio-recorder-supabase/recipe.json +35 -0
- package/recipes/audio-recorder-supabase@latest.zip +0 -0
- package/recipes/audio-recorder@latest.zip +0 -0
- package/recipes/charts/apps/native/src/features/charts/components/bar-chart.tsx +3 -3
- package/recipes/charts/apps/native/src/features/charts/components/candlestick-chart.tsx +2 -2
- package/recipes/charts/apps/native/src/features/charts/components/chart-card.tsx +5 -5
- package/recipes/charts/apps/native/src/features/charts/components/column-chart.tsx +3 -3
- package/recipes/charts/apps/native/src/features/charts/components/doughnut-chart.tsx +20 -4
- package/recipes/charts/apps/native/src/features/charts/components/line-chart.tsx +7 -6
- package/recipes/charts/apps/native/src/features/charts/components/radar-chart.tsx +6 -4
- package/recipes/charts/apps/native/src/features/charts/components/radial-bar-chart.tsx +1 -1
- package/recipes/charts/apps/native/src/features/charts/components/stacked-bar-chart.tsx +5 -4
- package/recipes/charts/recipe.json +4 -13
- package/recipes/charts@latest.zip +0 -0
- package/recipes/chatbot/apps/native/src/app/chatbot/index.tsx +1 -0
- package/recipes/chatbot/apps/native/src/features/chatbot/components/chat-markdown.tsx +86 -86
- package/recipes/chatbot/apps/native/src/features/chatbot/components/markdown/code-block.tsx +86 -53
- package/recipes/chatbot/recipe.json +26 -92
- package/recipes/chatbot-supabase/apps/native/src/api-client/supabase/chatbot.ts +515 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/app/index.tsx +257 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/chat-header-buttons.tsx +59 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/chat-input-bar.tsx +485 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/chat-markdown.tsx +575 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/chat-message-bubble.tsx +223 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/chat-settings-modal.tsx +161 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/image-preview-list.tsx +116 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/markdown/code-block.tsx +165 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/markdown/index.ts +10 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/markdown/table-renderer.tsx +129 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/message-error-boundary.tsx +78 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/message-list.tsx +170 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/model-selector.tsx +283 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/report-content-modal.tsx +188 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/components/suggested-messages.tsx +67 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/constants/models.ts +20 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/constants/report-reasons.ts +9 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/hooks/use-attachment-cache.ts +142 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/hooks/use-chat-config.ts +458 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/hooks/use-chat-handlers.ts +429 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/hooks/use-chatbot-settings.ts +89 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/hooks/use-conversation.ts +90 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/hooks/use-image-picker.ts +122 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/hooks/use-keyboard-coordinator.ts +161 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/hooks/use-smart-scroll-manager.ts +213 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/models/index.ts +86 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/models/models.ts +162 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/models/providers.ts +62 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/models/types.ts +40 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/services/file-uploader.ts +287 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/services/message-handler-service.ts +189 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/types/index.ts +70 -0
- package/recipes/chatbot-supabase/apps/native/src/features/chatbot/utils/chat-telemetry.ts +91 -0
- package/recipes/chatbot-supabase/packages/backend/src/services/conversations.ts +243 -0
- package/recipes/chatbot-supabase/packages/backend/src/services/messages.ts +327 -0
- package/recipes/chatbot-supabase/packages/backend/supabase/functions/chat-stream/index.ts +347 -0
- package/recipes/chatbot-supabase/packages/backend/supabase/migrations/chatbot.sql +104 -0
- package/recipes/chatbot-supabase/recipe.json +79 -0
- package/recipes/chatbot-supabase@latest.zip +0 -0
- package/recipes/chatbot.zip +0 -0
- package/recipes/chatbot@latest.zip +0 -0
- package/recipes/image-analysis/packages/backend/convex/imageAnalysis/index.ts +2 -2
- package/recipes/image-analysis/packages/backend/convex/{imageAnalysisFunctions.ts → imageAnalysis.ts} +5 -5
- package/recipes/image-analysis/recipe.json +15 -55
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/analysis-options-screen.tsx +304 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/camera.tsx +221 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/image-capture-screen.tsx +333 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/loading-screen.tsx +214 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/loading.tsx +191 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/results.tsx +137 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/trait-details.tsx +172 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/use-analysis-data.ts +160 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/use-results-screen.ts +151 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/achievement-badge.tsx +77 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/achievement-card.tsx +75 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/achievement-unlocked-modal.tsx +162 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/achievements-section.tsx +44 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/advice-list.tsx +42 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/circular-progress.tsx +233 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/content-card.tsx +38 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/error-state.tsx +42 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/index.ts +9 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/loading-state.tsx +26 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/profile-image.tsx +60 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/results-header.tsx +62 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/score-display.tsx +54 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/share-options-modal.tsx +110 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/components/results/traits-grid.tsx +74 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/config/analysis-config.ts +80 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/config/master-analysis-config.ts +157 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/hooks/index.ts +1 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/hooks/use-analysis.ts +38 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/hooks/use-image-analysis.ts +208 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/services/analysis-service.ts +262 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/services/share-service.ts +176 -0
- package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/services/trait-details-service.ts +289 -0
- package/recipes/image-analysis-supabase/packages/backend/src/services/image-analyses.ts +132 -0
- package/recipes/image-analysis-supabase/packages/backend/supabase/functions/analyze-image/index.ts +312 -0
- package/recipes/image-analysis-supabase/packages/backend/supabase/migrations/image_analysis.sql +42 -0
- package/recipes/image-analysis-supabase/recipe.json +57 -0
- package/recipes/image-analysis-supabase@latest.zip +0 -0
- package/recipes/image-analysis@latest.zip +0 -0
- package/recipes/image-generator/apps/native/src/features/image-generator/app/index.tsx +16 -2
- package/recipes/image-generator/apps/native/src/features/image-generator/components/image-model-selector.tsx +11 -5
- package/recipes/image-generator/apps/native/src/features/image-generator/hooks/use-image-generator.ts +11 -5
- package/recipes/image-generator/packages/backend/convex/imageGeneration/index.ts +2 -2
- package/recipes/image-generator/recipe.json +16 -39
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/app/_layout.tsx +26 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/app/gallery.tsx +217 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/app/index.tsx +251 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/components/gallery-image.tsx +25 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/components/image-detail-modal.tsx +215 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/components/image-model-selector.tsx +216 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/components/image-placeholder.tsx +26 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/hooks/use-image-gallery.ts +71 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/hooks/use-image-generator-settings.ts +152 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/hooks/use-image-generator.ts +103 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/models/models.ts +66 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/services/image-gallery-service.ts +96 -0
- package/recipes/image-generator-supabase/apps/native/src/features/image-generator/services/image-save-service.ts +120 -0
- package/recipes/image-generator-supabase/packages/backend/supabase/functions/generate-image/index.ts +291 -0
- package/recipes/image-generator-supabase/packages/backend/supabase/migrations/image_generator.sql +71 -0
- package/recipes/image-generator-supabase/recipe.json +59 -0
- package/recipes/image-generator-supabase@latest.zip +0 -0
- package/recipes/image-generator@latest.zip +0 -0
- package/recipes/ios-widget/recipe.json +15 -24
- package/recipes/ios-widget@latest.zip +0 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/analytics/index.ts +9 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/components/onboarding-with-analytics.tsx +141 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/components/onboarding.tsx +173 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/config/onboarding-flow-config.ts +189 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/demo-one/app/index.tsx +42 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/demo-one/data.ts +32 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/app/index.tsx +43 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/interactive-onboarding.tsx +222 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/ai-tone-step.tsx +133 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/currency-step.tsx +165 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/feature-ai-step.tsx +199 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/feature-chatbot-step.tsx +154 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/feature-manual-step.tsx +156 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/feature-scan-step.tsx +158 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/main-reason-step.tsx +139 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/notification-step.tsx +129 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/overspend-step.tsx +138 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/personalizing-step.tsx +190 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/rating-step.tsx +98 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/reminder-step.tsx +181 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/safety-step.tsx +110 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/struggle-step.tsx +139 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/steps/welcome-step.tsx +217 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/components/ui/onboarding-header.tsx +58 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/expense-tracker/constants.ts +179 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/hooks/use-onboarding-analytics.ts +323 -0
- package/recipes/onboarding/apps/native/src/features/onboarding/services/onboarding-analytics.ts +432 -0
- package/recipes/onboarding/recipe.json +15 -0
- package/recipes/onboarding@latest.zip +0 -0
- package/recipes/payments/recipe.json +28 -61
- package/recipes/payments-supabase/apps/native/src/features/payments/README.md +200 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/app/local-paywall.tsx +194 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/app/remote-paywall.tsx +79 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/components/payment-initializer.tsx +95 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/components/paywall-error-state.tsx +60 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/components/paywall-local-mode.tsx +116 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/components/paywall-product-card.tsx +133 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/components/paywall-remote-mode.tsx +146 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/hooks/use-entitlement.ts +63 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/index.ts +8 -0
- package/recipes/payments-supabase/apps/native/src/features/payments/services/revenuecat-adapter.ts +407 -0
- package/recipes/payments-supabase/packages/backend/src/services/payments.ts +201 -0
- package/recipes/payments-supabase/packages/backend/supabase/migrations/payments.sql +35 -0
- package/recipes/payments-supabase/recipe.json +51 -0
- package/recipes/payments-supabase@latest.zip +0 -0
- package/recipes/payments@latest.zip +0 -0
- package/recipes/quiz/apps/native/src/features/quiz/index.tsx +1 -2
- package/recipes/quiz/recipe.json +6 -9
- package/recipes/quiz@latest.zip +0 -0
- package/recipes/tracker-app/apps/native/src/features/tracker-app/app/index.tsx +1 -2
- package/recipes/tracker-app/recipe.json +7 -10
- package/recipes/tracker-app@latest.zip +0 -0
- package/recipes/voice-bot/recipe.json +8 -68
- package/recipes/voice-bot.zip +0 -0
- package/recipes/voice-bot@latest.zip +0 -0
- package/recipes/wake-word/recipe.json +10 -9
- package/recipes/wake-word.zip +0 -0
- package/recipes/wake-word@latest.zip +0 -0
- package/recipes/charts/apps/native/src/app/(root)/(protected)/charts/index.tsx +0 -3
- package/recipes/chatbot/packages/backend/convex/lib/rateLimit.ts +0 -100
- package/recipes/chatbot/packages/backend/convex/lib/telemetry.ts +0 -29
- package/recipes/chatbot/packages/backend/convex/ragKnowledge.ts +0 -0
- package/recipes/image-analysis/apps/native/assets/features/image-analyzer/front.jpg +0 -0
- package/recipes/image-analysis/apps/native/assets/features/image-analyzer/side.jpg +0 -0
- package/recipes/image-analysis/apps/native/assets/features/image-analyzer/threeQuarter.jpg +0 -0
- package/recipes/image-analysis/apps/native/src/app/(root)/(protected)/analysis/[type]/_layout.tsx +0 -5
- package/recipes/image-analysis/apps/native/src/app/(root)/(protected)/analysis/[type]/analysis-options.tsx +0 -50
- package/recipes/image-analysis/apps/native/src/app/(root)/(protected)/analysis/[type]/camera.tsx +0 -2
- package/recipes/image-analysis/apps/native/src/app/(root)/(protected)/analysis/[type]/index.tsx +0 -50
- package/recipes/image-analysis/apps/native/src/app/(root)/(protected)/analysis/[type]/loading.tsx +0 -50
- package/recipes/image-analysis/apps/native/src/app/(root)/(protected)/analysis/[type]/results.tsx +0 -2
- package/recipes/image-analysis/apps/native/src/app/(root)/(protected)/analysis/[type]/trait-details.tsx +0 -3
- package/recipes/image-analysis/packages/backend/convex/lib/ai/imageAnalysisAdapter.ts +0 -200
- package/recipes/payments/apps/native/src/app/(root)/(protected)/paywall/index.tsx +0 -74
- package/recipes/payments/apps/native/src/app/(root)/(protected)/paywall/local.tsx +0 -25
- package/recipes/payments/apps/native/src/app/(root)/(protected)/paywall/remote.tsx +0 -23
- package/recipes/quiz/apps/native/src/app/(root)/(protected)/quiz/index.tsx +0 -47
- package/recipes/tracker-app/apps/native/src/app/(root)/(protected)/tracker-app/index.tsx +0 -1
- package/recipes/voice-bot/apps/native/src/app/(root)/(protected)/voice-bot/index.tsx +0 -27
- package/recipes/voice-bot/packages/backend/convex/router.ts +0 -81
- /package/recipes/{chatbot/apps/native/src/app/(root)/(protected) → chatbot-supabase/apps/native/src/app}/chatbot/index.tsx +0 -0
- /package/recipes/{image-generator/apps/native/src/app/(root)/(protected) → image-generator-supabase/apps/native/src/app}/image-generator/gallery.tsx +0 -0
- /package/recipes/{image-generator/apps/native/src/app/(root)/(protected) → image-generator-supabase/apps/native/src/app}/image-generator/index.tsx +0 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { Stack, useLocalSearchParams, useRouter } from 'expo-router';
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import { ActivityIndicator, Alert, Animated, View } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { Button, Text } from '@/components/ui';
|
|
6
|
+
import type { AnalysisFlowConfig } from '@/features/image-analyzer/config/master-analysis-config';
|
|
7
|
+
import {
|
|
8
|
+
useAnalysisStatus,
|
|
9
|
+
useAnalyzeImages,
|
|
10
|
+
} from '@/features/image-analyzer/hooks/use-image-analysis';
|
|
11
|
+
|
|
12
|
+
type LoadingScreenParams = {
|
|
13
|
+
imageUris: string; // JSON stringified array of image URIs
|
|
14
|
+
analysisGoal: string;
|
|
15
|
+
feedbackStyle: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type LoadingScreenProps = {
|
|
19
|
+
config: AnalysisFlowConfig;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Loading screen that handles image analysis creation with background processing.
|
|
24
|
+
* Shows progress and navigates to results when complete.
|
|
25
|
+
*/
|
|
26
|
+
export function LoadingScreen({ config }: LoadingScreenProps) {
|
|
27
|
+
const router = useRouter();
|
|
28
|
+
const params = useLocalSearchParams() as LoadingScreenParams;
|
|
29
|
+
|
|
30
|
+
// Parse parameters
|
|
31
|
+
const imageUris: string[] = useMemo(
|
|
32
|
+
() => (params.imageUris ? JSON.parse(params.imageUris) : []),
|
|
33
|
+
[params.imageUris],
|
|
34
|
+
);
|
|
35
|
+
const { analysisGoal, feedbackStyle } = params;
|
|
36
|
+
|
|
37
|
+
const [currentStep, setCurrentStep] = useState<string>(
|
|
38
|
+
'Preparing analysis...',
|
|
39
|
+
);
|
|
40
|
+
const [progress, setProgress] = useState(0);
|
|
41
|
+
const [analysisId, setAnalysisId] = useState<string | undefined>(undefined);
|
|
42
|
+
|
|
43
|
+
const analyzeImages = useAnalyzeImages();
|
|
44
|
+
|
|
45
|
+
// Poll for analysis completion
|
|
46
|
+
const analysisData = useAnalysisStatus(analysisId);
|
|
47
|
+
|
|
48
|
+
// Handle analysis creation
|
|
49
|
+
const handleCreateAnalysis = useCallback(async () => {
|
|
50
|
+
try {
|
|
51
|
+
setCurrentStep('Converting images...');
|
|
52
|
+
setProgress(10);
|
|
53
|
+
|
|
54
|
+
const id = await analyzeImages({
|
|
55
|
+
imageUris,
|
|
56
|
+
preferences: {
|
|
57
|
+
goal: analysisGoal,
|
|
58
|
+
feedbackStyle,
|
|
59
|
+
},
|
|
60
|
+
onProgress: (step: string, progressValue: number) => {
|
|
61
|
+
setCurrentStep(step);
|
|
62
|
+
setProgress(progressValue);
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
if (id) {
|
|
67
|
+
setAnalysisId(id);
|
|
68
|
+
setCurrentStep('Analysis started...');
|
|
69
|
+
setProgress(60);
|
|
70
|
+
} else {
|
|
71
|
+
throw new Error('Failed to start analysis');
|
|
72
|
+
}
|
|
73
|
+
} catch (error) {
|
|
74
|
+
console.error('Error creating analysis:', error);
|
|
75
|
+
Alert.alert(
|
|
76
|
+
'Analysis Failed',
|
|
77
|
+
'Failed to start the analysis. Please try again.',
|
|
78
|
+
[
|
|
79
|
+
{
|
|
80
|
+
text: 'Retry',
|
|
81
|
+
onPress: handleCreateAnalysis,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
text: 'Go Back',
|
|
85
|
+
style: 'cancel',
|
|
86
|
+
onPress: () => router.back(),
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
}, [imageUris, analysisGoal, feedbackStyle, analyzeImages, router]);
|
|
92
|
+
|
|
93
|
+
// Start analysis on mount
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
handleCreateAnalysis();
|
|
96
|
+
}, [handleCreateAnalysis]);
|
|
97
|
+
|
|
98
|
+
// Listen for analysis completion
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
if (analysisData) {
|
|
101
|
+
switch (analysisData.status) {
|
|
102
|
+
case 'processing':
|
|
103
|
+
setCurrentStep('AI is analyzing your images...');
|
|
104
|
+
setProgress(80);
|
|
105
|
+
break;
|
|
106
|
+
case 'completed':
|
|
107
|
+
setCurrentStep('Analysis complete!');
|
|
108
|
+
setProgress(100);
|
|
109
|
+
// Navigate to results after a brief delay
|
|
110
|
+
setTimeout(() => {
|
|
111
|
+
router.replace({
|
|
112
|
+
pathname: '/analysis/[type]/results' as any,
|
|
113
|
+
params: {
|
|
114
|
+
type: config.id,
|
|
115
|
+
analysisId,
|
|
116
|
+
localImageUris: JSON.stringify(imageUris),
|
|
117
|
+
isFirstTime: 'true',
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
}, 1000);
|
|
121
|
+
break;
|
|
122
|
+
case 'failed':
|
|
123
|
+
setCurrentStep('Analysis failed');
|
|
124
|
+
setProgress(0);
|
|
125
|
+
Alert.alert(
|
|
126
|
+
'Analysis Failed',
|
|
127
|
+
'The analysis could not be completed. Please try again.',
|
|
128
|
+
[
|
|
129
|
+
{
|
|
130
|
+
text: 'Retry',
|
|
131
|
+
onPress: handleCreateAnalysis,
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
text: 'Go Back',
|
|
135
|
+
style: 'cancel',
|
|
136
|
+
onPress: () => router.back(),
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
);
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}, [
|
|
144
|
+
analysisData,
|
|
145
|
+
router,
|
|
146
|
+
analysisId,
|
|
147
|
+
handleCreateAnalysis,
|
|
148
|
+
imageUris,
|
|
149
|
+
config.id,
|
|
150
|
+
]);
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<>
|
|
154
|
+
<Stack.Screen
|
|
155
|
+
options={{
|
|
156
|
+
headerShown: false,
|
|
157
|
+
}}
|
|
158
|
+
/>
|
|
159
|
+
<View className="flex-1 items-center justify-center bg-white px-6 dark:bg-neutral-900">
|
|
160
|
+
{/* Config Header */}
|
|
161
|
+
<View className="mb-6 items-center">
|
|
162
|
+
<View
|
|
163
|
+
className="mb-3 size-16 items-center justify-center rounded-full"
|
|
164
|
+
style={{ backgroundColor: config.color }}
|
|
165
|
+
>
|
|
166
|
+
<Text className="text-3xl">{config.icon}</Text>
|
|
167
|
+
</View>
|
|
168
|
+
<Text className="text-center text-xl font-bold text-neutral-900 dark:text-white">
|
|
169
|
+
{config.name} Analysis
|
|
170
|
+
</Text>
|
|
171
|
+
</View>
|
|
172
|
+
|
|
173
|
+
{/* Main Loading Indicator */}
|
|
174
|
+
<View className="mb-8 items-center">
|
|
175
|
+
<ActivityIndicator size="large" className="mb-4 text-primary-600" />
|
|
176
|
+
<Text className="text-center text-lg font-semibold text-neutral-700 dark:text-neutral-300">
|
|
177
|
+
Processing Your Analysis
|
|
178
|
+
</Text>
|
|
179
|
+
</View>
|
|
180
|
+
|
|
181
|
+
{/* Progress Bar */}
|
|
182
|
+
<View className="mb-6 w-full max-w-sm">
|
|
183
|
+
<View className="mb-2 h-2 w-full rounded-full bg-neutral-200 dark:bg-neutral-700">
|
|
184
|
+
<Animated.View
|
|
185
|
+
className="h-full rounded-full bg-primary-600 transition-all duration-500"
|
|
186
|
+
style={{ width: `${progress}%` }}
|
|
187
|
+
/>
|
|
188
|
+
</View>
|
|
189
|
+
<Text className="text-center text-sm text-neutral-600 dark:text-neutral-400">
|
|
190
|
+
{progress}% complete
|
|
191
|
+
</Text>
|
|
192
|
+
</View>
|
|
193
|
+
|
|
194
|
+
{/* Current Step */}
|
|
195
|
+
<View className="mb-8">
|
|
196
|
+
<Text className="text-center text-base text-neutral-700 dark:text-neutral-300">
|
|
197
|
+
{currentStep}
|
|
198
|
+
</Text>
|
|
199
|
+
</View>
|
|
200
|
+
|
|
201
|
+
{/* Emergency Back Button */}
|
|
202
|
+
<View className="absolute inset-x-6 bottom-8">
|
|
203
|
+
<Button
|
|
204
|
+
label="Cancel Analysis"
|
|
205
|
+
variant="ghost"
|
|
206
|
+
onPress={() => router.back()}
|
|
207
|
+
className="w-full"
|
|
208
|
+
testID="cancel-analysis-button"
|
|
209
|
+
/>
|
|
210
|
+
</View>
|
|
211
|
+
</View>
|
|
212
|
+
</>
|
|
213
|
+
);
|
|
214
|
+
}
|
package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/loading.tsx
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { Stack, useLocalSearchParams, useRouter } from 'expo-router';
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import { ActivityIndicator, Alert, View } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { Button, Text } from '@/components/ui';
|
|
6
|
+
import {
|
|
7
|
+
useAnalysisStatus,
|
|
8
|
+
useAnalyzeImages,
|
|
9
|
+
} from '@/features/image-analyzer/hooks/use-image-analysis';
|
|
10
|
+
import { translate } from '@/lib';
|
|
11
|
+
|
|
12
|
+
type LoadingScreenParams = {
|
|
13
|
+
type: string; // Analysis type from route parameter
|
|
14
|
+
imageUris: string; // JSON stringified array of image URIs
|
|
15
|
+
analysisGoal: string;
|
|
16
|
+
feedbackStyle: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Loading screen that handles image analysis creation with background processing.
|
|
21
|
+
* Shows progress and navigates to results when complete.
|
|
22
|
+
*/
|
|
23
|
+
export default function LoadingScreen() {
|
|
24
|
+
const router = useRouter();
|
|
25
|
+
const params = useLocalSearchParams() as LoadingScreenParams;
|
|
26
|
+
const { type } = params;
|
|
27
|
+
|
|
28
|
+
// Parse parameters
|
|
29
|
+
const imageUris: string[] = useMemo(
|
|
30
|
+
() => (params.imageUris ? JSON.parse(params.imageUris) : []),
|
|
31
|
+
[params.imageUris],
|
|
32
|
+
);
|
|
33
|
+
const { analysisGoal, feedbackStyle } = params;
|
|
34
|
+
|
|
35
|
+
const [currentStep, setCurrentStep] = useState<string>(
|
|
36
|
+
'Preparing analysis...',
|
|
37
|
+
);
|
|
38
|
+
const [progress, setProgress] = useState(0);
|
|
39
|
+
const [analysisId, setAnalysisId] = useState<string | undefined>(undefined);
|
|
40
|
+
|
|
41
|
+
const analyzeImages = useAnalyzeImages();
|
|
42
|
+
|
|
43
|
+
// Poll for analysis completion
|
|
44
|
+
const analysisData = useAnalysisStatus(analysisId);
|
|
45
|
+
|
|
46
|
+
// Handle analysis creation
|
|
47
|
+
const handleCreateAnalysis = useCallback(async () => {
|
|
48
|
+
try {
|
|
49
|
+
setCurrentStep('Converting images...');
|
|
50
|
+
setProgress(10);
|
|
51
|
+
|
|
52
|
+
const id = await analyzeImages({
|
|
53
|
+
imageUris,
|
|
54
|
+
preferences: {
|
|
55
|
+
goal: analysisGoal,
|
|
56
|
+
feedbackStyle,
|
|
57
|
+
},
|
|
58
|
+
onProgress: (step: string, progressValue: number) => {
|
|
59
|
+
setCurrentStep(step);
|
|
60
|
+
setProgress(progressValue);
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
if (id) {
|
|
65
|
+
setAnalysisId(id);
|
|
66
|
+
setCurrentStep('Analysis started...');
|
|
67
|
+
setProgress(60);
|
|
68
|
+
} else {
|
|
69
|
+
throw new Error('Failed to start analysis');
|
|
70
|
+
}
|
|
71
|
+
} catch (error) {
|
|
72
|
+
console.error('Error creating analysis:', error);
|
|
73
|
+
Alert.alert(
|
|
74
|
+
'Analysis Failed',
|
|
75
|
+
'Failed to start the analysis. Please try again.',
|
|
76
|
+
[
|
|
77
|
+
{
|
|
78
|
+
text: 'Retry',
|
|
79
|
+
onPress: handleCreateAnalysis,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
text: 'Go Back',
|
|
83
|
+
style: 'cancel',
|
|
84
|
+
onPress: () => router.back(),
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
}, [imageUris, analysisGoal, feedbackStyle, analyzeImages, router]);
|
|
90
|
+
|
|
91
|
+
// Start analysis on mount
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
handleCreateAnalysis();
|
|
94
|
+
}, [handleCreateAnalysis]);
|
|
95
|
+
|
|
96
|
+
// Listen for analysis completion
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (analysisData) {
|
|
99
|
+
switch (analysisData.status) {
|
|
100
|
+
case 'processing':
|
|
101
|
+
setCurrentStep('AI is analyzing your images...');
|
|
102
|
+
setProgress(80);
|
|
103
|
+
break;
|
|
104
|
+
case 'completed':
|
|
105
|
+
setCurrentStep('Analysis complete!');
|
|
106
|
+
setProgress(100);
|
|
107
|
+
// Navigate to results after a brief delay
|
|
108
|
+
setTimeout(() => {
|
|
109
|
+
router.replace({
|
|
110
|
+
pathname: `/analysis/${type}/results` as any,
|
|
111
|
+
params: {
|
|
112
|
+
analysisId,
|
|
113
|
+
localImageUris: JSON.stringify(imageUris),
|
|
114
|
+
isFirstTime: 'true',
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
}, 1000);
|
|
118
|
+
break;
|
|
119
|
+
case 'failed':
|
|
120
|
+
setCurrentStep('Analysis failed');
|
|
121
|
+
setProgress(0);
|
|
122
|
+
Alert.alert(
|
|
123
|
+
'Analysis Failed',
|
|
124
|
+
'The analysis could not be completed. Please try again.',
|
|
125
|
+
[
|
|
126
|
+
{
|
|
127
|
+
text: 'Retry',
|
|
128
|
+
onPress: handleCreateAnalysis,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
text: 'Go Back',
|
|
132
|
+
style: 'cancel',
|
|
133
|
+
onPress: () => router.back(),
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
);
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}, [analysisData, router, analysisId, handleCreateAnalysis, imageUris, type]);
|
|
141
|
+
|
|
142
|
+
return (
|
|
143
|
+
<>
|
|
144
|
+
<Stack.Screen
|
|
145
|
+
options={{
|
|
146
|
+
title: translate('analysis.loading_title'),
|
|
147
|
+
headerBackButtonDisplayMode: 'generic',
|
|
148
|
+
}}
|
|
149
|
+
/>
|
|
150
|
+
<View className="flex-1 items-center justify-center bg-white px-6 dark:bg-neutral-900">
|
|
151
|
+
{/* Main Loading Indicator */}
|
|
152
|
+
<View className="mb-8 items-center">
|
|
153
|
+
<ActivityIndicator size="large" className="mb-4 text-primary-600" />
|
|
154
|
+
<Text className="text-center text-xl font-bold text-neutral-900 dark:text-white">
|
|
155
|
+
Processing Your Analysis
|
|
156
|
+
</Text>
|
|
157
|
+
</View>
|
|
158
|
+
|
|
159
|
+
{/* Progress Bar */}
|
|
160
|
+
<View className="mb-6 w-full max-w-sm">
|
|
161
|
+
<View className="mb-2 h-2 w-full rounded-full bg-neutral-200 dark:bg-neutral-700">
|
|
162
|
+
<View
|
|
163
|
+
className="h-full rounded-full bg-primary-600 transition-all duration-500"
|
|
164
|
+
style={{ width: `${progress}%` }}
|
|
165
|
+
/>
|
|
166
|
+
</View>
|
|
167
|
+
<Text className="text-center text-sm text-neutral-600 dark:text-neutral-400">
|
|
168
|
+
{progress}% complete
|
|
169
|
+
</Text>
|
|
170
|
+
</View>
|
|
171
|
+
|
|
172
|
+
{/* Current Step */}
|
|
173
|
+
<View className="mb-8">
|
|
174
|
+
<Text className="text-center text-base text-neutral-700 dark:text-neutral-300">
|
|
175
|
+
{currentStep}
|
|
176
|
+
</Text>
|
|
177
|
+
</View>
|
|
178
|
+
{/* Emergency Back Button */}
|
|
179
|
+
<View className="absolute inset-x-6 bottom-8">
|
|
180
|
+
<Button
|
|
181
|
+
label="Cancel Analysis"
|
|
182
|
+
variant="ghost"
|
|
183
|
+
onPress={() => router.back()}
|
|
184
|
+
className="w-full"
|
|
185
|
+
testID="cancel-analysis-button"
|
|
186
|
+
/>
|
|
187
|
+
</View>
|
|
188
|
+
</View>
|
|
189
|
+
</>
|
|
190
|
+
);
|
|
191
|
+
}
|
package/recipes/image-analysis-supabase/apps/native/src/features/image-analyzer/app/results.tsx
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { Stack } from 'expo-router';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Animated from 'react-native-reanimated';
|
|
4
|
+
|
|
5
|
+
import { AnimatedHeader, ScreenFooter } from '@/components/ui';
|
|
6
|
+
|
|
7
|
+
import { AchievementsSection } from '../components/results/achievements-section';
|
|
8
|
+
import { ErrorState } from '../components/results/error-state';
|
|
9
|
+
import { LoadingState } from '../components/results/loading-state';
|
|
10
|
+
import { ProfileImage } from '../components/results/profile-image';
|
|
11
|
+
import { ShareOptionsModal } from '../components/results/share-options-modal';
|
|
12
|
+
import { TraitsGrid } from '../components/results/traits-grid';
|
|
13
|
+
import {
|
|
14
|
+
formatTraitName,
|
|
15
|
+
getUnlockedAchievements,
|
|
16
|
+
} from '../services/analysis-service';
|
|
17
|
+
import { useResultsScreen } from './use-results-screen';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Clean, modular Results Screen without localization
|
|
21
|
+
*/
|
|
22
|
+
export default function ResultsScreen() {
|
|
23
|
+
const {
|
|
24
|
+
localAnalysis,
|
|
25
|
+
isLoading,
|
|
26
|
+
error,
|
|
27
|
+
extractedScores,
|
|
28
|
+
imageLoadError,
|
|
29
|
+
processedImageUrl,
|
|
30
|
+
isSubscribed,
|
|
31
|
+
showShareModal,
|
|
32
|
+
scrollY,
|
|
33
|
+
scale,
|
|
34
|
+
handleBackPress,
|
|
35
|
+
handleImageError,
|
|
36
|
+
handleTraitPress,
|
|
37
|
+
handleNewAnalysis,
|
|
38
|
+
handleShareResults,
|
|
39
|
+
setShowShareModal,
|
|
40
|
+
scrollHandler,
|
|
41
|
+
} = useResultsScreen();
|
|
42
|
+
|
|
43
|
+
// Calculate achievements
|
|
44
|
+
const achievements = extractedScores
|
|
45
|
+
? getUnlockedAchievements(extractedScores)
|
|
46
|
+
: [];
|
|
47
|
+
|
|
48
|
+
// Prepare trait scores for display - completely dynamic
|
|
49
|
+
const traitScores = React.useMemo(() => {
|
|
50
|
+
if (!extractedScores) return [];
|
|
51
|
+
|
|
52
|
+
return Object.entries(extractedScores)
|
|
53
|
+
.filter(([key]) => key !== 'overall')
|
|
54
|
+
.map(([key, score]) => ({
|
|
55
|
+
key,
|
|
56
|
+
trait: formatTraitName(key),
|
|
57
|
+
score,
|
|
58
|
+
}));
|
|
59
|
+
}, [extractedScores]);
|
|
60
|
+
|
|
61
|
+
// Early returns for loading and error states
|
|
62
|
+
if (isLoading) {
|
|
63
|
+
return <LoadingState />;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (error) {
|
|
67
|
+
return <ErrorState error={error} onRetry={handleBackPress} />;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (!localAnalysis || !extractedScores) {
|
|
71
|
+
return (
|
|
72
|
+
<ErrorState
|
|
73
|
+
error="No analysis data available."
|
|
74
|
+
onRetry={handleBackPress}
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<>
|
|
81
|
+
<Stack.Screen options={{ headerShown: false }} />
|
|
82
|
+
<AnimatedHeader
|
|
83
|
+
onBack={handleBackPress}
|
|
84
|
+
scrollY={scrollY}
|
|
85
|
+
title="Analysis Results"
|
|
86
|
+
/>
|
|
87
|
+
<Animated.ScrollView
|
|
88
|
+
onScroll={scrollHandler}
|
|
89
|
+
scrollEventThrottle={16}
|
|
90
|
+
className="flex-1"
|
|
91
|
+
contentContainerStyle={{ paddingBottom: 120 }}
|
|
92
|
+
showsVerticalScrollIndicator={false}
|
|
93
|
+
>
|
|
94
|
+
<ProfileImage
|
|
95
|
+
imageUrl={processedImageUrl}
|
|
96
|
+
hasError={imageLoadError}
|
|
97
|
+
onError={handleImageError}
|
|
98
|
+
/>
|
|
99
|
+
|
|
100
|
+
<TraitsGrid
|
|
101
|
+
overallScore={extractedScores.overall}
|
|
102
|
+
traitScores={traitScores}
|
|
103
|
+
scale={scale}
|
|
104
|
+
onTraitPress={handleTraitPress}
|
|
105
|
+
isSubscribed={isSubscribed}
|
|
106
|
+
/>
|
|
107
|
+
|
|
108
|
+
<AchievementsSection achievements={achievements} />
|
|
109
|
+
</Animated.ScrollView>
|
|
110
|
+
|
|
111
|
+
<ScreenFooter
|
|
112
|
+
buttons={[
|
|
113
|
+
{
|
|
114
|
+
text: 'New Analysis',
|
|
115
|
+
onPress: handleNewAnalysis,
|
|
116
|
+
variant: 'outline',
|
|
117
|
+
icon: 'camera',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
text: 'Share Results',
|
|
121
|
+
onPress: handleShareResults,
|
|
122
|
+
variant: 'default',
|
|
123
|
+
icon: 'share',
|
|
124
|
+
},
|
|
125
|
+
]}
|
|
126
|
+
/>
|
|
127
|
+
|
|
128
|
+
<ShareOptionsModal
|
|
129
|
+
visible={showShareModal}
|
|
130
|
+
onClose={() => setShowShareModal(false)}
|
|
131
|
+
analysis={localAnalysis}
|
|
132
|
+
extractedScores={extractedScores}
|
|
133
|
+
imageUrl={processedImageUrl}
|
|
134
|
+
/>
|
|
135
|
+
</>
|
|
136
|
+
);
|
|
137
|
+
}
|