Skip to content

Commit 82c659c

Browse files
feat(ui): new tag alias UI (TagStudioDev#534)
* updated parents and aliases to use the flowLaout in the build tag panel added shortcuts for adding and removing aliases and updated the alias ui to always show remove button and not cover alias aliases use flowlayout wrote test for buildTagPanel removeSelectedAlias parent tags now use flowlayout in build tag panel moved buttons for adding aliases and parents to be at the end of the flowLayout * added aliases and subtags to search results * aliases now use a table, removed unnecessary keyboard shortcuts * reverted subtags to regular list from flowlayout * chor remove redundant lambda * feat: added display names for tags * fix: aliases table enter/return and backspace work as expected, display names work as expected, adding aliases outputs them in order * format * fix: add parent button on build tag panel * fix: empty aliases where not being removed all the time * fix: alias name changes would be discarded when a new alias was created or an alias was removed * fix: removed display names, as they didn't display properly and should be added in a different PR * fix: mypy * fix: added missing session.expunge_all session.expunge_all() on line 621 was removed, added it back. * fix: parent_tags relationship in Tag class parent_tags primaryJoin and secondaryJoin where in the wrong order. They have been switched back to the proper order. * fix: pillow_jxl import was missing * fix: ruff * fix: type hint fixes * fix: fix the type hint fixes --------- Co-authored-by: Travis Abendshien <[email protected]>
1 parent dc2eed4 commit 82c659c

File tree

5 files changed

+160
-224
lines changed

5 files changed

+160
-224
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@ def search_tags(
619619
)
620620

621621
session.expunge_all()
622+
622623
return res
623624

624625
def get_all_child_tag_ids(self, tag_id: int) -> list[int]:
@@ -901,9 +902,9 @@ def tag_from_strings(self, strings: list[str] | str) -> list[int]:
901902
def add_tag(
902903
self,
903904
tag: Tag,
904-
subtag_ids: set[int] | None = None,
905-
alias_names: set[str] | None = None,
906-
alias_ids: set[int] | None = None,
905+
subtag_ids: list[int] | set[int] | None = None,
906+
alias_names: list[str] | set[str] | None = None,
907+
alias_ids: list[int] | set[int] | None = None,
907908
) -> Tag | None:
908909
with Session(self.engine, expire_on_commit=False) as session:
909910
try:
@@ -1077,9 +1078,9 @@ def remove_subtag(self, base_id: int, remove_tag_id: int) -> bool:
10771078
def update_tag(
10781079
self,
10791080
tag: Tag,
1080-
subtag_ids: set[int] | None = None,
1081-
alias_names: set[str] | None = None,
1082-
alias_ids: set[int] | None = None,
1081+
subtag_ids: list[int] | set[int] | None = None,
1082+
alias_names: list[str] | set[str] | None = None,
1083+
alias_ids: list[int] | set[int] | None = None,
10831084
) -> None:
10841085
"""Edit a Tag in the Library."""
10851086
self.add_tag(tag, subtag_ids, alias_names, alias_ids)

0 commit comments

Comments
 (0)