[PR #7376] [MERGED] Fix navigation #6785

Closed
opened 2026-02-26 15:33:02 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/7376
Author: @BramSuurdje
Created: 9/3/2025
Status: Merged
Merged: 9/3/2025
Merged by: @tremor021

Base: mainHead: fix-navigation


📝 Commits (4)

  • 3386925 Removed double entries from the search to improve navigation
  • 84edac1 change input on search field to improve searchability
  • 9d10784 added type to search to make sure that LXC and VM's dont get mixed up
  • 0975366 run linting over changes

📊 Changes

1 file changed (+86 additions, -16 deletions)

View changed files

📝 frontend/src/components/command-menu.tsx (+86 -16)

📄 Description

✍️ Description

This pull request refactors and enhances the CommandMenu component in frontend/src/components/command-menu.tsx to improve accessibility, random script selection, and script grouping. The most important changes are outlined below.

Random Script Selection Improvements:

  • Updated the getRandomScript function to prevent selecting the same script multiple times in a session by tracking previously selected scripts with a Set. If all scripts have been selected, it resets to allow repeats.
  • Refactored the random script button logic to use the improved getRandomScript and update the set of selected scripts after each selection.

Accessibility Enhancements:

  • Added aria-label and keyboard handlers (onKeyDown) to the random script button and script items, allowing users to activate them using Enter or Space keys for better accessibility. [1] [2]

Script Grouping and Uniqueness:

  • Introduced getUniqueScriptsMap and getUniqueScriptsByCategory helpers to ensure scripts are uniquely grouped by category, preventing duplicate script entries in the command menu. [1] [2]

Code Structure and Cleanup:

  • Converted CommandMenu to a constant arrow function and moved the default export to the bottom of the file for consistency and clarity. [1] [2]

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.

🔄 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/7376 **Author:** [@BramSuurdje](https://github.com/BramSuurdje) **Created:** 9/3/2025 **Status:** ✅ Merged **Merged:** 9/3/2025 **Merged by:** [@tremor021](https://github.com/tremor021) **Base:** `main` ← **Head:** `fix-navigation` --- ### 📝 Commits (4) - [`3386925`](https://github.com/community-scripts/ProxmoxVE/commit/33869254816f0f260db1d769aa43c50c47b709b0) Removed double entries from the search to improve navigation - [`84edac1`](https://github.com/community-scripts/ProxmoxVE/commit/84edac17bdb43dc4edebbaec9e13ff2efd670f3f) change input on search field to improve searchability - [`9d10784`](https://github.com/community-scripts/ProxmoxVE/commit/9d10784ed0836c8ae99dc2f923c65f6a0f3dc560) added type to search to make sure that LXC and VM's dont get mixed up - [`0975366`](https://github.com/community-scripts/ProxmoxVE/commit/09753663dd48518004f824204a674980568bdf25) run linting over changes ### 📊 Changes **1 file changed** (+86 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/command-menu.tsx` (+86 -16) </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 refactors and enhances the `CommandMenu` component in `frontend/src/components/command-menu.tsx` to improve accessibility, random script selection, and script grouping. The most important changes are outlined below. **Random Script Selection Improvements:** - Updated the `getRandomScript` function to prevent selecting the same script multiple times in a session by tracking previously selected scripts with a `Set`. If all scripts have been selected, it resets to allow repeats. - Refactored the random script button logic to use the improved `getRandomScript` and update the set of selected scripts after each selection. **Accessibility Enhancements:** - Added `aria-label` and keyboard handlers (`onKeyDown`) to the random script button and script items, allowing users to activate them using Enter or Space keys for better accessibility. [[1]](diffhunk://#diff-d41fab64a265e466939c674039423ab30a28cf6a6b9385f02178c7ecb5c709b6L125-R183) [[2]](diffhunk://#diff-d41fab64a265e466939c674039423ab30a28cf6a6b9385f02178c7ecb5c709b6L142-R217) **Script Grouping and Uniqueness:** - Introduced `getUniqueScriptsMap` and `getUniqueScriptsByCategory` helpers to ensure scripts are uniquely grouped by category, preventing duplicate script entries in the command menu. [[1]](diffhunk://#diff-d41fab64a265e466939c674039423ab30a28cf6a6b9385f02178c7ecb5c709b6L68-R146) [[2]](diffhunk://#diff-d41fab64a265e466939c674039423ab30a28cf6a6b9385f02178c7ecb5c709b6L142-R217) **Code Structure and Cleanup:** - Converted `CommandMenu` to a constant arrow function and moved the default export to the bottom of the file for consistency and clarity. [[1]](diffhunk://#diff-d41fab64a265e466939c674039423ab30a28cf6a6b9385f02178c7ecb5c709b6L39-R58) [[2]](diffhunk://#diff-d41fab64a265e466939c674039423ab30a28cf6a6b9385f02178c7ecb5c709b6L174-R242) ## 🔗 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 15:33:02 +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#6785
No description provided.