2.0 KiB
Tasks: Feedback Loop UX
T1: Add remove_like and remove_save to UserStateIndex
File: tidal/src/entities/user_state.rs
Add two new public methods following the pattern of the existing remove_hide and remove_block_creator. Add unit tests. Status: COMPLETE. Methods added at lines 284 and 315.
T2: Add skip_counter field to TidalDb
File: tidal/src/db/mod.rs, tidal/src/db/from_parts.rs
Add skip_counter: DashMap<(u64, u32), u8> field to the TidalDb struct. Initialize as DashMap::new() in both from_config() and from_parts(). Status: COMPLETE.
T3: Implement FeedbackAction, FeedbackState, and submit_feedback
File: tidal/src/db/feedback.rs (NEW)
Define FeedbackAction enum (11 variants, Copy), FeedbackState struct (5 bools), SKIP_ESCALATION_THRESHOLD constant, submit_feedback method, feedback_state method, and try_negative_preference_update private method. Status: COMPLETE. Full implementation with 22 unit tests.
T4: Wire module and re-exports
Files: tidal/src/db/mod.rs, tidal/src/lib.rs
Add pub mod feedback; to db/mod.rs. Re-export FeedbackAction and FeedbackState from lib.rs. Status: COMPLETE.
T5: Unit tests for feedback module
File: tidal/src/db/feedback.rs (test module)
21 unit tests covering all 11 action variants, feedback_state, skip escalation, undo no-ops, and edge cases. Status: COMPLETE. All 21 tests pass.
T6: Integration tests
File: tidal/tests/p1_feedback_loop.rs (NEW)
10 integration tests: like/unlike roundtrip, hide/unhide roundtrip, dislike/undo roundtrip, mute/unmute creator, save/unsave, skip escalation, default state, multi-user independence, negative preference update, combined actions. Status: COMPLETE. All 10 tests pass.
T7: Clippy and fmt clean-up
Run cargo fmt and cargo clippy. Fixed: added #[allow(clippy::struct_excessive_bools)] on FeedbackState, added Copy derive on FeedbackAction, converted match-return patterns to let...else. Status: COMPLETE. Zero warnings from feedback module files.