Skip to content
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

Autocomplete tags in the preview panel #495

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

Tyrannicodin
Copy link
Contributor

@Tyrannicodin Tyrannicodin commented Sep 11, 2024

Adds autocomplete to tags in the preview panel, for all tag fields.
You can now add tags through several methods:

  1. Beginning to type a tag's name and
    a. Clicking enter to get the first tag that matches the text
    b. Using the arrow keys to select a tag from the autocomplete popup
    c. Clicking on a tag from the autocomplete popup
  2. Clicking the plus button and using the previous tag modal.

Requires #481

@yedpodtrzitko
Copy link
Collaborator

I'll read through the code, but same thing as with #481 - please add some tests to verify the behaviour automatically and to prevent regressions in future. There are some existing tests for widgets in tests/qt, so you can use these as an inspiration. Thank you.

@Tyrannicodin
Copy link
Contributor Author

Yep that's fine, I made this before I looked at that pr so can add some tests to both of them.

@yedpodtrzitko
Copy link
Collaborator

@CyanVoxel can you please enable the workflow to run on this PR? Thanks.

@CyanVoxel CyanVoxel added Type: QoL A quality of life (QoL) enhancement or suggestion Type: UI/UX User interface and/or user experience TagStudio: Tags Relating to the TagStudio tag system TagStudio: Search The TagStudio search engine labels Sep 11, 2024
@CyanVoxel CyanVoxel added this to the Alpha v9.5 (Post-SQL) milestone Sep 11, 2024
@CyanVoxel CyanVoxel added the Priority: Medium An issue that shouldn't be be saved for last label Sep 11, 2024
Copy link
Collaborator

@yedpodtrzitko yedpodtrzitko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

tagstudio/src/qt/modals/tag_search.py Outdated Show resolved Hide resolved
tagstudio/src/qt/widgets/tag_box.py Outdated Show resolved Hide resolved
@yedpodtrzitko
Copy link
Collaborator

yedpodtrzitko commented Sep 12, 2024

here's a bug:

Steps to reproduce:

  • only Archived and Favorite tags exist
  • type meow into the field to add new tag & press Enter

Expected behaviour:

  • since no matching tag exists, no tag should be added

Current behaviour:

  • tag Archived is added

Copy link
Collaborator

@yedpodtrzitko yedpodtrzitko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some tests for the widget, thanks.

@CyanVoxel CyanVoxel added the Status: Changes Requested Changes are quested to this label Sep 13, 2024
@Tyrannicodin
Copy link
Contributor Author

Added tests and fixed the bugs 👍

Copy link
Collaborator

@yedpodtrzitko yedpodtrzitko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks good, beside the Enter behaviour on no-match. good job.

tagstudio/tests/qt/test_tag_widget.py Outdated Show resolved Hide resolved
tagstudio/src/qt/widgets/tag_box.py Outdated Show resolved Hide resolved
tagstudio/src/qt/widgets/tag_box.py Outdated Show resolved Hide resolved
tagstudio/src/qt/widgets/tag_box.py Show resolved Hide resolved
@Tyrannicodin
Copy link
Contributor Author

Changes made

@yedpodtrzitko
Copy link
Collaborator

please fix the pipeline

@yedpodtrzitko
Copy link
Collaborator

it's quite misbehaving

Screen.Recording.2024-09-22.at.8.21.15.mov

@Tyrannicodin
Copy link
Contributor Author

What. I've never seen it do that.
I'll look into it in the morning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium An issue that shouldn't be be saved for last Status: Changes Requested Changes are quested to this TagStudio: Search The TagStudio search engine TagStudio: Tags Relating to the TagStudio tag system Type: QoL A quality of life (QoL) enhancement or suggestion Type: UI/UX User interface and/or user experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants