Added a new translucent score display with hover feedback functionality to the TubeFocus Chrome extension. Users can now see the relevance score continuously and provide feedback to improve the ML model.
- Location: Top-left corner of YouTube page
- Appearance: Semi-transparent black box with colored border
- Content: Shows percentage score and "Click to rate" hint
- Colors:
- 🔴 Red (0-30%): Low relevance
- 🟡 Yellow (31-60%): Medium relevance
- 🟢 Green (61-100%): High relevance
- Trigger: Click on the score display
- Interface: Clean modal with 1-5 rating buttons
- Functionality: Sends feedback to the ML API for model improvement
- User Experience: Smooth animations and hover effects
- Display: Updates automatically when new videos are loaded
- Animation: Smooth fade-in/out transitions
- Session Management: Shows/hides based on session state
content.js- Added score display and feedback functionalitypopup.js- Updated session management to communicate with content scriptstyles.css- Added styling for the new UI components
- Creates the translucent score display element
- Sets up the feedback modal overlay
- Handles all event listeners for interactions
- Updates the display with current score
- Changes colors based on relevance level
- Animates the display appearance
- Sends feedback to the ML API endpoint
- Converts 1-5 scale to 0-1 scale for API
- Shows success confirmation
- Displays a brief success message
- Auto-dismisses after 2 seconds
- Position: Fixed top-left (20px, 20px)
- Background: rgba(0, 0, 0, 0.8) with backdrop blur
- Border: Colored based on relevance score
- Typography: Roboto font, bold weight
- Animation: Smooth transitions and hover effects- Overlay: Semi-transparent with blur effect
- Modal: White background with rounded corners
- Buttons: Clean, accessible design with hover states
- Responsive: Adapts to different screen sizes- Session Start: User starts a session in the extension popup
- Score Display: Translucent box appears on YouTube page
- Video Navigation: Score updates automatically for each video
- Feedback Submission: User clicks score display → modal opens
- Rating: User selects 1-5 rating → feedback sent to API
- Confirmation: Success message appears briefly
- Session End: Score display disappears when session stops
POST http://localhost:8080/feedback
Headers: X-API-KEY: test_key_123
Body: {
video_id: "string",
goal: "string",
user_score: 0.0-1.0,
predicted_score: 0.0-1.0
}
- Success: 200 OK with confirmation
- Error: Appropriate error handling with console logging
- Simulates the score display functionality
- Tests the feedback modal interaction
- Verifies API connectivity
- Can be opened in browser for manual testing
- Open
test_extension.htmlin browser - Click "Show Score Display" to test UI
- Click "Show Feedback Modal" to test interaction
- Click "Test Feedback API" to verify backend connectivity
API_KEY: Authentication key for backend APIYOUTUBE_API_KEY: YouTube Data API key for video metadata
- Score display automatically shows/hides based on session state
- Feedback functionality only available during active sessions
- Session state synchronized between popup and content script
- Persistent Settings: Remember user preferences for display position
- Advanced Feedback: Text input for detailed feedback
- Score History: Show previous ratings for the same video
- Keyboard Shortcuts: Quick feedback submission with keyboard
- Customization: User-configurable display styles and colors
- Position: Fixed top-left position (not user-configurable)
- API Dependency: Requires backend API to be running
- YouTube Only: Currently only works on YouTube pages
- Session Required: Feedback only available during active sessions
- Install the TubeFocus extension
- Start a session with your learning goal
- Navigate to YouTube videos
- See the relevance score in the top-left corner
- Click the score to provide feedback
- Rate videos 1-5 based on relevance to your goal
- Ensure the backend API is running on
localhost:8080 - Load the extension in Chrome developer mode
- Test on YouTube pages
- Check browser console for any errors
- Use the test file for isolated testing
- Continuous Awareness: Always see video relevance scores
- Easy Feedback: Simple 1-click rating system
- Improved Accuracy: Help train the ML model with your preferences
- Better Experience: More relevant video recommendations over time
- Data Collection: Gather user feedback for model improvement
- Model Training: Use feedback to retrain and improve scoring accuracy
- User Engagement: Interactive elements increase user retention
- Quality Assurance: Continuous feedback loop for system improvement