Skip to content

feat: expanded tag color system #709

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 22 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e330321
attempt at adding `TagColor` table
CyanVoxel Jan 17, 2025
2142176
store both columns of `TagColor` inside `Tag` table
CyanVoxel Jan 17, 2025
cd2e00c
fix: fix tag color relationships
CyanVoxel Jan 18, 2025
3dc7088
refactor: replace TagColor enums with TagColorGroup system
CyanVoxel Jan 19, 2025
53e82d7
ui: derive tag accent colors from primary
CyanVoxel Jan 19, 2025
8edff3e
refactor: move dynamic tag color logic, apply to "+" button
CyanVoxel Jan 20, 2025
3a2e87c
feat(ui): add neon tag colors
CyanVoxel Jan 21, 2025
bebe6f3
remove tag text color field
CyanVoxel Jan 21, 2025
fe7451a
ui: use secondary color for border and text
CyanVoxel Jan 21, 2025
dea258e
ui: add TagColorPreview widget
CyanVoxel Jan 21, 2025
592a563
feat(ui): add new tag color selector
CyanVoxel Jan 22, 2025
8b26e89
ui: add color name tooltips
CyanVoxel Jan 22, 2025
fbf8b3e
ui: tweak tag colors and selector
CyanVoxel Jan 22, 2025
744942f
feat: add `namespaces` table
CyanVoxel Jan 22, 2025
d344eb1
translations: add + update translation keys
CyanVoxel Jan 22, 2025
74ca1a7
tests: update fixtures
CyanVoxel Jan 22, 2025
2b23dbf
chore: code cleanup
CyanVoxel Jan 22, 2025
81dadc4
ui: add spacing between color groups
CyanVoxel Jan 22, 2025
c932c45
Merge branch 'main' into custom-tag-colors
CyanVoxel Jan 23, 2025
686c0a3
fix: expand refactor to create and add button
CyanVoxel Jan 23, 2025
2bebe3c
Merge branch 'main' into custom-tag-colors
CyanVoxel Jan 26, 2025
9811d1b
chore: format with ruff
CyanVoxel Jan 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tagstudio/resources/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"app.git": "Git Commit",
"app.pre_release": "Pre-Release",
"app.title": "{base_title} - Library '{library_dir}'",
"color.title.no_color": "No Color",
"drop_import.description": "The following files have filenames already exist in the library",
"drop_import.duplicates_choice.plural": "The following {count} files have filenames that already exist in the library.",
"drop_import.duplicates_choice.singular": "The following file has a filename that already exists in the library.",
Expand Down Expand Up @@ -88,6 +89,7 @@
"generic.filename": "Filename",
"generic.navigation.back": "Back",
"generic.navigation.next": "Next",
"generic.none": "None",
"generic.overwrite_alt": "&Overwrite",
"generic.overwrite": "Overwrite",
"generic.paste": "Paste",
Expand Down Expand Up @@ -131,7 +133,7 @@
"json_migration.heading.paths": "Paths:",
"json_migration.heading.shorthands": "Shorthands:",
"json_migration.heading.tags": "Tags:",
"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>",
"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>",
"json_migration.migrating_files_entries": "Migrating {entries:,d} File Entries...",
"json_migration.migration_complete_with_discrepancies": "Migration Complete, Discrepancies Found",
"json_migration.migration_complete": "Migration Complete!",
Expand Down Expand Up @@ -199,6 +201,7 @@
"tag.add.plural": "Add Tags",
"tag.add": "Add Tag",
"tag.aliases": "Aliases",
"tag.choose_color": "Choose Tag Color",
"tag.color": "Color",
"tag.confirm_delete": "Are you sure you want to delete the tag \"{tag_name}\"?",
"tag.create": "Create Tag",
Expand Down
2 changes: 1 addition & 1 deletion tagstudio/src/core/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ class LibraryPrefs(DefaultEnum):
IS_EXCLUDE_LIST = True
EXTENSION_LIST: list[str] = [".json", ".xmp", ".aae"]
PAGE_SIZE: int = 500
DB_VERSION: int = 3
DB_VERSION: int = 4
4 changes: 2 additions & 2 deletions tagstudio/src/core/library/alchemy/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def make_tables(engine: Engine) -> None:
if not autoincrement_val or autoincrement_val <= RESERVED_TAG_END:
conn.execute(
text(
"INSERT INTO tags (id, name, color, is_category) VALUES "
f"({RESERVED_TAG_END}, 'temp', 1, false)"
"INSERT INTO tags (id, name, color_namespace, color_slug, is_category) VALUES "
f"({RESERVED_TAG_END}, 'temp', NULL, NULL, false)"
)
)
conn.execute(text(f"DELETE FROM tags WHERE id = {RESERVED_TAG_END}"))
Expand Down
Loading
Loading