add dashboard train page and AI Studio flow#152
Open
GauravOP-03 wants to merge 11 commits intoscriptaiapp:mainfrom
Open
add dashboard train page and AI Studio flow#152GauravOP-03 wants to merge 11 commits intoscriptaiapp:mainfrom
GauravOP-03 wants to merge 11 commits intoscriptaiapp:mainfrom
Conversation
…ema to resue on frontend as well as backend
…FileSize, formatTime)
…tarting AI training
Contributor
|
@GauravOP-03 is attempting to deploy a commit to the afrin127329's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Add the dashboard Train AI (AI Studio) page and all related modified/added files: the page, hooks (
useAITraining,useChannelVideos), and train-specific components (header, skeleton, video grid, training progress). By default, returning users see only their previously trained videos instead of refetching from the YouTube API; the API is called only when they explicitly click Train AI Again, which reduces YouTube API usage. No other app changes.🎯 Type of Change
🧪 Testing
Describe: With YouTube connected, open
/dashboard/train, select 3–5 videos, start training; confirm progress and success dialog. With YouTube disconnected, confirm locked overlay. For an already-trained user, confirm “Trained Videos” view by default and that “Train AI Again” triggers channel video fetch.📋 Checklist
📸 Screenshots (if applicable)
🔧 Technical Details
Files in this PR (only these):
app/dashboard/train/page.tsxhooks/useAITraining.ts/api/v1/youtube/trained-videosand/api/v1/train-ai; useSSE for job status; exposes handleStartTraining, handleToggleVideo, handleConnectYoutube, progress, showModal, etc.hooks/useChannelVideos.tstrain/TrainAIHeader.tsxtrain/skeleton/TrainAIPageSkeleton.tsxtrain/ChannelVideoGrid.tsxyoutube_channels.youtube_trained_videos//api/v1/youtube/trained-videos). Channel videos are fetched only when the user clicks “Train AI Again”, avoiding unnecessary API calls for users who are just viewing the page or their trained set.train/TrainingProgress.tsxDependencies (must exist elsewhere): SuccessDialog, StepperGuide, GenerationProgress, api-client, useSSE, UI components.
🚀 Deployment Notes
/api/v1/train-aiand/api/v1/youtube/trained-videos(and YouTube OAuth) must be available.📚 Documentation Updates
🔍 Review Notes
📊 Performance Impact
Details: Fewer YouTube API calls. Previously the page could trigger channel video fetches even when the user did not intend to retrain. Now trained users see cached trained videos by default; channel videos are fetched only when they click “Train AI Again”, saving quota and load time.
🔒 Security Considerations
Details: Train and channel endpoints are called with
requireAuth: true.🎉 Additional Notes