-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat(tags): tag system with explorer integration, and media context menu fixes #3054
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 25 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
957b878
fix(search): apply TagFilter in search.files query
slvnlrt 32a788d
feat(tags): implement tags.by_id, tags.ancestors, tags.children, file…
slvnlrt e135682
fix(tags): prevent duplicate tag applications on the same file
slvnlrt 8ec131d
fix(tags,ui): make tag view files navigable and wire Overview search …
slvnlrt 15cb764
feat(tags): render tag view using standard explorer with full File ob…
slvnlrt 739e372
feat(tags): add unapply/delete actions, fix tag sync and Inspector UX
slvnlrt 49a9347
refactor: extract shared useRefetchTagQueries hook
slvnlrt c23dfb0
fix(core): use current device slug instead of \"unknown-device\" fall…
slvnlrt db1f88f
fix(media): replace broken useJobDispatch with direct mutations
slvnlrt db710d9
fix(tags): address CodeRabbit review findings on tag system
slvnlrt 1e4b06d
fix(migration): keep newest row (MAX id) when deduplicating tag appli…
slvnlrt 1280987
revert(tags): restore independent tagModeActive state
slvnlrt 7eae2fe
fix(tags): address second round of CodeRabbit review
slvnlrt f391972
fix(tags): skip rows with undecodable required fields instead of fabr…
slvnlrt 70718be
fix(tags): remove broken optimistic update and alert() dialog
slvnlrt c3b0aa9
fix(tags): emit file events on tag delete, refetch files.by_id for in…
slvnlrt 23ae6a1
fix(tags): add extension to root-level file paths, validate entry UUIDs
slvnlrt c357493
fix(tags): pre-index content rows to avoid O(n²) tag merge, require e…
slvnlrt 6cd296c
fix(tags): secure FTS5 escaping, batch entry lookups for performance
slvnlrt a0c5009
fix(tags): remove redundant inline sea_orm imports
slvnlrt 296e7d7
fix(tags): validate entry UUIDs in create action before applying
slvnlrt b8e6aaf
fix: address code review feedback from CodeRabbit
slvnlrt 2fbd6b2
fix: validate create tag targets, confirm before delete, escape LIKE …
slvnlrt 35b165c
fix: prevent tagging ephemeral files and improve empty tag view UX
slvnlrt 24be53f
fix: platform confirm, parameterized SQL, remove dead code, handle se…
slvnlrt 2686561
fix: use native Tauri dialog for confirm on Windows (WebView2 broken)
slvnlrt dffc350
fix: prevent double callback in platform.confirm and distinguish tag …
slvnlrt d5b5155
fix: separate missing-target, null-UUID, and execution errors in tag …
slvnlrt eb663ca
Merge main into tags-and-media-fixes
jamiepine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
core/src/infra/db/migration/m20260125_000001_unique_user_metadata_tag.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| use sea_orm_migration::prelude::*; | ||
|
|
||
| #[derive(DeriveMigrationName)] | ||
| pub struct Migration; | ||
|
|
||
| #[async_trait::async_trait] | ||
| impl MigrationTrait for Migration { | ||
| async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
| let db = manager.get_connection(); | ||
|
|
||
| // Remove duplicate (user_metadata_id, tag_id) pairs, keeping the newest (MAX id) | ||
| // which has the most recent version/updated_at/device_uuid state. | ||
| // This must run before creating the unique index. | ||
| db.execute_unprepared( | ||
| "DELETE FROM user_metadata_tag \ | ||
| WHERE id NOT IN ( \ | ||
| SELECT MAX(id) FROM user_metadata_tag \ | ||
| GROUP BY user_metadata_id, tag_id \ | ||
| )", | ||
| ) | ||
| .await?; | ||
|
|
||
| // Add unique index so the pair can never be duplicated again. | ||
| manager | ||
| .create_index( | ||
| Index::create() | ||
| .if_not_exists() | ||
| .name("idx_umt_unique_pair") | ||
| .table(Alias::new("user_metadata_tag")) | ||
| .col(Alias::new("user_metadata_id")) | ||
| .col(Alias::new("tag_id")) | ||
| .unique() | ||
| .to_owned(), | ||
| ) | ||
| .await?; | ||
|
|
||
| Ok(()) | ||
| } | ||
|
|
||
| async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
| manager | ||
| .drop_index( | ||
| Index::drop() | ||
| .name("idx_umt_unique_pair") | ||
| .table(Alias::new("user_metadata_tag")) | ||
| .to_owned(), | ||
| ) | ||
| .await?; | ||
|
|
||
| Ok(()) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.