3.4 KiB
3.4 KiB
Comment Waveform Integration - Changes and Todos
Completed Changes
1. Database Schema Changes
- Added timestamp column: Added
timestampfield (FLOAT, nullable) tosong_commentstable - Migration: Updated
0004_rehearsal_sessions.pymigration to include timestamp column - Model: Updated
SongCommentSQLAlchemy model inapi/src/rehearsalhub/db/models.py
2. API Changes
- Schema: Updated
SongCommentReadandSongCommentCreateschemas to include timestamp - Endpoint: Modified comment creation endpoint to accept and store timestamp
- Health Check: Fixed API health check in docker-compose.yml to use Python instead of curl
3. Frontend Changes
- Waveform Hook: Added
addMarkerandclearMarkersfunctions touseWaveform.ts - Song Page: Updated
SongPage.tsxto display comment markers on waveform - Error Handling: Added validation for finite time values in
seekTofunction - Null Safety: Added checks for null/undefined timestamps
4. Infrastructure
- Docker: Fixed health check command to work in container environment
- Build: Successfully built and deployed updated frontend
Known Issues
Database Migration Not Applied
- Error:
column "timestamp" of relation "song_comments" does not exist - Cause: The migration in
0004_rehearsal_sessions.pywasn't run on the existing database - Impact: Attempting to create new comments with timestamps will fail
Todos
Critical (Blockers)
- Apply database migration to add timestamp column to song_comments table
- Verify migration runs successfully on fresh database
- Test comment creation with timestamps after migration
High Priority
- Update frontend to send timestamp when creating comments
- Add user avatar support for comment markers
- Improve marker styling and positioning
Medium Priority
- Add timestamp editing functionality
- Implement comment marker tooltips
- Add keyboard shortcuts for comment timestamping
Low Priority
- Add documentation for the new features
- Create user guide for comment waveform integration
- Add tests for new functionality
Migration Notes
The database migration needs to be applied manually since it wasn't picked up automatically. Steps to apply:
-
For existing databases: Run the migration SQL manually:
ALTER TABLE song_comments ADD COLUMN timestamp FLOAT; -
For new deployments: The migration should run automatically as part of the startup process.
-
Verification: After migration, test comment creation with timestamps.
Testing Instructions
After applying the migration:
- Create a new comment with a timestamp
- Verify the comment appears in the list with timestamp button
- Click the timestamp button to seek to that position
- Verify the comment marker appears on the waveform
- Click the marker to scroll to the comment
- Test with older comments (without timestamps) to ensure backward compatibility
Files Modified
docker-compose.yml- Health check fixapi/alembic/versions/0004_rehearsal_sessions.py- Added timestamp migrationapi/src/rehearsalhub/db/models.py- Added timestamp fieldapi/src/rehearsalhub/schemas/comment.py- Updated schemasapi/src/rehearsalhub/routers/songs.py- Updated comment creationweb/src/hooks/useWaveform.ts- Added marker functionsweb/src/pages/SongPage.tsx- Added waveform integration