-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
We need to implement a feature that allows users to mark drills as variations of each other. This will enhance the interconnectedness of drills and improve user experience by allowing easier discovery of related drills.
Tasks:
-
Database Changes:
- Create a new table
drill_variationswith the following structure:id(Primary Key)drill_id_1(Foreign Key to drills table)drill_id_2(Foreign Key to drills table)- Add a unique constraint on (drill_id_1, drill_id_2)
- Add a check constraint to ensure drill_id_1 < drill_id_2
- Create a migration file for this new table
- Create a new table
-
Backend API Changes:
- Update
src/routes/drills/[id]/+page.server.js:- Modify the
loadfunction to fetch variations along with drill details
- Modify the
- Create new API endpoints:
- GET
/api/drills/:id/variations: Fetch variations for a specific drill - POST
/api/drills/:id/variations: Add a new variation
- GET
- Implement a search endpoint for drills: GET
/api/drills/search
- Update
-
Frontend Changes:
- Update
src/routes/drills/[id]/+page.svelte:- Add a section to display variations (lines 128-150)
- Implement a "Mark as Variation" button and modal (lines 577-601)
- Create a new component
src/lib/components/VariationModal.sveltefor the variation selection modal - Update
src/routes/drills/+page.svelteto display variation information in the drill listing
- Update
-
Implement Variation Logic:
- Create functions to handle adding and removing variations
- Implement search functionality for finding drills to mark as variations
- Ensure proper error handling and validation
-
UI/UX Considerations:
- Design and implement a user-friendly interface for marking drills as variations
- Ensure the variation section is easily discoverable on the drill details page
- Implement proper loading states and error messages
-
Testing:
- Write unit tests for new API endpoints
- Update existing tests to account for the new variation feature
- Implement end-to-end tests for the variation marking process
-
Documentation:
- Update API documentation to include new endpoints
- Add user guide information about the variation feature
-
Performance Considerations:
- Ensure efficient querying of variations, especially for drills with many variations
- Implement pagination if necessary for displaying variations
Additional Notes:
- Ensure that the implementation follows our existing code style and best practices
- Consider future scalability, especially if the number of variations grows large
- Coordinate with the UX team to ensure the new feature aligns with overall app design
Related files:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request