Skip to content

Commit c06f3bb

Browse files
authored
feat!: expanded tag color system (#709)
* attempt at adding `TagColor` table * store both columns of `TagColor` inside `Tag` table * fix: fix tag color relationships * refactor: replace TagColor enums with TagColorGroup system * ui: derive tag accent colors from primary * refactor: move dynamic tag color logic, apply to "+" button * feat(ui): add neon tag colors * remove tag text color field * ui: use secondary color for border and text * ui: add TagColorPreview widget * feat(ui): add new tag color selector * ui: add color name tooltips * ui: tweak tag colors and selector * feat: add `namespaces` table * translations: add + update translation keys * tests: update fixtures * chore: code cleanup * ui: add spacing between color groups * fix: expand refactor to create and add button * chore: format with ruff
1 parent 4c337cb commit c06f3bb

File tree

20 files changed

+1619
-396
lines changed

20 files changed

+1619
-396
lines changed

tagstudio/resources/translations/en.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"app.git": "Git Commit",
33
"app.pre_release": "Pre-Release",
44
"app.title": "{base_title} - Library '{library_dir}'",
5+
"color.title.no_color": "No Color",
56
"drop_import.description": "The following files have filenames already exist in the library",
67
"drop_import.duplicates_choice.plural": "The following {count} files have filenames that already exist in the library.",
78
"drop_import.duplicates_choice.singular": "The following file has a filename that already exists in the library.",
@@ -88,6 +89,7 @@
8889
"generic.filename": "Filename",
8990
"generic.navigation.back": "Back",
9091
"generic.navigation.next": "Next",
92+
"generic.none": "None",
9193
"generic.overwrite_alt": "&Overwrite",
9294
"generic.overwrite": "Overwrite",
9395
"generic.paste": "Paste",
@@ -131,7 +133,7 @@
131133
"json_migration.heading.paths": "Paths:",
132134
"json_migration.heading.shorthands": "Shorthands:",
133135
"json_migration.heading.tags": "Tags:",
134-
"json_migration.info.description": "Library save files created with TagStudio versions <b>9.4 and below</b> will need to be migrated to the new <b>v9.5+</b> format.<br><h2>What you need to know:</h2><ul><li>Your existing library save file will <b><i>NOT</i></b> be deleted</li><li>Your personal files will <b><i>NOT</i></b> be deleted, moved, or modified</li><li>The new v9.5+ save format can not be opened in earlier versions of TagStudio</li></ul>",
136+
"json_migration.info.description": "Library save files created with TagStudio versions <b>9.4 and below</b> will need to be migrated to the new <b>v9.5+</b> format.<br><h2>What you need to know:</h2><ul><li>Your existing library save file will <b><i>NOT</i></b> be deleted</li><li>Your personal files will <b><i>NOT</i></b> be deleted, moved, or modified</li><li>The new v9.5+ save format can not be opened in earlier versions of TagStudio</li></ul><h3>What's changed:</h3><ul><li>\"Tag Fields\" have been replaced by \"Tags Categories\". Instead of adding tags to fields first, tags now get added directly to file entries. They're then automatically organized into categories based on parent tags marked with the new \"Is Category\" property in the tag editing menu. Any tag can be marked as a category, and child tags will sort themselves underneath parent tags marked as categories. The \"Favorite\" and \"Archived\" tags now inherit from a new \"Meta Tags\" tag which is marked as a category by default.</li><li>Tag colors have been tweaked and expanded upon. Some colors have been renamed or consolidated, however all tag colors will still convert to exact or close matches in v9.5.</li></ul><ul>",
135137
"json_migration.migrating_files_entries": "Migrating {entries:,d} File Entries...",
136138
"json_migration.migration_complete_with_discrepancies": "Migration Complete, Discrepancies Found",
137139
"json_migration.migration_complete": "Migration Complete!",
@@ -202,6 +204,7 @@
202204
"tag.add.plural": "Add Tags",
203205
"tag.add": "Add Tag",
204206
"tag.aliases": "Aliases",
207+
"tag.choose_color": "Choose Tag Color",
205208
"tag.color": "Color",
206209
"tag.confirm_delete": "Are you sure you want to delete the tag \"{tag_name}\"?",
207210
"tag.create": "Create Tag",

tagstudio/src/core/enums.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ class LibraryPrefs(DefaultEnum):
7171
IS_EXCLUDE_LIST = True
7272
EXTENSION_LIST: list[str] = [".json", ".xmp", ".aae"]
7373
PAGE_SIZE: int = 500
74-
DB_VERSION: int = 3
74+
DB_VERSION: int = 4

tagstudio/src/core/library/alchemy/db.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def make_tables(engine: Engine) -> None:
4949
if not autoincrement_val or autoincrement_val <= RESERVED_TAG_END:
5050
conn.execute(
5151
text(
52-
"INSERT INTO tags (id, name, color, is_category) VALUES "
53-
f"({RESERVED_TAG_END}, 'temp', 1, false)"
52+
"INSERT INTO tags (id, name, color_namespace, color_slug, is_category) VALUES "
53+
f"({RESERVED_TAG_END}, 'temp', NULL, NULL, false)"
5454
)
5555
)
5656
conn.execute(text(f"DELETE FROM tags WHERE id = {RESERVED_TAG_END}"))

0 commit comments

Comments
 (0)