-
-
Notifications
You must be signed in to change notification settings - Fork 437
feat!: tag categories #655
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 all commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
260a4cf
refactor: remove TagBoxField and TagField (NOT WORKING)
python357-1 ab59fc4
refactor: remove tag field types
CyanVoxel f431cf7
ci: fix mypy and ruff tests
CyanVoxel d17e279
refactor: split up preview_panel
CyanVoxel 3dd740f
fix: search now uses `TagEntry` (#656)
Computerdores d16dd57
fix: move theme check inside class
CyanVoxel 3d7e0cb
refactor: reimplement file previews
CyanVoxel eba5583
refactor: modularize `file_attributes.py`
CyanVoxel 3123dff
ui: show fields in preview panel
CyanVoxel f58332e
search: remove TagEntry join
CyanVoxel 82e06ec
fix: remove extra `self.filter` assignment
CyanVoxel a306d68
add success return flag to `add_tags_to_entry()`
CyanVoxel b79c59d
refactor: use entry IDs instead of objects and indices
CyanVoxel c320af2
feat: add tag categories to preview panel
CyanVoxel 2d7e89d
ui: add "is category" checkbox in tag panel
CyanVoxel b03211e
fix: tags can be compared for name sorting
CyanVoxel 56a80ff
fix: don't add tags to previous selections
CyanVoxel feda150
fix: badges now properly update
CyanVoxel 0e7f75e
ui: hide sizeGrip
CyanVoxel 2c91cf6
ui: add blue ui color
CyanVoxel ff04802
ui: display empty selection; better multi-selection
CyanVoxel 73bfda7
cleanup comments; rename tsp to tag_search_panel
CyanVoxel b867bc2
fix(ui): properly unset container callbacks
CyanVoxel d016eef
fix: optimize queries
CyanVoxel 45d502f
fix: catch int cast exception
CyanVoxel 741c282
fix: remove unnecessary update calls
CyanVoxel 7bb4cb1
fix: restore try/except block in preview_panel
CyanVoxel 1755cb9
fix: correct type hints for get_tag_categories
CyanVoxel 50815aa
fix: tags no longer lazy load subtags and aliases
CyanVoxel 5ef1eeb
fix: recursively include parent tag categories
CyanVoxel b0324cd
chore: update copyright info
CyanVoxel d37e461
chore: remove unused code
CyanVoxel 8084e88
fix: load fields for selected entry
CyanVoxel 7d2dadb
refactor: remove `is_connected` from AddFieldModal
CyanVoxel f72ef71
fix: include category tags under their own categories
CyanVoxel 11fcea1
fix: badges now update when last tag is removed
CyanVoxel ab93705
fix: resolve differences with main
CyanVoxel 369d2dc
fix: return empty set in place of `None`
CyanVoxel af511d8
ui: add field highlighting, tweak theming
CyanVoxel 6461eeb
refactor!: eradicate use of the term "subtag"
CyanVoxel c1cea16
fix: catch and show library load errors
CyanVoxel 70c7f4f
tests: fix and/or remove tests
CyanVoxel be3d237
suppress db preference warnings
CyanVoxel 91ae1d9
tests: add field container tests
CyanVoxel ec80f24
tests: add tag category tests
CyanVoxel 0312291
refactor(ui): move recent libraries list to file menu
CyanVoxel 9706483
docs: update roadmap and docs for tag categories
CyanVoxel 1fc584d
fix: restore json migration functionality
CyanVoxel c2ab38c
logs: remove/update debug logs
CyanVoxel 7e1978d
chore: remove unused code
CyanVoxel 5207f28
tests: remove tests related to `TagBoxWidget`
CyanVoxel c8bbfe5
ui: optimize selection and badge updates
CyanVoxel 389d0fb
docs: update usage
CyanVoxel 6d2c1ec
fix: change typo of `tag.id` to `tag_id`
CyanVoxel 17e0522
fix: use term "child tags" instead of "subtags" in docstring
CyanVoxel 77d957f
fix: reference `child_id` instead of `parent_id` when deleting tags
CyanVoxel 5e1e4c5
add TODO comment for `update_thumbs()` optimization
CyanVoxel 114bc04
fix: combine and check (most) built-in tag data from JSON
CyanVoxel 3049afa
refactor: rename `select_item()` to `toggle_item_selection()`
CyanVoxel 5a4ba68
add TODO to optimize `add_tags_to_entry()`
CyanVoxel 4c019ca
fix: remove unnecessary joins in search
CyanVoxel 2c966ad
Revert "fix: remove unnecessary joins in search"
CyanVoxel cf30ee6
fix: remove unnecessary joins in search
CyanVoxel a0fe867
reremove unused method `get_all_child_tag_ids()`
CyanVoxel cacfc26
Merge branch 'main' into tag-categories-feat
CyanVoxel db53d61
fix: migrate user-edited tag colors for built-in tags
CyanVoxel 959a76d
style: update header for contributor-created files
CyanVoxel 4030e80
fix: use absolute path in "open file" context menu
CyanVoxel 59122dc
chore: change paramater type hint
CyanVoxel 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,15 @@ | ||
| --- | ||
| tags: | ||
| - Upcoming Feature | ||
| --- | ||
|
|
||
| # Tag Categories | ||
| # Tag Categories (v9.5) | ||
|
|
||
| Replaces [Tag Fields](field.md#tag_box). Tags are able to be marked as a “category” which then displays as tag fields currently do, with any tags inheriting from that category being displayed underneath. | ||
| The "Is Category" property of tags determines if a tag should be treated as a category itself when being organized inside the preview panel. Tags marked as categories will show themselves and all tags inheriting from it (including recursively) underneath a field-like section with the tag's name. This means that duplicates of tags can appear on entries if the tag inherits from multiple parent categories, however this is by design and reflects the nature multiple inheritance. Any tags not inheriting from a category tag will simply show under a default "Tag" section. | ||
|
|
||
| ### Built-In Tags and Categories | ||
|
|
||
| The built-in tags "Favorite" and "Archived" inherit from the built-in "Meta Tags" category which is marked as a category by default. This behavior of default tags can be fully customized by disabling the category option and/or by adding/removing the tags' Parent Tags. | ||
|
|
||
| ### Migrating from v9.4 Libraries | ||
|
|
||
| Due to the nature of how tags and Tag Felids operated prior to v9.5, the organization style of Tag Categories vs Tag Fields is not 1:1. Instead of tags being organized into fields on a per-entry basis, tags themselves determine their organizational layout via the "Is Property" flag. Any tags _(not currently inheriting from either the "Favorite" or "Archived" tags)_ will be shown under the default "Tags" header upon migrating to the v9.5+ library format. Similar organization to Tag Fields can be achieved by using the built-in "Meta Tags" tag or any other marked with "Is Category" and then setting those tags as parents for other tags to inherit from. |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,22 @@ | ||
| # Copyright (C) 2025 | ||
| # Licensed under the GPL-3.0 License. | ||
| # Created for TagStudio: https://github.com/CyanVoxel/TagStudio | ||
|
|
||
| from sqlalchemy import ForeignKey | ||
| from sqlalchemy.orm import Mapped, mapped_column | ||
|
|
||
| from .db import Base | ||
|
|
||
|
|
||
| class TagSubtag(Base): | ||
| __tablename__ = "tag_subtags" | ||
| class TagParent(Base): | ||
| __tablename__ = "tag_parents" | ||
|
|
||
| parent_id: Mapped[int] = mapped_column(ForeignKey("tags.id"), primary_key=True) | ||
| child_id: Mapped[int] = mapped_column(ForeignKey("tags.id"), primary_key=True) | ||
|
|
||
|
|
||
| class TagField(Base): | ||
| __tablename__ = "tag_fields" | ||
| class TagEntry(Base): | ||
| __tablename__ = "tag_entries" | ||
|
|
||
| field_id: Mapped[int] = mapped_column(ForeignKey("tag_box_fields.id"), primary_key=True) | ||
| tag_id: Mapped[int] = mapped_column(ForeignKey("tags.id"), primary_key=True) | ||
| entry_id: Mapped[int] = mapped_column(ForeignKey("entries.id"), primary_key=True) | ||
Oops, something went wrong.
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.