[PR #7405] refactor: Enhance ScriptAccordion and Sidebar components to support selectedCategory state #7116

Open
opened 2025-11-20 08:04:43 -05:00 by saavagebueno · 0 comments
Owner

Original Pull Request: https://github.com/community-scripts/ProxmoxVE/pull/7405

State: closed
Merged: Yes


✍️ Description

This pull request enhances category and script navigation in the frontend, allowing users to maintain category context when browsing scripts. The changes improve usability by ensuring that script selections and links consistently include category information, and refactor code for readability and consistency.

Category and Script Navigation Improvements:

  • Script navigation now includes the selected category in URL query parameters, preserving context when moving between scripts and categories (frontend/src/app/category-view/page.tsx, frontend/src/app/category-view/page.tsxL76-R87).
  • The ScriptAccordion and Sidebar components have been updated to accept and manage both selectedScript and selectedCategory, ensuring accurate UI state and navigation (frontend/src/app/scripts/_components/script-accordion.tsx, [1]; frontend/src/app/scripts/_components/sidebar.tsx, [2].
  • Script links in the accordion now include both script and category in the query parameters, and selecting a script also updates the selected category (frontend/src/app/scripts/_components/script-accordion.tsx, [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.
**Original Pull Request:** https://github.com/community-scripts/ProxmoxVE/pull/7405 **State:** closed **Merged:** Yes --- <!--🛑 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 enhances category and script navigation in the frontend, allowing users to maintain category context when browsing scripts. The changes improve usability by ensuring that script selections and links consistently include category information, and refactor code for readability and consistency. **Category and Script Navigation Improvements:** * Script navigation now includes the selected category in URL query parameters, preserving context when moving between scripts and categories (`frontend/src/app/category-view/page.tsx`, [frontend/src/app/category-view/page.tsxL76-R87](diffhunk://#diff-b3ba61946cb03ba35acdd5a8e023072b7373c93a62b3a24791506ad6da3cc15eL76-R87)). * The `ScriptAccordion` and `Sidebar` components have been updated to accept and manage both `selectedScript` and `selectedCategory`, ensuring accurate UI state and navigation (`frontend/src/app/scripts/_components/script-accordion.tsx`, [[1]](diffhunk://#diff-4820708f02a219519a2fbdc343314c387c27d0c2fa903bd788ec92fdb35ff1d8L1-R25); `frontend/src/app/scripts/_components/sidebar.tsx`, [[2]](diffhunk://#diff-7bc2d01c7be6690f7c030cdc21dbb017fdad1916ccd0528e8cff32ca57bc6d53R11-R22). * Script links in the accordion now include both script and category in the query parameters, and selecting a script also updates the selected category (`frontend/src/app/scripts/_components/script-accordion.tsx`, [[1]](diffhunk://#diff-4820708f02a219519a2fbdc343314c387c27d0c2fa903bd788ec92fdb35ff1d8L97-R110) [[2]](diffhunk://#diff-4820708f02a219519a2fbdc343314c387c27d0c2fa903bd788ec92fdb35ff1d8L44-R61). ## 🔗 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.
saavagebueno added the pull-request label 2025-11-20 08:04:44 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#7116