Skip to content

fix: prioritize exact tag shorthand matches#1385

Open
yosofbadr wants to merge 1 commit into
TagStudioDev:mainfrom
yosofbadr:pi-agent/issue-1381
Open

fix: prioritize exact tag shorthand matches#1385
yosofbadr wants to merge 1 commit into
TagStudioDev:mainfrom
yosofbadr:pi-agent/issue-1381

Conversation

@yosofbadr

@yosofbadr yosofbadr commented Jun 15, 2026

Copy link
Copy Markdown

Summary

Fixes #1381 by ranking exact tag shorthand matches ahead of longer tag-name prefix matches in tag search results.

This changes Library.search_tags() so shorthand text is considered when sorting match quality, and adds a regression test for the reported blue / black case where query b should rank the tag with shorthand b first.

Tasks Completed

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM - targeted local test/lint
    • Linux x86
    • Linux ARM
      • GitHub Actions also passed pytest on Linux and Windows for this PR.
  • Tested For:
    • Basic functionality - targeted search ranking regression test
    • PyInstaller executable
      • Local: .venv/bin/python -m pytest tests/test_library.py -q
      • Local: .venv/bin/ruff check src/tagstudio/core/library/alchemy/library.py tests/test_library.py
      • CI: Ruff, Pyright, REUSE, pytest Linux, pytest Windows, coverage all passed.

@yosofbadr yosofbadr changed the title fix: [UX]: entering a shorthand does not cause that tag to present at th... fix: prioritize exact tag shorthand matches Jun 15, 2026
@CyanVoxel CyanVoxel added TagStudio: Tags Relating to the TagStudio tag system Status: Review Needed A review of this is needed TagStudio: Search The TagStudio search engine Type: Fix A fix for a bug, typo, or other issue labels Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Review Needed A review of this is needed TagStudio: Search The TagStudio search engine TagStudio: Tags Relating to the TagStudio tag system Type: Fix A fix for a bug, typo, or other issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][UX]: entering a shorthand does not cause that tag to present at the top of the tag search results

2 participants