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

refactor(ui): recycle tag list in TagSearchPanel #788

Merged
merged 10 commits into from
Feb 6, 2025

Conversation

CyanVoxel
Copy link
Member

@CyanVoxel CyanVoxel commented Feb 4, 2025

Summary

This PR greatly improves the performance of the TagSearchPanel by recycling the TagWidgets in the scroll layout rather than constantly destroying and recreating them. There's also a few minor fixes in related areas:

Miscellaneous Changes and Fixes

  • Use the "New Tag" title for both title and window of the "New Tag" modal
  • Can now search library for tags from the Tag Manager and "Add Tag" preview panel modal
  • The build tag panel spawned by the "Create & Add" button now correctly keeps focus on the tag name. This allows Esc to be used to quickly close the modal
  • Order tag results by name before returning from SQL. This fixes a bug where only 100 "random" tags were returned before being sorted alphabetically on the UI side
  • Only initialize TagDatabasePanel (Tag Manager) once instead of every time it's opened
  • Only initialize FileExtensionModal (Tag Manager) once per-library instead of every time it's opened
  • Remove redundant update calls to TagSearchPanel

@CyanVoxel CyanVoxel added Type: Refactor Code that needs to be restructured or cleaned up Type: QoL A quality of life (QoL) enhancement or suggestion Type: UI/UX User interface and/or user experience Priority: Medium An issue that shouldn't be be saved for last labels Feb 4, 2025
@CyanVoxel CyanVoxel added this to the Alpha v9.5 (Post-SQL) milestone Feb 4, 2025
@Tishj
Copy link

Tishj commented Feb 4, 2025

Ah the 100 explains a lot, I saw the __del__ I added trigger 100 times for every search!

@CyanVoxel CyanVoxel marked this pull request as ready for review February 4, 2025 08:22
@CyanVoxel CyanVoxel merged commit 466af1e into main Feb 6, 2025
10 checks passed
@CyanVoxel CyanVoxel deleted the tag-search-recycling branch February 6, 2025 03:15
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 Type: QoL A quality of life (QoL) enhancement or suggestion Type: Refactor Code that needs to be restructured or cleaned up Type: UI/UX User interface and/or user experience
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants