[PR #5463] [MERGED] Refactor CommandMenu to prevent duplicate scripts across categories #5547

Closed
opened 2026-02-26 14:34:29 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/5463
Author: @BramSuurdje
Created: 6/25/2025
Status: Merged
Merged: 6/25/2025
Merged by: @tremor021

Base: mainHead: fix-search-double-result-website


📝 Commits (1)

  • 319cf31 Refactor CommandMenu to prevent duplicate scripts across categories

📊 Changes

1 file changed (+48 additions, -28 deletions)

View changed files

📝 frontend/src/components/CommandMenu.tsx (+48 -28)

📄 Description

✍️ Description

This pull request refines the CommandMenu component in frontend/src/components/CommandMenu.tsx to ensure that scripts are displayed without duplicates across categories. The changes introduce a mechanism to globally track seen scripts and only render categories containing unique scripts.

Enhancements to script rendering:

Link: #

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.

before:
image

after:
image


🔄 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/5463 **Author:** [@BramSuurdje](https://github.com/BramSuurdje) **Created:** 6/25/2025 **Status:** ✅ Merged **Merged:** 6/25/2025 **Merged by:** [@tremor021](https://github.com/tremor021) **Base:** `main` ← **Head:** `fix-search-double-result-website` --- ### 📝 Commits (1) - [`319cf31`](https://github.com/community-scripts/ProxmoxVE/commit/319cf3167e8f42e199e14e3a03027687dbdcb221) Refactor CommandMenu to prevent duplicate scripts across categories ### 📊 Changes **1 file changed** (+48 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/CommandMenu.tsx` (+48 -28) </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 This pull request refines the `CommandMenu` component in `frontend/src/components/CommandMenu.tsx` to ensure that scripts are displayed without duplicates across categories. The changes introduce a mechanism to globally track seen scripts and only render categories containing unique scripts. Enhancements to script rendering: * [`frontend/src/components/CommandMenu.tsx`](diffhunk://#diff-fca568a5b1db55ee0757b5deace6840f1ca415a31eab55bdc32d6601d2e8a512L137-R157): Added logic to track scripts globally using a `Set` to prevent duplicates across categories. This ensures that only unique scripts are rendered within each category. * [`frontend/src/components/CommandMenu.tsx`](diffhunk://#diff-fca568a5b1db55ee0757b5deace6840f1ca415a31eab55bdc32d6601d2e8a512L164-R184): Modified the rendering logic to conditionally display categories based on the presence of unique scripts, improving the clarity of the menu. ## 🔗 Related PR / Issue Link: # ## ✅ 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. - [ ] 🌍 **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. before: ![image](https://github.com/user-attachments/assets/ee24eb4f-dd08-4911-b203-0b8b803c788a) after: ![image](https://github.com/user-attachments/assets/2602ee44-2168-41a1-8280-35c044fee2c6) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 14:34:29 +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#5547
No description provided.