[PR #11534] [MERGED] fix(frontend): implement weighted search scoring for command menu #9554

Closed
opened 2026-02-26 17:30:53 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/11534
Author: @ls-root
Created: 2/4/2026
Status: Merged
Merged: 2/4/2026
Merged by: @MickLesk

Base: mainHead: fix/search


📝 Commits (2)

  • 69017d8 fix(frontend): implement weighted search scoring for command menu
  • e98ca46 perf(frontend): optimize search logic

📊 Changes

1 file changed (+104 additions, -15 deletions)

View changed files

📝 frontend/src/components/command-menu.tsx (+104 -15)

📄 Description

✍️ Description

The previous cmdk search was filtered correctly but then sorted by category order rather than match strength. This caused "Dokpoly" to appear above "Traefik", if you searched for Traefik, simply because its category (Containers) comes before Traefik's category alphabetically.

  • Flatten search results into a single "Search Results" group.
  • Implement scoring to prioritize name matches over descriptions.
  • Revert to category grouping only when the search query is empty.

Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.
  • 🆕 New script – A fully functional and tested script or script set.
  • 🌍 Website update – Changes to website-related JSON files or metadata.
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE/pull/11534 **Author:** [@ls-root](https://github.com/ls-root) **Created:** 2/4/2026 **Status:** ✅ Merged **Merged:** 2/4/2026 **Merged by:** [@MickLesk](https://github.com/MickLesk) **Base:** `main` ← **Head:** `fix/search` --- ### 📝 Commits (2) - [`69017d8`](https://github.com/community-scripts/ProxmoxVE/commit/69017d8a8b84b88f045c079ed2c2e52999542d09) fix(frontend): implement weighted search scoring for command menu - [`e98ca46`](https://github.com/community-scripts/ProxmoxVE/commit/e98ca4608f4c35c0b6f5c77a15b934228047f4ca) perf(frontend): optimize search logic ### 📊 Changes **1 file changed** (+104 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/command-menu.tsx` (+104 -15) </details> ### 📄 Description <!--🛑 New scripts must be submitted to [ProxmoxVED](https://github.com/community-scripts/ProxmoxVED) for testing. PRs without prior testing will be closed. --> ## ✍️ Description The previous `cmdk` search was filtered correctly but then sorted by category order rather than match strength. This caused "Dokpoly" to appear above "Traefik", if you searched for Traefik, simply because its category (Containers) comes before Traefik's category alphabetically. - Flatten search results into a single "Search Results" group. - Implement scoring to prioritize name matches over descriptions. - Revert to category grouping only when the search query is empty. ## ✅ Prerequisites (**X** in brackets) - [x] **Self-review completed** – Code follows project standards. - [x] **Tested thoroughly** – Changes work as expected. - [x] **No security risks** – No hardcoded secrets, unnecessary privilege escalations, or permission issues. --- ## 🛠️ Type of Change (**X** in brackets) - [x] 🐞 **Bug fix** – Resolves an issue without breaking functionality. - [ ] ✨ **New feature** – Adds new, non-breaking functionality. - [ ] 💥 **Breaking change** – Alters existing functionality in a way that may require updates. - [ ] 🆕 **New script** – A fully functional and tested script or script set. - [x] 🌍 **Website update** – Changes to website-related JSON files or metadata. - [ ] 🔧 **Refactoring / Code Cleanup** – Improves readability or maintainability without changing functionality. - [ ] 📝 **Documentation update** – Changes to `README`, `AppName.md`, `CONTRIBUTING.md`, or other docs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 17:30:53 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ProxmoxVE#9554
No description provided.