Implement tag re-evaluation when files are moved between folders#133
Implement tag re-evaluation when files are moved between folders#133ploiu merged 10 commits intotag_flatteningfrom
Conversation
Co-authored-by: ploiu <43047560+ploiu@users.noreply.github.com>
Co-authored-by: ploiu <43047560+ploiu@users.noreply.github.com>
Co-authored-by: ploiu <43047560+ploiu@users.noreply.github.com>
Co-authored-by: ploiu <43047560+ploiu@users.noreply.github.com>
Co-authored-by: ploiu <43047560+ploiu@users.noreply.github.com>
ploiu
left a comment
There was a problem hiding this comment.
@copilot you didn't follow the original prompt all the way, some comments are not needed, and some tests need to change
… add_implicit_tags_to_files function Co-authored-by: ploiu <43047560+ploiu@users.noreply.github.com>
Addressed all feedback in 65d7ca5: removed unnecessary comments, reused database connection, moved documentation to repository layer, created the |
src/tags/tests/repository.rs
Outdated
| } | ||
|
|
||
| #[test] | ||
| fn works_with_empty_tag_slice() { |
There was a problem hiding this comment.
Rename this to detail that no database interactions should happen if tags is empty
There was a problem hiding this comment.
Renamed to does_nothing_when_tag_ids_is_empty in cc76806.
src/tags/tests/repository.rs
Outdated
| } | ||
|
|
||
| #[test] | ||
| fn works_with_empty_file_slice() { |
There was a problem hiding this comment.
Update the title to detail no database interactions should happen if files is empty
There was a problem hiding this comment.
Renamed to does_nothing_when_file_ids_is_empty in cc76806.
…ags pattern Co-authored-by: ploiu <43047560+ploiu@users.noreply.github.com>
Plan: Implement File Move Tag Re-evaluation ✅
This PR implements proper tag re-evaluation when a file is moved to a new parent folder, ensuring implicit tags from old ancestors are removed and new ancestor tags are properly implied.
All Changes Complete ✅
assets/queries/file/get_all_ancestors.sqlfile_repository::get_all_ancestorsfunction with teststags::repository::add_implicit_tags_to_filesfunction (refactored to follow batch_remove_implicit_tags pattern)file_service::remove_all_stale_ancestor_tagsfunctiontags::service::imply_all_ancestor_tagsfunctionfile_service::update_filefunctiontags::service::update_file_tagsfunction and documentationLatest Review Feedback Addressed
add_implicit_tags_to_filesto followbatch_remove_implicit_tagspattern:works_with_empty_file_slice→does_nothing_when_file_ids_is_emptyworks_with_empty_tag_slice→does_nothing_when_tag_ids_is_emptyTest Results:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.